summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-09-12 20:46:56 +0300
committerAvi Kivity <avi@redhat.com>2012-09-20 13:00:09 +0300
commit6fd01b711bee96ce3356f7b6f370ab708e37504b (patch)
treec277c3daf5ba0ec856e582025cbc27ccab4e6ec9 /arch/x86/include
parent13d22b6aebb000aeaf137862c6c0e0c4d138d798 (diff)
downloadop-kernel-dev-6fd01b711bee96ce3356f7b6f370ab708e37504b.zip
op-kernel-dev-6fd01b711bee96ce3356f7b6f370ab708e37504b.tar.gz
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 3318bde..43aeb94 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 */
OpenPOWER on IntegriCloud