summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-10-13 21:12:32 +0000
committerDavid Woodhouse <dwmw@amazon.co.uk>2022-11-30 19:25:24 +0000
commit06e155c44aa0e7921aa44d3c67f8ea464b16cb75 (patch)
treedd1ffca57936fce3629522cf5d39948b8e71a583 /virt
parent58f5ee5fedd981e05cb086cba4e8f923c3727a04 (diff)
downloadlinux-06e155c44aa0e7921aa44d3c67f8ea464b16cb75.tar.bz2
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 <seanjc@google.com> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/pfncache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/virt/kvm/pfncache.c b/virt/kvm/pfncache.c
index a805cc1544bf..2d6aba677830 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: