Skip to content

Commit 06e155c

Browse files
sean-jcdwmw2
authored andcommitted
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 <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
1 parent 58f5ee5 commit 06e155c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

virt/kvm/pfncache.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,8 @@ static int __kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, gpa_t gpa,
301301
* may have changed.
302302
*/
303303
gpc->khva = old_khva + page_offset;
304-
old_pfn = KVM_PFN_ERR_FAULT;
305-
old_khva = NULL;
306304
ret = 0;
305+
goto out_unlock;
307306
}
308307

309308
out:

0 commit comments

Comments
 (0)