summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorTakuya Yoshikawa2012-08-01 11:03:28 +0200
committerAvi Kivity2012-08-06 11:47:30 +0200
commitd89cc617b954aff4030fce178f7d86f59aaf713d (patch)
treed04f2ccdddd1d718044f47fdf8442054d87799f6 /arch/x86/kvm/mmu.c
parentKVM: MMU: Use gfn_to_rmap() instead of directly reading rmap array (diff)
downloadkernel-qcow2-linux-d89cc617b954aff4030fce178f7d86f59aaf713d.tar.gz
kernel-qcow2-linux-d89cc617b954aff4030fce178f7d86f59aaf713d.tar.xz
kernel-qcow2-linux-d89cc617b954aff4030fce178f7d86f59aaf713d.zip
KVM: Push rmap into kvm_arch_memory_slot
Two reasons: - x86 can integrate rmap and rmap_pde and remove heuristics in __gfn_to_rmap(). - Some architectures do not need rmap. Since rmap is one of the most memory consuming stuff in KVM, ppc'd better restrict the allocation to Book3S HV. Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index ee768bb2367f..aa9a987ddefb 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -970,11 +970,8 @@ static unsigned long *__gfn_to_rmap(gfn_t gfn, int level,
{
unsigned long idx;
- if (likely(level == PT_PAGE_TABLE_LEVEL))
- return &slot->rmap[gfn - slot->base_gfn];
-
idx = gfn_to_index(gfn, slot->base_gfn, level);
- return &slot->arch.rmap_pde[level - PT_DIRECTORY_LEVEL][idx];
+ return &slot->arch.rmap[level - PT_PAGE_TABLE_LEVEL][idx];
}
/*