aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2013-08-08 10:26:29 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-09-24 13:12:14 -0400
commit59ab5a8f4445699e238c4c46b3da63bb9dc02897 (patch)
treea10e78b1f68580a1a1745a2966d71058abca5d03 /arch/x86/kvm
parent9e3e4dbf4469ba19971fbd547f1be713604c7f5e (diff)
KVM: nVMX: Do not set identity page map for L2
Fiddling with CR3 for L2 is L1's job. It may set its own, different identity map or simple leave it alone if unrestricted guest mode is enabled. This also fixes reading back the current CR3 on L2 exits for reporting it to L1. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/vmx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 4de2b7990273..6b9aa87074b0 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3376,8 +3376,10 @@ static void vmx_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
3376 if (enable_ept) { 3376 if (enable_ept) {
3377 eptp = construct_eptp(cr3); 3377 eptp = construct_eptp(cr3);
3378 vmcs_write64(EPT_POINTER, eptp); 3378 vmcs_write64(EPT_POINTER, eptp);
3379 guest_cr3 = is_paging(vcpu) ? kvm_read_cr3(vcpu) : 3379 if (is_paging(vcpu) || is_guest_mode(vcpu))
3380 vcpu->kvm->arch.ept_identity_map_addr; 3380 guest_cr3 = kvm_read_cr3(vcpu);
3381 else
3382 guest_cr3 = vcpu->kvm->arch.ept_identity_map_addr;
3381 ept_load_pdptrs(vcpu); 3383 ept_load_pdptrs(vcpu);
3382 } 3384 }
3383 3385