diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2012-08-01 05:02:01 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-08-06 05:47:04 -0400 |
commit | 65fbe37c42ed75604c9a770639209dcee162ebe7 (patch) | |
tree | af03eda97fb68a0329b2890a5a509944d79dffdd /arch/x86/kvm/mmu_audit.c | |
parent | aab2eb7a38e0e510874acca01838f5badbca6c7e (diff) |
KVM: MMU: Use gfn_to_rmap() instead of directly reading rmap array
This helps to make rmap architecture specific in a later patch.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu_audit.c')
-rw-r--r-- | 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 7d7d0b9e23eb..ca403f9bb0f2 100644 --- a/arch/x86/kvm/mmu_audit.c +++ b/arch/x86/kvm/mmu_audit.c | |||
@@ -190,7 +190,6 @@ static void check_mappings_rmap(struct kvm *kvm, struct kvm_mmu_page *sp) | |||
190 | 190 | ||
191 | static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) | 191 | static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) |
192 | { | 192 | { |
193 | struct kvm_memory_slot *slot; | ||
194 | unsigned long *rmapp; | 193 | unsigned long *rmapp; |
195 | u64 *sptep; | 194 | u64 *sptep; |
196 | struct rmap_iterator iter; | 195 | struct rmap_iterator iter; |
@@ -198,8 +197,7 @@ static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) | |||
198 | if (sp->role.direct || sp->unsync || sp->role.invalid) | 197 | if (sp->role.direct || sp->unsync || sp->role.invalid) |
199 | return; | 198 | return; |
200 | 199 | ||
201 | slot = gfn_to_memslot(kvm, sp->gfn); | 200 | rmapp = gfn_to_rmap(kvm, sp->gfn, PT_PAGE_TABLE_LEVEL); |
202 | rmapp = &slot->rmap[sp->gfn - slot->base_gfn]; | ||
203 | 201 | ||
204 | for (sptep = rmap_get_first(*rmapp, &iter); sptep; | 202 | for (sptep = rmap_get_first(*rmapp, &iter); sptep; |
205 | sptep = rmap_get_next(&iter)) { | 203 | sptep = rmap_get_next(&iter)) { |