OSDN Git Service

KVM: x86/mmu: Use 'end' param in TDP MMU's test_age_gfn()
authorSean Christopherson <seanjc@google.com>
Fri, 26 Feb 2021 01:03:27 +0000 (17:03 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 15 Mar 2021 08:43:31 +0000 (04:43 -0400)
Use the @end param when aging a GFN instead of hardcoding the walk to a
single GFN.  Unlike tdp_set_spte(), which simply cannot work with more
than one GFN, aging multiple GFNs would not break, though admittedly it
would be weird.  Be nice to the casual reader and don't make them puzzle
out why the end GFN is unused.

No functional change intended.

Cc: Ben Gardon <bgardon@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210226010329.1766033-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c

index 0d7b3f3..6959444 100644 (file)
@@ -995,12 +995,12 @@ int kvm_tdp_mmu_age_hva_range(struct kvm *kvm, unsigned long start,
 }
 
 static int test_age_gfn(struct kvm *kvm, struct kvm_memory_slot *slot,
-                       struct kvm_mmu_page *root, gfn_t gfn, gfn_t unused,
-                       unsigned long unused2)
+                       struct kvm_mmu_page *root, gfn_t gfn, gfn_t end,
+                       unsigned long unused)
 {
        struct tdp_iter iter;
 
-       tdp_root_for_each_leaf_pte(iter, root, gfn, gfn + 1)
+       tdp_root_for_each_leaf_pte(iter, root, gfn, end)
                if (is_accessed_spte(iter.old_spte))
                        return 1;