Re: [kvm-unit-tests PATCH] nVMX: Add testcase to cover VMWRITE to nonexistent CR3-target values

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

 




On 4/17/20 12:00 AM, Paolo Bonzini wrote:
On 17/04/20 03:35, Krish Sadhukhan wrote:
On 4/16/20 9:28 AM, Sean Christopherson wrote:
Enhance test_cr3_targets() to verify that attempting to write CR3-target
value fields beyond the reported number of supported targets fails.

Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
---
   x86/vmx_tests.c | 4 ++++
   1 file changed, 4 insertions(+)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 1f97fe3..f5c72e6 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -3570,6 +3570,10 @@ static void test_cr3_targets(void)
       for (i = 0; i <= supported_targets + 1; i++)
           try_cr3_target_count(i, supported_targets);
       vmcs_write(CR3_TARGET_COUNT, cr3_targets);
+
+    /* VMWRITE to nonexistent target fields should fail. */
+    for (i = supported_targets; i < 256; i++)
+        TEST_ASSERT(vmcs_write(CR3_TARGET_0 + i*2, 0));
   }
     /*
We don't need VMREAD testing ?
Patches are welcome. :D

Paolo

OK, I will send it along with my next test patch :-)

Reviewed-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx>




[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