diff options
author | Xiao Guangrong <guangrong.xiao@linux.intel.com> | 2015-05-11 22:55:21 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-11 17:17:50 +0200 |
commit | 0be0226f07d14b153a5eedf2bb86e1eb7dcefab5 (patch) | |
tree | a69e9c24597cd620922617e6315ba07b7bd63ca3 /arch/x86/include/asm | |
parent | 898761158be7682082955e3efa4ad24725305fc7 (diff) |
KVM: MMU: fix SMAP virtualization
KVM may turn a user page to a kernel page when kernel writes a readonly
user page if CR0.WP = 1. This shadow page entry will be reused after
SMAP is enabled so that kernel is allowed to access this user page
Fix it by setting SMAP && !CR0.WP into shadow page's role and reset mmu
once CR4.SMAP is updated
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index dea2e7e962e3..e61c3a4ee131 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -207,6 +207,7 @@ union kvm_mmu_page_role { unsigned nxe:1; unsigned cr0_wp:1; unsigned smep_andnot_wp:1; + unsigned smap_andnot_wp:1; }; }; |