According to section "Checks on Guest Descriptor-Table Registers" in Intel SDM vol 3C, the following checks are performed on the Guest Descriptor-Table Registers on vmentry of nested guests: - Bits 31:16 of each limit field must be 0. Signed-off-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx> --- x86/vmx_tests.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index f400408..7b6205d 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -7836,6 +7836,17 @@ static void vmx_guest_state_area_test(void) test_canonical(GUEST_BASE_IDTR, "GUEST_BASE_IDTR", false); #endif + u32 guest_desc_limit_saved = vmcs_read(GUEST_LIMIT_GDTR); + TEST_GUEST_VMCS_FIELD_RESERVED_BITS(16, 31, 4, GUEST_LIMIT_GDTR, + "GUEST_LIMIT_GDTR", guest_desc_limit_saved, "GUEST_LIMIT_GDTR", + true); + vmcs_write(GUEST_LIMIT_GDTR, guest_desc_limit_saved); + guest_desc_limit_saved = vmcs_read(GUEST_LIMIT_IDTR); + TEST_GUEST_VMCS_FIELD_RESERVED_BITS(16, 31, 4, GUEST_LIMIT_IDTR, + "GUEST_LIMIT_IDTR", guest_desc_limit_saved, "GUEST_LIMIT_IDTR", + true); + vmcs_write(GUEST_LIMIT_IDTR, guest_desc_limit_saved); + /* * Let the guest finish execution */ -- 1.8.3.1