summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorJan Dakinevich2016-09-04 20:22:47 +0200
committerPaolo Bonzini2016-09-07 19:34:28 +0200
commit119a9c01a5922600a78106d9bbdd6aaafc851a27 (patch)
tree41e8525de641a06d22a223ac301349af4e29a301 /arch/x86/kvm/vmx.c
parentKVM: Remove deprecated create_singlethread_workqueue (diff)
downloadkernel-qcow2-linux-119a9c01a5922600a78106d9bbdd6aaafc851a27.tar.gz
kernel-qcow2-linux-119a9c01a5922600a78106d9bbdd6aaafc851a27.tar.xz
kernel-qcow2-linux-119a9c01a5922600a78106d9bbdd6aaafc851a27.zip
KVM: nVMX: pass valid guest linear-address to the L1
If EPT support is exposed to L1 hypervisor, guest linear-address field of VMCS should contain GVA of L2, the access to which caused EPT violation. Signed-off-by: Jan Dakinevich <jan.dakinevich@gmail.com> Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ccb0356e3f2b..4c1a81486764 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -10500,6 +10500,9 @@ static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
vmcs12->guest_pdptr3 = vmcs_read64(GUEST_PDPTR3);
}
+ if (nested_cpu_has_ept(vmcs12))
+ vmcs12->guest_linear_address = vmcs_readl(GUEST_LINEAR_ADDRESS);
+
if (nested_cpu_has_vid(vmcs12))
vmcs12->guest_intr_status = vmcs_read16(GUEST_INTR_STATUS);