The test that checks the maximum VMCS field encoding does not probe all possible VMCS fields. As a result it might fail since the actual IA32_VMX_VMCS_ENUM.MAX_INDEX would be higher than the expected value. Change the test to check that the maximum of the supported probed VMCS fields is lower/equal than the actual reported IA32_VMX_VMCS_ENUM.MAX_INDEX. This test might still fail on bare-metal due to errata (e.g., BDX30). Cc: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> Signed-off-by: Nadav Amit <nadav.amit@xxxxxxxxx> --- x86/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x86/vmx.c b/x86/vmx.c index 962ec0f..f540e15 100644 --- a/x86/vmx.c +++ b/x86/vmx.c @@ -361,8 +361,8 @@ static void test_vmwrite_vmread(void) report("VMWRITE/VMREAD", __check_all_vmcs_fields(0x42, &max_index)); vmcs_enum_max = rdmsr(MSR_IA32_VMX_VMCS_ENUM) & VMCS_FIELD_INDEX_MASK; - report("VMX_VMCS_ENUM.MAX_INDEX expected: %x, actual: %x", - vmcs_enum_max == max_index, max_index, vmcs_enum_max); + report("VMX_VMCS_ENUM.MAX_INDEX expected at least: %x, actual: %x", + vmcs_enum_max >= max_index, max_index, vmcs_enum_max); assert(!vmcs_clear(vmcs)); free_page(vmcs); -- 2.17.1