summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-09-12 19:46:56 +0200
committerAvi Kivity <avi@redhat.com>2012-09-20 12:00:09 +0200
commit6fd01b711bee96ce3356f7b6f370ab708e37504b (patch)
treec277c3daf5ba0ec856e582025cbc27ccab4e6ec9 /arch/x86/include
parentKVM: MMU: Simplify walk_addr_generic() loop (diff)
downloadlinux-6fd01b711bee96ce3356f7b6f370ab708e37504b.tar.xz
linux-6fd01b711bee96ce3356f7b6f370ab708e37504b.zip
KVM: MMU: Optimize is_last_gpte()
Instead of branchy code depending on level, gpte.ps, and mmu configuration, prepare everything in a bitmap during mode changes and look it up during runtime. Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/kvm_host.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 3318bde206a5..43aeb9422839 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -298,6 +298,13 @@ struct kvm_mmu {
u64 *lm_root;
u64 rsvd_bits_mask[2][4];
+ /*
+ * Bitmap: bit set = last pte in walk
+ * index[0:1]: level (zero-based)
+ * index[2]: pte.ps
+ */
+ u8 last_pte_bitmap;
+
bool nx;
u64 pdptrs[4]; /* pae */