aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-08-05 04:07:14 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-08-07 09:57:40 -0400
commit53166229e96941f27e7f0ba405c7a44d648751c9 (patch)
tree737ab0c3103b6174bfb57335d6e5ee930c465054 /arch/x86/kvm/mmu.c
parent7a1638ce4220d52e53d4114e34e4529161a3449c (diff)
nEPT: correctly check if remote tlb flush is needed for shadowed EPT tables
need_remote_flush() assumes that shadow page is in PT64 format, but with addition of nested EPT this is no longer always true. Fix it by bits definitions that depend on host shadow page type. Reported-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 68d0f086de6c..75d843bb4ca3 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -132,8 +132,8 @@ module_param(dbg, bool, 0644);
132 (PAGE_MASK & ~((1ULL << (PAGE_SHIFT + (((level) - 1) \ 132 (PAGE_MASK & ~((1ULL << (PAGE_SHIFT + (((level) - 1) \
133 * PT32_LEVEL_BITS))) - 1)) 133 * PT32_LEVEL_BITS))) - 1))
134 134
135#define PT64_PERM_MASK (PT_PRESENT_MASK | PT_WRITABLE_MASK | PT_USER_MASK \ 135#define PT64_PERM_MASK (PT_PRESENT_MASK | PT_WRITABLE_MASK | shadow_user_mask \
136 | PT64_NX_MASK) 136 | shadow_x_mask | shadow_nx_mask)
137 137
138#define ACC_EXEC_MASK 1 138#define ACC_EXEC_MASK 1
139#define ACC_WRITE_MASK PT_WRITABLE_MASK 139#define ACC_WRITE_MASK PT_WRITABLE_MASK
@@ -3879,8 +3879,8 @@ static bool need_remote_flush(u64 old, u64 new)
3879 return true; 3879 return true;
3880 if ((old ^ new) & PT64_BASE_ADDR_MASK) 3880 if ((old ^ new) & PT64_BASE_ADDR_MASK)
3881 return true; 3881 return true;
3882 old ^= PT64_NX_MASK; 3882 old ^= shadow_nx_mask;
3883 new ^= PT64_NX_MASK; 3883 new ^= shadow_nx_mask;
3884 return (old & ~new & PT64_PERM_MASK) != 0; 3884 return (old & ~new & PT64_PERM_MASK) != 0;
3885} 3885}
3886 3886