From: Thomas Huth <thuth@redhat.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org
Cc: Shuah Khan <shuah@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [PATCH v2 7/7] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test
Date: Thu, 5 Oct 2023 16:38:39 +0200 [thread overview]
Message-ID: <20231005143839.365297-8-thuth@redhat.com> (raw)
In-Reply-To: <20231005143839.365297-1-thuth@redhat.com>
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 (but the
generic TEST() macro from kselftest_harness.h) since each of the
tests needs a different guest code function.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.../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/x86_64/userspace_msr_exit_test.c
index 3533dc2fbfeeb..9843528bba0c6 100644
--- a/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
+++ b/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
@@ -8,6 +8,7 @@
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <sys/ioctl.h>
+#include "kselftest_harness.h"
#include "test_util.h"
#include "kvm_util.h"
#include "vmx.h"
@@ -527,7 +528,7 @@ static void run_guest_then_process_ucall_done(struct kvm_vcpu *vcpu)
process_ucall_done(vcpu);
}
-static void test_msr_filter_allow(void)
+TEST(msr_filter_allow)
{
struct kvm_vcpu *vcpu;
struct kvm_vm *vm;
@@ -646,7 +647,7 @@ static void handle_wrmsr(struct kvm_run *run)
}
}
-static void test_msr_filter_deny(void)
+TEST(msr_filter_deny)
{
struct kvm_vcpu *vcpu;
struct kvm_vm *vm;
@@ -693,7 +694,7 @@ static void test_msr_filter_deny(void)
kvm_vm_free(vm);
}
-static void test_msr_permission_bitmap(void)
+TEST(msr_permission_bitmap)
{
struct kvm_vcpu *vcpu;
struct kvm_vm *vm;
@@ -786,7 +787,7 @@ static void run_msr_filter_flag_test(struct kvm_vm *vm)
}
/* Test that attempts to write to the unused bits in a flag fails. */
-static void test_user_exit_msr_flags(void)
+TEST(user_exit_msr_flags)
{
struct kvm_vcpu *vcpu;
struct kvm_vm *vm;
@@ -804,13 +805,5 @@ static void test_user_exit_msr_flags(void)
int main(int argc, char *argv[])
{
- test_msr_filter_allow();
-
- test_msr_filter_deny();
-
- test_msr_permission_bitmap();
-
- test_user_exit_msr_flags();
-
- return 0;
+ return test_harness_run(argc, argv);
}
--
2.41.0
next prev parent reply other threads:[~2023-10-05 14:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 14:38 [PATCH v2 0/7] Use TAP in some more x86 KVM selftests Thomas Huth
2023-10-05 14:38 ` [PATCH v2 1/7] KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate Thomas Huth
2023-10-05 14:38 ` [PATCH v2 2/7] KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it Thomas Huth
2023-10-05 14:38 ` [PATCH v2 3/7] KVM: selftests: Add a macro to define a test with one vcpu Thomas Huth
2023-10-05 14:38 ` [PATCH v2 4/7] KVM: selftests: x86: Use TAP interface in the sync_regs test Thomas Huth
2023-10-05 14:38 ` [PATCH v2 5/7] KVM: selftests: x86: Use TAP interface in the fix_hypercall test Thomas Huth
2023-10-05 14:38 ` [PATCH v2 6/7] KVM: selftests: x86: Use TAP interface in the vmx_pmu_caps test Thomas Huth
2023-10-05 14:38 ` Thomas Huth [this message]
2024-01-26 19:32 ` [PATCH v2 7/7] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test Sean Christopherson
2024-02-08 19:31 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231005143839.365297-8-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®