KVM: MMU: set base_role.nxe during mmu initialization.
authorGleb Natapov <gleb@redhat.com>
Wed, 30 Jan 2013 14:45:02 +0000 (16:45 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 5 Feb 2013 01:24:28 +0000 (23:24 -0200)
Move base_role.nxe initialisation to where all other roles are initialized.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/mmu.c
arch/x86/kvm/x86.c

index 40737b38da19f48946d7628845a8fb5b5fbfca1c..8028ac65db18399d2c724e5840cce3eee590b6bb 100644 (file)
@@ -3687,6 +3687,7 @@ int kvm_init_shadow_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *context)
        else
                r = paging32_init_context(vcpu, context);
 
+       vcpu->arch.mmu.base_role.nxe = is_nx(vcpu);
        vcpu->arch.mmu.base_role.cr4_pae = !!is_pae(vcpu);
        vcpu->arch.mmu.base_role.cr0_wp  = is_write_protection(vcpu);
        vcpu->arch.mmu.base_role.smep_andnot_wp
index cf512e70c797fff589445794f784297cd2fc1156..373e17a0d398f9498cfe9feebbc22b0551a0b9d6 100644 (file)
@@ -870,8 +870,6 @@ static int set_efer(struct kvm_vcpu *vcpu, u64 efer)
 
        kvm_x86_ops->set_efer(vcpu, efer);
 
-       vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled;
-
        /* Update reserved bits */
        if ((efer ^ old_efer) & EFER_NX)
                kvm_mmu_reset_context(vcpu);