summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Stevens <stevensd@chromium.org>2024-10-10 20:23:32 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-10-25 18:57:59 +0200
commit2ff072ba7ad2deb1c3b2d231faa0ac3a25e2451b (patch)
tree934f21186bbe6c62557b7f669ecab753cbb39a6f /include
parentKVM: pfncache: Precisely track refcounted pages (diff)
downloadlinux-2ff072ba7ad2deb1c3b2d231faa0ac3a25e2451b.tar.xz
linux-2ff072ba7ad2deb1c3b2d231faa0ac3a25e2451b.zip
KVM: Migrate kvm_vcpu_map() to kvm_follow_pfn()
Migrate kvm_vcpu_map() to kvm_follow_pfn(), and have it track whether or not the map holds a refcounted struct page. Precisely tracking struct page references will eventually allow removing kvm_pfn_to_refcounted_page() and its various wrappers. Signed-off-by: David Stevens <stevensd@chromium.org> [sean: use a pointer instead of a boolean] Tested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Sean Christopherson <seanjc@google.com> Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20241010182427.1434605-31-seanjc@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kvm_host.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index cd6f5cc1930f..35e1beb017dd 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -280,6 +280,7 @@ struct kvm_host_map {
* can be used as guest memory but they are not managed by host
* kernel).
*/
+ struct page *refcounted_page;
struct page *page;
void *hva;
kvm_pfn_t pfn;
@@ -1238,7 +1239,6 @@ void kvm_release_pfn_dirty(kvm_pfn_t pfn);
void kvm_set_pfn_dirty(kvm_pfn_t pfn);
void kvm_set_pfn_accessed(kvm_pfn_t pfn);
-void kvm_release_pfn(kvm_pfn_t pfn, bool dirty);
int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset,
int len);
int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len);