[kvm-unit-tests PATCH v3 1/9] nVMX: Add "nop" after setting EFLAGS.TF to guarantee single-step #DB

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

 



Add a "nop" after enabling single-stepping in vmx_l2_db_test() to ensure
a #DB is generated in the scope of the function even if the helper is
inlined.  Enabling single-step #DBs have a one-instruction delay, e.g. if
the function were inlined and the caller generated a "terminal" VM-Exit
immediately after invoking the helper, then no #DB would be generated.

Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
 x86/vmx_tests.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index aa2ecbb..3e3d699 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -10745,6 +10745,7 @@ static void vmx_l2_bp_test(void)
 static void vmx_l2_db_test(void)
 {
 	write_rflags(read_rflags() | X86_EFLAGS_TF);
+	asm volatile("nop");
 }
 
 static uint64_t usermode_callback(void)
-- 
2.38.0.rc1.362.ged0d419d3c-goog




[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