Skip to content

Commit

Permalink
KVM: Skip unnecessary "unmap" if gpc is already valid during refresh
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
sean-jc authored and dwmw2 committed Nov 30, 2022
1 parent 58f5ee5 commit 06e155c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions virt/kvm/pfncache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 06e155c

Please sign in to comment.