diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2012-07-02 04:57:17 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-07-18 15:55:04 -0400 |
commit | 77d11309b3a10e1ce112058ec2c9b7b979bcf311 (patch) | |
tree | 295d8d2adea1e2b68eac599263b963059fecf3a5 /arch/x86/kvm/mmu.c | |
parent | b3ae2096974b12c3af2ad1a4e7716b084949867f (diff) |
KVM: Separate rmap_pde from kvm_lpage_info->write_count
This makes it possible to loop over rmap_pde arrays in the same way as
we do over rmap so that we can optimize kvm_handle_hva_range() easily in
the following patch.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d2855f895fde..3b3f5ae5da6a 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -960,13 +960,13 @@ static void pte_list_walk(unsigned long *pte_list, pte_list_walk_fn fn) | |||
960 | static unsigned long *__gfn_to_rmap(gfn_t gfn, int level, | 960 | static unsigned long *__gfn_to_rmap(gfn_t gfn, int level, |
961 | struct kvm_memory_slot *slot) | 961 | struct kvm_memory_slot *slot) |
962 | { | 962 | { |
963 | struct kvm_lpage_info *linfo; | 963 | unsigned long idx; |
964 | 964 | ||
965 | if (likely(level == PT_PAGE_TABLE_LEVEL)) | 965 | if (likely(level == PT_PAGE_TABLE_LEVEL)) |
966 | return &slot->rmap[gfn - slot->base_gfn]; | 966 | return &slot->rmap[gfn - slot->base_gfn]; |
967 | 967 | ||
968 | linfo = lpage_info_slot(gfn, slot, level); | 968 | idx = gfn_to_index(gfn, slot->base_gfn, level); |
969 | return &linfo->rmap_pde; | 969 | return &slot->arch.rmap_pde[level - PT_DIRECTORY_LEVEL][idx]; |
970 | } | 970 | } |
971 | 971 | ||
972 | /* | 972 | /* |