[PATCH] KVM: x86/mmu: remove unused variable

Paolo Bonzini posted 1 patch 3 years, 8 months ago
arch/x86/kvm/mmu/mmu.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] KVM: x86/mmu: remove unused variable
Posted by Paolo Bonzini 3 years, 8 months ago
The last use of 'pfn' went away with the same-named argument to
host_pfn_mapping_level; now that the hugepage level is obtained
exclusively from the host page tables, kvm_mmu_zap_collapsible_spte
does not need to know host pfns at all.

Fixes: a8ac499bb6ab ("KVM: x86/mmu: Don't require refcounted "struct page" to create huge SPTEs")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/mmu/mmu.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 3e1317325e1f..4236a28b9be5 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -6416,13 +6416,11 @@ static bool kvm_mmu_zap_collapsible_spte(struct kvm *kvm,
 	u64 *sptep;
 	struct rmap_iterator iter;
 	int need_tlb_flush = 0;
-	kvm_pfn_t pfn;
 	struct kvm_mmu_page *sp;
 
 restart:
 	for_each_rmap_spte(rmap_head, &iter, sptep) {
 		sp = sptep_to_sp(sptep);
-		pfn = spte_to_pfn(*sptep);
 
 		/*
 		 * We cannot do huge page mapping for indirect shadow pages,
-- 
2.31.1
Re: [PATCH] KVM: x86/mmu: remove unused variable
Posted by Sean Christopherson 3 years, 8 months ago
On Mon, Aug 01, 2022, Paolo Bonzini wrote:
> The last use of 'pfn' went away with the same-named argument to
> host_pfn_mapping_level; now that the hugepage level is obtained
> exclusively from the host page tables, kvm_mmu_zap_collapsible_spte
> does not need to know host pfns at all.
> 
> Fixes: a8ac499bb6ab ("KVM: x86/mmu: Don't require refcounted "struct page" to create huge SPTEs")
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

I was slow, but not thaat slow.  :-)

https://lore.kernel.org/all/20220727201029.2758052-1-seanjc@google.com

For giggles,

Reviewed-by: Sean Christopherson <seanjc@google.com>