summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/kvm_page_track.h
diff options
context:
space:
mode:
authorDavid Stevens <stevensd@chromium.org>2021-10-15 19:30:21 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-22 12:19:25 +0300
commit1e76a3ce0d3cdfc6b506e21047a26471bc1cc92e (patch)
tree44855eb8b79c5f2a487a1d403169a3578e48ef53 /arch/x86/include/asm/kvm_page_track.h
parent3f9808cac06c8dd4f800101e04f84fe3180198b0 (diff)
downloadlinux-1e76a3ce0d3cdfc6b506e21047a26471bc1cc92e.tar.xz
KVM: cleanup allocation of rmaps and page tracking data
Unify the flags for rmaps and page tracking data, using a single flag in struct kvm_arch and a single loop to go over all the address spaces and memslots. This avoids code duplication between alloc_all_memslots_rmaps and kvm_page_track_enable_mmu_write_tracking. Signed-off-by: David Stevens <stevensd@chromium.org> [This patch is the delta between David's v2 and v3, with conflicts fixed and my own commit message. - Paolo] Co-developed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_page_track.h')
-rw-r--r--arch/x86/include/asm/kvm_page_track.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvm_page_track.h b/arch/x86/include/asm/kvm_page_track.h
index 79d84a94f8eb..9d4a3b1b25b9 100644
--- a/arch/x86/include/asm/kvm_page_track.h
+++ b/arch/x86/include/asm/kvm_page_track.h
@@ -49,7 +49,8 @@ struct kvm_page_track_notifier_node {
int kvm_page_track_init(struct kvm *kvm);
void kvm_page_track_cleanup(struct kvm *kvm);
-int kvm_page_track_enable_mmu_write_tracking(struct kvm *kvm);
+bool kvm_page_track_write_tracking_enabled(struct kvm *kvm);
+int kvm_page_track_write_tracking_alloc(struct kvm_memory_slot *slot);
void kvm_page_track_free_memslot(struct kvm_memory_slot *slot);
int kvm_page_track_create_memslot(struct kvm *kvm,