diff options
author | Avi Kivity <avi@redhat.com> | 2009-03-31 04:31:54 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:35 -0400 |
commit | 9645bb56b31a1b70ab9e470387b5264cafc04aa9 (patch) | |
tree | 4055788c6c7ed181d4e96b3eff94ad30be6e10c6 /arch/x86/kvm/x86.c | |
parent | 82725b20e22fb85377f61a16f6d0d5cfc28b45d3 (diff) |
KVM: MMU: Use different shadows when EFER.NXE changes
A pte that is shadowed when the guest EFER.NXE=1 is not valid when
EFER.NXE=0; if bit 63 is set, the pte should cause a fault, and since the
shadow EFER always has NX enabled, this won't happen.
Fix by using a different shadow page table for different EFER.NXE bits. This
allows vcpus to run correctly with different values of EFER.NXE, and for
transitions on this bit to be handled correctly without requiring a full
flush.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index df866684bad1..007fadd62529 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -523,6 +523,9 @@ static void set_efer(struct kvm_vcpu *vcpu, u64 efer) | |||
523 | efer |= vcpu->arch.shadow_efer & EFER_LMA; | 523 | efer |= vcpu->arch.shadow_efer & EFER_LMA; |
524 | 524 | ||
525 | vcpu->arch.shadow_efer = efer; | 525 | vcpu->arch.shadow_efer = efer; |
526 | |||
527 | vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled; | ||
528 | kvm_mmu_reset_context(vcpu); | ||
526 | } | 529 | } |
527 | 530 | ||
528 | void kvm_enable_efer_bits(u64 mask) | 531 | void kvm_enable_efer_bits(u64 mask) |