path: root/virt/kvm/kvm_main.c
diff options
authorBen Gardon <>2020-10-14 11:26:55 -0700
committerPaolo Bonzini <>2020-10-23 03:42:13 -0400
commita6a0b05da9f37ff56faa6b8351ed6e0b55032460 (patch)
tree62898a48873891214f7ef9849fec5bc7fae43f2a /virt/kvm/kvm_main.c
parent1d8dd6b3f12b03f617820a9ebc19cc2fabf59ce9 (diff)
kvm: x86/mmu: Support dirty logging for the TDP MMU
Dirty logging is a key feature of the KVM MMU and must be supported by the TDP MMU. Add support for both the write protection and PML dirty logging modes. Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell machine. This series introduced no new failures. This series can be viewed in Gerrit at: Signed-off-by: Ben Gardon <> Message-Id: <> Signed-off-by: Paolo Bonzini <>
Diffstat (limited to 'virt/kvm/kvm_main.c')
1 files changed, 2 insertions, 4 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 2e8539213125..2541a17ff1c4 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -143,8 +143,6 @@ static void hardware_disable_all(void);
static void kvm_io_bus_destroy(struct kvm_io_bus *bus);
-static void mark_page_dirty_in_slot(struct kvm_memory_slot *memslot, gfn_t gfn);
__visible bool kvm_rebooting;
@@ -2645,8 +2643,7 @@ int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len)
-static void mark_page_dirty_in_slot(struct kvm_memory_slot *memslot,
- gfn_t gfn)
+void mark_page_dirty_in_slot(struct kvm_memory_slot *memslot, gfn_t gfn)
if (memslot && memslot->dirty_bitmap) {
unsigned long rel_gfn = gfn - memslot->base_gfn;
@@ -2654,6 +2651,7 @@ static void mark_page_dirty_in_slot(struct kvm_memory_slot *memslot,
set_bit_le(rel_gfn, memslot->dirty_bitmap);
void mark_page_dirty(struct kvm *kvm, gfn_t gfn)