From: Sean Christopherson Date: Thu, 13 Oct 2022 21:12:32 +0000 (+0000) Subject: KVM: Skip unnecessary "unmap" if gpc is already valid during refresh X-Git-Tag: v6.6.17~5910^2~1^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06e155c44aa0e7921aa44d3c67f8ea464b16cb75;p=platform%2Fkernel%2Flinux-rpi.git KVM: Skip unnecessary "unmap" if gpc is already valid during refresh When refreshing a gfn=>pfn cache, skip straight to unlocking if the cache already valid instead of stuffing the "old" variables to turn the unmapping outro into a nop. Signed-off-by: Sean Christopherson Signed-off-by: David Woodhouse --- diff --git a/virt/kvm/pfncache.c b/virt/kvm/pfncache.c index a805cc1..2d6aba6 100644 --- a/virt/kvm/pfncache.c +++ b/virt/kvm/pfncache.c @@ -301,9 +301,8 @@ static int __kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, gpa_t gpa, * may have changed. */ gpc->khva = old_khva + page_offset; - old_pfn = KVM_PFN_ERR_FAULT; - old_khva = NULL; ret = 0; + goto out_unlock; } out: