diff options
author | Xiao Guangrong <guangrong.xiao@linux.intel.com> | 2015-05-13 14:42:20 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-19 20:52:38 +0200 |
commit | 0d5367900a319ab8971817b0ca15a8b9f7c47e6f (patch) | |
tree | b2f9aa87f6f8f6733ccee43dd787bdd29a07511c /arch/x86/kvm/mmu_audit.c | |
parent | c35ebbeade127e7bca1f21ef5bf1a39deffba9de (diff) |
KVM: MMU: introduce for_each_rmap_spte()
It's used to walk all the sptes on the rmap to clean up the
code
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@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 9ade5cfb5a4c..368d53497314 100644 --- a/arch/x86/kvm/mmu_audit.c +++ b/arch/x86/kvm/mmu_audit.c @@ -197,13 +197,11 @@ static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) rmapp = gfn_to_rmap(kvm, sp->gfn, PT_PAGE_TABLE_LEVEL); - for (sptep = rmap_get_first(*rmapp, &iter); sptep; - sptep = rmap_get_next(&iter)) { + for_each_rmap_spte(rmapp, &iter, sptep) if (is_writable_pte(*sptep)) audit_printk(kvm, "shadow page has writable " "mappings: gfn %llx role %x\n", sp->gfn, sp->role.word); - } } static void audit_sp(struct kvm *kvm, struct kvm_mmu_page *sp) |