summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorMichal Luczaj <mhal@rbox.co>2022-10-13 23:12:26 +0200
committerDavid Woodhouse <dwmw@amazon.co.uk>2022-11-30 20:25:23 +0100
commite308c24a358d1e79951b16c387cbc6c6593639a5 (patch)
tree439543e39a16974c85b3ecf5c21c13d7327322b4 /virt
parentKVM: Store immutable gfn_to_pfn_cache properties (diff)
downloadlinux-e308c24a358d1e79951b16c387cbc6c6593639a5.tar.xz
linux-e308c24a358d1e79951b16c387cbc6c6593639a5.zip
KVM: Use gfn_to_pfn_cache's immutable "kvm" in kvm_gpc_check()
Make kvm_gpc_check() use kvm instance cached in gfn_to_pfn_cache. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Michal Luczaj <mhal@rbox.co> 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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/virt/kvm/pfncache.c b/virt/kvm/pfncache.c
index d8ce30b893d9..decf4fdde668 100644
--- a/virt/kvm/pfncache.c
+++ b/virt/kvm/pfncache.c
@@ -76,10 +76,9 @@ void gfn_to_pfn_cache_invalidate_start(struct kvm *kvm, unsigned long start,
}
}
-bool kvm_gpc_check(struct kvm *kvm, struct gfn_to_pfn_cache *gpc, gpa_t gpa,
- unsigned long len)
+bool kvm_gpc_check(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);
if (!gpc->active)
return false;