From patchwork Mon Jan 23 10:43:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/4] KVM: MMU: Use gfn_to_rmap() in audit_write_protection() Date: Mon, 23 Jan 2012 00:43:11 -0000 From: Takuya Yoshikawa X-Patchwork-Id: 137333 Message-Id: <20120123194311.c8abacde.yoshikawa.takuya@oss.ntt.co.jp> To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org We want to eliminate direct access to the rmap array. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/mmu_audit.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu_audit.c b/arch/x86/kvm/mmu_audit.c index 6eabae3..e62fa4f 100644 --- a/arch/x86/kvm/mmu_audit.c +++ b/arch/x86/kvm/mmu_audit.c @@ -190,15 +190,13 @@ static void check_mappings_rmap(struct kvm *kvm, struct kvm_mmu_page *sp) static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) { - struct kvm_memory_slot *slot; unsigned long *rmapp; u64 *spte; if (sp->role.direct || sp->unsync || sp->role.invalid) return; - slot = gfn_to_memslot(kvm, sp->gfn); - rmapp = &slot->rmap[sp->gfn - slot->base_gfn]; + rmapp = gfn_to_rmap(kvm, sp->gfn, PT_PAGE_TABLE_LEVEL); spte = rmap_next(rmapp, NULL); while (spte) {