Commit 28b85ae0 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: Drop bogus "pfn != 0" guard from kvm_release_pfn()

Remove a check from kvm_release_pfn() to bail if the provided @pfn is
zero.  Zero is a perfectly valid pfn on most architectures, and should
not be used to indicate an error or an invalid pfn.  The bogus check was
added by commit 91724814 ("x86/kvm: Cache gfn to pfn translation"),
which also did the bad thing of zeroing the pfn and gfn to mark a cache
invalid.  Thankfully, that bad behavior was axed by commit 357a18ad
("KVM: Kill kvm_map_gfn() / kvm_unmap_gfn() and gfn_to_pfn_cache").
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20220429010416.2788472-3-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 70e41c31
...@@ -2745,9 +2745,6 @@ EXPORT_SYMBOL_GPL(gfn_to_page); ...@@ -2745,9 +2745,6 @@ EXPORT_SYMBOL_GPL(gfn_to_page);
void kvm_release_pfn(kvm_pfn_t pfn, bool dirty) void kvm_release_pfn(kvm_pfn_t pfn, bool dirty)
{ {
if (pfn == 0)
return;
if (dirty) if (dirty)
kvm_release_pfn_dirty(pfn); kvm_release_pfn_dirty(pfn);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment