[kvm-unit-tests PATCH v2 3/4] x86: nSVM: Move #OF test to exception test framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove the boiler plate code for #OF test and move #OF exception test in
exception test framework.

Signed-off-by: Manali Shukla <manali.shukla@xxxxxxx>
---
 x86/svm_tests.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index b36aec1..b0f0980 100644
--- a/x86/svm_tests.c
+++ b/x86/svm_tests.c
@@ -2756,15 +2756,7 @@ static void pause_filter_test(void)
 	}
 }
 
-
-static int of_test_counter;
-
-static void guest_test_of_handler(struct ex_regs *r)
-{
-	of_test_counter++;
-}
-
-static void svm_of_test_guest(struct svm_test *test)
+static void svm_l2_of_test(struct svm_test *test)
 {
 	struct far_pointer32 fp = {
 		.offset = (uintptr_t)&&into,
@@ -2796,14 +2788,6 @@ into:
 	__builtin_unreachable();
 }
 
-static void svm_into_test(void)
-{
-	handle_exception(OF_VECTOR, guest_test_of_handler);
-	test_set_guest(svm_of_test_guest);
-	report(svm_vmrun() == SVM_EXIT_VMMCALL && of_test_counter == 1,
-	       "#OF is generated in L2 exception handler");
-}
-
 static void svm_l2_bp_test(struct svm_test *test)
 {
 	asm volatile("int3");
@@ -3336,6 +3320,7 @@ struct svm_exception_test svm_exception_tests[] = {
 	{ DB_VECTOR, svm_l2_db_test },
 	{ AC_VECTOR, svm_l2_ac_test },
 	{ BP_VECTOR, svm_l2_bp_test },
+	{ OF_VECTOR, svm_l2_of_test },
 };
 
 static u8 svm_exception_test_vector;
@@ -3486,7 +3471,6 @@ struct svm_test svm_tests[] = {
 	TEST(svm_vmload_vmsave),
 	TEST(svm_test_singlestep),
 	TEST(svm_nm_test),
-	TEST(svm_into_test),
 	TEST(svm_exception_test),
 	TEST(svm_lbrv_test0),
 	TEST(svm_lbrv_test1),
-- 
2.34.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux