Skip to content

Commit d1b32ec

Browse files
sean-jcbonzini
authored andcommitted
KVM: nVMX: Initialize #VE info page for vmcs02 when proving #VE support
Point vmcs02.VE_INFORMATION_ADDRESS at the vCPU's #VE info page when initializing vmcs02, otherwise KVM will run L2 with EPT Violation #VE enabled and a VE info address pointing at pfn 0. Fixes: 8131cf5 ("KVM: VMX: Introduce test mode related to EPT violation VE") Signed-off-by: Sean Christopherson <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 40e8a69 commit d1b32ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kvm/vmx/nested.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,6 +2242,9 @@ static void prepare_vmcs02_constant_state(struct vcpu_vmx *vmx)
22422242
vmcs_write64(EPT_POINTER,
22432243
construct_eptp(&vmx->vcpu, 0, PT64_ROOT_4LEVEL));
22442244

2245+
if (vmx->ve_info)
2246+
vmcs_write64(VE_INFORMATION_ADDRESS, __pa(vmx->ve_info));
2247+
22452248
/* All VMFUNCs are currently emulated through L0 vmexits. */
22462249
if (cpu_has_vmx_vmfunc())
22472250
vmcs_write64(VM_FUNCTION_CONTROL, 0);

0 commit comments

Comments
 (0)