[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251024194925.3201933-6-yosry.ahmed@linux.dev>
Date: Fri, 24 Oct 2025 19:49:23 +0000
From: Yosry Ahmed <yosry.ahmed@...ux.dev>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Jim Mattson <jmattson@...gle.com>,
kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Yosry Ahmed <yosryahmed@...gle.com>
Subject: [kvm-unit-tests 5/7] x86/svm: Move report_svm_guest() to the top of svm_tests.c
From: Yosry Ahmed <yosryahmed@...gle.com>
Move the macro ahead of other tests that will start using it.
Signed-off-by: Yosry Ahmed <yosryahmed@...gle.com>
---
x86/svm_tests.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index feeb27d6..61ab63db 100644
--- a/x86/svm_tests.c
+++ b/x86/svm_tests.c
@@ -37,6 +37,21 @@ u64 latclgi_max;
u64 latclgi_min;
u64 runs;
+/*
+ * Report failures from SVM guest code, and on failure, set the stage to -1 and
+ * do VMMCALL to terminate the test (host side must treat -1 as "finished").
+ * TODO: fix the tests that don't play nice with a straight report, e.g. the
+ * V_TPR test fails if report() is invoked.
+ */
+#define report_svm_guest(cond, test, fmt, args...) \
+do { \
+ if (!(cond)) { \
+ report_fail(fmt, ##args); \
+ set_test_stage(test, -1); \
+ vmmcall(); \
+ } \
+} while (0)
+
static void null_test(struct svm_test *test)
{
}
@@ -1074,21 +1089,6 @@ static bool lat_svm_insn_check(struct svm_test *test)
return true;
}
-/*
- * Report failures from SVM guest code, and on failure, set the stage to -1 and
- * do VMMCALL to terminate the test (host side must treat -1 as "finished").
- * TODO: fix the tests that don't play nice with a straight report, e.g. the
- * V_TPR test fails if report() is invoked.
- */
-#define report_svm_guest(cond, test, fmt, args...) \
-do { \
- if (!(cond)) { \
- report_fail(fmt, ##args); \
- set_test_stage(test, -1); \
- vmmcall(); \
- } \
-} while (0)
-
bool pending_event_ipi_fired;
bool pending_event_guest_run;
--
2.51.1.821.gb6fe4d2222-goog
Powered by blists - more mailing lists