diff options
author | Michal Luczaj <mhal@rbox.co> | 2022-10-13 23:12:28 +0200 |
---|---|---|
committer | David Woodhouse <dwmw@amazon.co.uk> | 2022-11-30 20:25:24 +0100 |
commit | 0318f207d1c2e297d1ec1c6e145bb8bd053236f9 (patch) | |
tree | c3558739bed5ec7bf71b50644999a489fe1dd3ba /virt | |
parent | KVM: Clean up hva_to_pfn_retry() (diff) | |
download | linux-0318f207d1c2e297d1ec1c6e145bb8bd053236f9.tar.xz linux-0318f207d1c2e297d1ec1c6e145bb8bd053236f9.zip |
KVM: Use gfn_to_pfn_cache's immutable "kvm" in kvm_gpc_refresh()
Make kvm_gpc_refresh() use kvm instance cached in gfn_to_pfn_cache.
No functional change intended.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
[sean: leave kvm_gpc_unmap() as-is]
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.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/virt/kvm/pfncache.c b/virt/kvm/pfncache.c index 9d506de6c150..015c5d16948a 100644 --- a/virt/kvm/pfncache.c +++ b/virt/kvm/pfncache.c @@ -237,10 +237,9 @@ out_error: return -EFAULT; } -int kvm_gpc_refresh(struct kvm *kvm, struct gfn_to_pfn_cache *gpc, gpa_t gpa, - unsigned long len) +int kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, gpa_t gpa, unsigned long len) { - struct kvm_memslots *slots = kvm_memslots(kvm); + struct kvm_memslots *slots = kvm_memslots(gpc->kvm); unsigned long page_offset = gpa & ~PAGE_MASK; bool unmap_old = false; unsigned long old_uhva; @@ -399,7 +398,7 @@ int kvm_gpc_activate(struct gfn_to_pfn_cache *gpc, gpa_t gpa, unsigned long len) gpc->active = true; write_unlock_irq(&gpc->lock); } - return kvm_gpc_refresh(kvm, gpc, gpa, len); + return kvm_gpc_refresh(gpc, gpa, len); } EXPORT_SYMBOL_GPL(kvm_gpc_activate); |