diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-04-02 11:04:05 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-06-09 13:43:47 -0400 |
commit | b62b720974390bbac424713ad7e2997e0b49633f (patch) | |
tree | dedb87270f3d87963c6c3472adcc07a89dc358e1 /arch | |
parent | 3d93f1105707743a2f43d66d75db9a5b63aa79ad (diff) |
KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages
[ Upstream commit 898761158be7682082955e3efa4ad24725305fc7 ]
smep_andnot_wp is initialized in kvm_init_shadow_mmu and shadow pages
should not be reused for different values of it. Thus, it has to be
added to the mask in kvm_mmu_pte_write.
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9c12e63c653f..796997bc4869 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -4126,7 +4126,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, ++vcpu->kvm->stat.mmu_pte_write; kvm_mmu_audit(vcpu, AUDIT_PRE_PTE_WRITE); - mask.cr0_wp = mask.cr4_pae = mask.nxe = 1; + mask.cr0_wp = mask.cr4_pae = mask.nxe = mask.smep_andnot_wp = 1; for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn) { if (detect_write_misaligned(sp, gpa, bytes) || detect_write_flooding(sp)) { |