x86/vvmx: don't enable vmcs shadowing for nested guests
PATCH 1/1 x86/vvmx: don't enable vmcs shadowing for nested guests
Running "./xtf_runner vvmx" in L1 Xen under L0 Xen produces the following result on H/W with VMCS shadowing:
Test: vmxon
Failure in test_vmxon_in_root_cpl0()
Expected 0x8200000f: VMfailValid(15) VMXON_IN_ROOT
Got 0x82004400: VMfailValid(17408) <unknown>
Test result: FAILURE
This happens because SDM allows vmentries with enabled VMCS shadowing VM-execution control and VMCS link pointer value of ~0ull. But results of a nested VMREAD are undefined in such cases.
Fix this by not copying the value of VMCS shadowing control from vmcs01 to vmcs02.
--- xen/arch/x86/hvm/vmx/vvmx.c | 1 + 1 file changed, 1 insertion(+)
xen/arch/x86/hvm/vmx/vvmx.c +1 -0
@@ -633,6 +633,7 @@ void nvmx_update_secondary_exec_control(struct vcpu *v,SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY ; host_cntrl &= ~apicv_bit; + host_cntrl &= ~SECONDARY_EXEC_ENABLE_VMCS_SHADOWING ; shadow_cntrl =get_vvmcs (v,SECONDARY_VM_EXEC_CONTROL );/* No vAPIC-v support, so it shouldn't be set in vmcs12. */
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 17 lines
From: Sergey Dyasli [mailto:[email protected]]
Sent: Monday, October 23, 2017 5:33 PMRunning "./xtf_runner vvmx" in L1 Xen under L0 Xen produces the following result on H/W with VMCS shadowing:
Test: vmxon
Failure intest_vmxon_in_root_cpl0()
Expected0x8200000f: VMfailValid(15)VMXON_IN_ROOT
Got0x82004400: VMfailValid(17408) <unknown>
Test result: FAILUREThis happens because SDM allows vmentries with enabled VMCS shadowing
VM-execution control and VMCS link pointer value of ~0ull. But results of a nested VMREAD are undefined in such cases.
Quoted 4 lines
Fix this by not copying the value of VMCS shadowing control from vmcs01 to vmcs02.
Signed-off-by Sergey Dyasli <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 17 lines · Kevin
Quoted 17 lines
From: Sergey Dyasli [mailto:[email protected]]
Sent: Monday, October 23, 2017 5:33 PMRunning "./xtf_runner vvmx" in L1 Xen under L0 Xen produces the following result on H/W with VMCS shadowing:
Test: vmxon
Failure intest_vmxon_in_root_cpl0()
Expected0x8200000f: VMfailValid(15)VMXON_IN_ROOT
Got0x82004400: VMfailValid(17408) <unknown>
Test result: FAILUREThis happens because SDM allows vmentries with enabled VMCS shadowing
VM-execution control and VMCS link pointer value of ~0ull. But results of a nested VMREAD are undefined in such cases.
Quoted 5 lines
Quoted 4 lines
Fix this by not copying the value of VMCS shadowing control from vmcs01 to vmcs02.
Signed-off-by Sergey Dyasli <[email protected]>Acked-by Kevin Tian <[email protected]>
Pulled into x86-next
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel