Re: [PATCH v2] KVM: selftests: Use TAP interface in the set_memory_region test

2024-05-03 Thread Thomas Huth
On 02/05/2024 21.37, Sean Christopherson wrote: On Fri, Apr 26, 2024, Thomas Huth wrote: Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. (Note: We are not using the KVM_ONE_VCPU_TEST_SUITE() macro here since

[PATCH v2] KVM: selftests: Use TAP interface in the set_memory_region test

2024-04-26 Thread Thomas Huth
vm_create_with_one_vcpu()) Reviewed-by: Andrew Jones Signed-off-by: Thomas Huth --- v2: - Rebase to linux-next branch - Make "loops" variable static - Added Andrew's Reviewed-by .../selftests/kvm/set_memory_region_test.c| 86 +-- 1 file changed, 42 insertions(+

Re: [PATCH] KVM: selftests: Use TAP interface in the set_memory_region test

2024-04-26 Thread Thomas Huth
On 26/04/2024 12.07, Muhammad Usama Anjum wrote: On 4/26/24 1:55 PM, Thomas Huth wrote: Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. (Note: We are not using the KVM_ONE_VCPU_TEST_SUITE() macro here since

[PATCH] KVM: selftests: Use TAP interface in the set_memory_region test

2024-04-26 Thread Thomas Huth
vm_create_with_one_vcpu()) Signed-off-by: Thomas Huth --- .../selftests/kvm/set_memory_region_test.c| 86 +-- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/testing/selftests/kvm/set_memory_region_test.c

Re: [PATCH] KVM: selftests: Use TAP in the steal_time test

2024-03-15 Thread Thomas Huth
On 11/12/2023 10.39, Thomas Huth wrote: On 19/10/2023 15.13, Andrew Jones wrote: On Thu, Oct 19, 2023 at 11:59:00AM +0200, Thomas Huth wrote: For easier use of the tests in automation and for having some status information for the user while the test is running, let's provide some TAP o

[PATCH v3 8/8] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test

2024-02-08 Thread Thomas Huth
Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../kvm/x86_64/userspace_msr_exit_test.c | 52 +-- 1 file changed, 13 insertions(+), 39 deletions(-) diff

[PATCH v3 7/8] KVM: selftests: x86: Use TAP interface in the vmx_pmu_caps test

2024-02-08 Thread Thomas Huth
Use the kvm_test_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../selftests/kvm/x86_64/vmx_pmu_caps_test.c | 50 --- 1 file changed, 11 insertions(+), 39 deletions(-) diff

[PATCH v3 2/8] KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it

2024-02-08 Thread Thomas Huth
The regs structure just accidentally contains the right values from the previous test in the spot where we want to change rbx. It's cleaner if we properly initialize the structure here before using it. Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- tools/testing/selftest

[PATCH v3 5/8] KVM: selftests: x86: Use TAP interface in the sync_regs test

2024-02-08 Thread Thomas Huth
ve also to make sure to create the expected state at the beginning of each test, so some parts grow a little bit - which should be OK considering that the individual tests are more self-contained now. Suggested-by: David Matlack Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- ...

[PATCH v3 6/8] KVM: selftests: x86: Use TAP interface in the fix_hypercall test

2024-02-08 Thread Thomas Huth
Use the kvm_test_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../selftests/kvm/x86_64/fix_hypercall_test.c | 27 --- 1 file changed, 18 insertions(+), 9 deletions(-) diff

[PATCH v3 4/8] KVM: selftests: Add a macro to define a test with one vcpu

2024-02-08 Thread Thomas Huth
ntroduce a KVM_ONE_VCPU_TEST() macro here which takes care of this. Suggested-by: Sean Christopherson Link: https://lore.kernel.org/all/y2v+b3xxykjsm%2...@google.com/ Signed-off-by: Thomas Huth --- .../selftests/kvm/include/kvm_test_harness.h | 36 +++ 1 file changed, 36 insertions(+) create m

[PATCH v3 3/8] KVM: selftests: Move setting a vCPU's entry point to a dedicated API

2024-02-08 Thread Thomas Huth
ereas *requiring* the entry point to be specified at vCPU creation makes it difficult to create a generic harness, e.g. the boilerplate setup/teardown can't easily create and destroy the VM and vCPUs. Signed-off-by: Sean Christopherson Signed-off-by: Thomas Huth --- .../selftests/k

[PATCH v3 1/8] KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate

2024-02-08 Thread Thomas Huth
In the spots where we are expecting a successful run, we should use vcpu_run() instead of _vcpu_run() to make sure that the run did not fail. Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 10 +- 1 file changed, 5

[PATCH v3 0/8] Use TAP in some more x86 KVM selftests

2024-02-08 Thread Thomas Huth
sted by Sean (see third patch) and use it in the following patches - Add a new patch to convert vmx_pmu_caps_test.c, too Sean Christopherson (1): KVM: selftests: Move setting a vCPU's entry point to a dedicated API Thomas Huth (7): KVM: selftests: x86: sync_regs_test: Use vcpu_run() wher

Re: [PATCH v2 7/7] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test

2024-02-08 Thread Thomas Huth
On 26/01/2024 20.32, Sean Christopherson wrote: On Thu, Oct 05, 2023, Thomas Huth wrote: Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Note: We're not using the KVM_ONE_VCPU_TEST() macro here (bu

Re: [PATCH] KVM: selftests: Use TAP in the steal_time test

2023-12-11 Thread Thomas Huth
On 19/10/2023 15.13, Andrew Jones wrote: On Thu, Oct 19, 2023 at 11:59:00AM +0200, Thomas Huth wrote: For easier use of the tests in automation and for having some status information for the user while the test is running, let's provide some TAP output in this test. Signed-off-by: Thomas

[PATCH] KVM: selftests: Use TAP in the steal_time test

2023-10-19 Thread Thomas Huth
For easier use of the tests in automation and for having some status information for the user while the test is running, let's provide some TAP output in this test. Signed-off-by: Thomas Huth --- NB: This patch does not use the interface from kselftest_harness.h since it is not

[PATCH v2 1/7] KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate

2023-10-05 Thread Thomas Huth
In the spots where we are expecting a successful run, we should use vcpu_run() instead of _vcpu_run() to make sure that the run did not fail. Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 10 +- 1 file changed, 5

[PATCH v2 6/7] KVM: selftests: x86: Use TAP interface in the vmx_pmu_caps test

2023-10-05 Thread Thomas Huth
Use the kvm_test_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../selftests/kvm/x86_64/vmx_pmu_caps_test.c | 50 --- 1 file changed, 11 insertions(+), 39 deletions(-) diff

[PATCH v2 7/7] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test

2023-10-05 Thread Thomas Huth
guest code function. Signed-off-by: Thomas Huth --- .../kvm/x86_64/userspace_msr_exit_test.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c b/tools/testing/selftests/kvm/x

[PATCH v2 0/7] Use TAP in some more x86 KVM selftests

2023-10-05 Thread Thomas Huth
cro" patch (already merged) - Split the fixes in the sync_regs_test into separate patches (see the first two patches) - Introduce the KVM_ONE_VCPU_TEST_SUITE() macro as suggested by Sean (see third patch) and use it in the following patches - Add a new patch to convert vmx_pmu_caps_test.c, t

[PATCH v2 5/7] KVM: selftests: x86: Use TAP interface in the fix_hypercall test

2023-10-05 Thread Thomas Huth
Use the kvm_test_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../selftests/kvm/x86_64/fix_hypercall_test.c | 27 --- 1 file changed, 18 insertions(+), 9 deletions(-) diff

[PATCH v2 4/7] KVM: selftests: x86: Use TAP interface in the sync_regs test

2023-10-05 Thread Thomas Huth
ve also to make sure to create the expected state at the beginning of each test, so some parts grow a little bit - which should be OK considering that the individual tests are more self-contained now. Suggested-by: David Matlack Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- ...

[PATCH v2 2/7] KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it

2023-10-05 Thread Thomas Huth
The regs structure just accidentially contains the right values from the previous test in the spot where we want to change rbx. It's cleaner if we properly initialize the structure here before using it. Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- tools/testing/self

[PATCH v2 3/7] KVM: selftests: Add a macro to define a test with one vcpu

2023-10-05 Thread Thomas Huth
ntroduce a KVM_ONE_VCPU_TEST() macro here which takes care of this. Suggested-by: Sean Christopherson Link: https://lore.kernel.org/all/y2v+b3xxykjsm%2...@google.com/ Signed-off-by: Thomas Huth --- .../selftests/kvm/include/kvm_test_harness.h | 35 +++ 1 file changed, 35 insertions(+) create m