aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>2013-06-07 04:51:23 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-06-20 17:33:20 -0400
commit885032b91042288f98d3888c2aaf3a108d348d5c (patch)
tree3f51f6eca75275a2be2a2cf19be546bc6ec27855 /arch/x86
parent87d41fb4da6467622b7a87fd6afe8071abab6dae (diff)
KVM: MMU: retain more available bits on mmio spte
Let mmio spte only use bit62 and bit63 on upper 32 bits, then bit 52 ~ bit 61 can be used for other purposes Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/vmx.c4
-rw-r--r--arch/x86/kvm/x86.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 260a91939555..78ee123de7a3 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4176,10 +4176,10 @@ static void ept_set_mmio_spte_mask(void)
4176 /* 4176 /*
4177 * EPT Misconfigurations can be generated if the value of bits 2:0 4177 * EPT Misconfigurations can be generated if the value of bits 2:0
4178 * of an EPT paging-structure entry is 110b (write/execute). 4178 * of an EPT paging-structure entry is 110b (write/execute).
4179 * Also, magic bits (0xffull << 49) is set to quickly identify mmio 4179 * Also, magic bits (0x3ull << 62) is set to quickly identify mmio
4180 * spte. 4180 * spte.
4181 */ 4181 */
4182 kvm_mmu_set_mmio_spte_mask(0xffull << 49 | 0x6ull); 4182 kvm_mmu_set_mmio_spte_mask((0x3ull << 62) | 0x6ull);
4183} 4183}
4184 4184
4185/* 4185/*
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 737c804b310c..15cf34d4ae95 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5280,7 +5280,13 @@ static void kvm_set_mmio_spte_mask(void)
5280 * Set the reserved bits and the present bit of an paging-structure 5280 * Set the reserved bits and the present bit of an paging-structure
5281 * entry to generate page fault with PFER.RSV = 1. 5281 * entry to generate page fault with PFER.RSV = 1.
5282 */ 5282 */
5283 mask = ((1ull << (62 - maxphyaddr + 1)) - 1) << maxphyaddr; 5283 /* Mask the reserved physical address bits. */
5284 mask = ((1ull << (51 - maxphyaddr + 1)) - 1) << maxphyaddr;
5285
5286 /* Bit 62 is always reserved for 32bit host. */
5287 mask |= 0x3ull << 62;
5288
5289 /* Set the present bit. */
5284 mask |= 1ull; 5290 mask |= 1ull;
5285 5291
5286#ifdef CONFIG_X86_64 5292#ifdef CONFIG_X86_64