All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: linux-kselftest@vger.kernel.org, David Matlack <dmatlack@google.com>
Subject: [PATCH 3/4] KVM: selftests: x86: Use TAP interface in the fix_hypercall test
Date: Wed, 12 Jul 2023 09:59:09 +0200	[thread overview]
Message-ID: <20230712075910.22480-4-thuth@redhat.com> (raw)
In-Reply-To: <20230712075910.22480-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.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .../selftests/kvm/x86_64/fix_hypercall_test.c    | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
index 0f728f05ea82f..7621942a072ec 100644
--- a/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
+++ b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
@@ -9,6 +9,7 @@
 #include <linux/stringify.h>
 #include <stdint.h>
 
+#include "kselftest_harness.h"
 #include "apic.h"
 #include "test_util.h"
 #include "kvm_util.h"
@@ -126,10 +127,19 @@ static void test_fix_hypercall(bool disable_quirk)
 	enter_guest(vcpu);
 }
 
-int main(void)
+TEST(fix_hypercall)
 {
-	TEST_REQUIRE(kvm_check_cap(KVM_CAP_DISABLE_QUIRKS2) & KVM_X86_QUIRK_FIX_HYPERCALL_INSN);
-
 	test_fix_hypercall(false);
+}
+
+TEST(fix_hypercall_disable_quirk)
+{
 	test_fix_hypercall(true);
 }
+
+int main(int argc, char *argv[])
+{
+	TEST_REQUIRE(kvm_check_cap(KVM_CAP_DISABLE_QUIRKS2) & KVM_X86_QUIRK_FIX_HYPERCALL_INSN);
+
+	return test_harness_run(argc, argv);
+}
-- 
2.39.3


  parent reply	other threads:[~2023-07-12  8:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  7:59 [PATCH 0/4] Use TAP in some more x86 KVM selftests Thomas Huth
2023-07-12  7:59 ` [PATCH 1/4] KVM: selftests: Rename the ASSERT_EQ macro Thomas Huth
2023-07-18 12:26   ` Philippe Mathieu-Daudé
2023-07-12  7:59 ` [PATCH 2/4] KVM: selftests: x86: Use TAP interface in the sync_regs test Thomas Huth
2023-08-02 19:55   ` Sean Christopherson
2023-08-02 21:31     ` Sean Christopherson
2023-08-03  5:23       ` Thomas Huth
2023-08-03  5:17     ` Thomas Huth
2023-07-12  7:59 ` Thomas Huth [this message]
2023-07-12  7:59 ` [PATCH 4/4] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test Thomas Huth
2023-07-18 12:26   ` Philippe Mathieu-Daudé
2023-08-02 22:01 ` [PATCH 0/4] Use TAP in some more x86 KVM selftests Sean Christopherson

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=20230712075910.22480-4-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=dmatlack@google.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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.