KVM: cleanup allocation of rmaps and page tracking data
authorDavid Stevens <stevensd@chromium.org>
Fri, 15 Oct 2021 16:30:21 +0000 (12:30 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Oct 2021 09:19:25 +0000 (05:19 -0400)
commit1e76a3ce0d3cdfc6b506e21047a26471bc1cc92e
tree44855eb8b79c5f2a487a1d403169a3578e48ef53
parent3f9808cac06c8dd4f800101e04f84fe3180198b0
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>
arch/x86/include/asm/kvm_host.h
arch/x86/include/asm/kvm_page_track.h
arch/x86/kvm/mmu.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/page_track.c
arch/x86/kvm/mmu/tdp_mmu.h
arch/x86/kvm/x86.c