diff options
author | Avi Kivity <avi@redhat.com> | 2012-09-12 20:46:56 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-09-20 13:00:09 +0300 |
commit | 6fd01b711bee96ce3356f7b6f370ab708e37504b (patch) | |
tree | c277c3daf5ba0ec856e582025cbc27ccab4e6ec9 /arch/x86/include/asm/kvm_host.h | |
parent | 13d22b6aebb000aeaf137862c6c0e0c4d138d798 (diff) |
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/asm/kvm_host.h')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 7 |
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 3318bde206a..43aeb942283 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 */ |