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

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

 



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

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

diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index 7544034..b36aec1 100644
--- a/x86/svm_tests.c
+++ b/x86/svm_tests.c
@@ -2804,26 +2804,11 @@ static void svm_into_test(void)
 	       "#OF is generated in L2 exception handler");
 }
 
-static int bp_test_counter;
-
-static void guest_test_bp_handler(struct ex_regs *r)
-{
-	bp_test_counter++;
-}
-
-static void svm_bp_test_guest(struct svm_test *test)
+static void svm_l2_bp_test(struct svm_test *test)
 {
 	asm volatile("int3");
 }
 
-static void svm_int3_test(void)
-{
-	handle_exception(BP_VECTOR, guest_test_bp_handler);
-	test_set_guest(svm_bp_test_guest);
-	report(svm_vmrun() == SVM_EXIT_VMMCALL && bp_test_counter == 1,
-	       "#BP is handled in L2 exception handler");
-}
-
 static int nm_test_counter;
 
 static void guest_test_nm_handler(struct ex_regs *r)
@@ -3350,6 +3335,7 @@ struct svm_exception_test svm_exception_tests[] = {
 	{ DE_VECTOR, svm_l2_de_test },
 	{ DB_VECTOR, svm_l2_db_test },
 	{ AC_VECTOR, svm_l2_ac_test },
+	{ BP_VECTOR, svm_l2_bp_test },
 };
 
 static u8 svm_exception_test_vector;
@@ -3500,7 +3486,6 @@ struct svm_test svm_tests[] = {
 	TEST(svm_vmload_vmsave),
 	TEST(svm_test_singlestep),
 	TEST(svm_nm_test),
-	TEST(svm_int3_test),
 	TEST(svm_into_test),
 	TEST(svm_exception_test),
 	TEST(svm_lbrv_test0),
-- 
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