RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG

Split huge pages on the range specified using KVM_CLEAR_DIRTY_LOG.
And do not split when enabling dirty logging if
KVM_DIRTY_LOG_INITIALLY_SET is set.

Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260731091215.1549430-5-wang.yechao255@zte.com.cn
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Wang Yechao 2026-07-31 17:12:09 +08:00 committed by Anup Patel
parent 6854a0f4d9
commit c67573b37c

View File

@ -168,6 +168,9 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm,
kvm_riscv_gstage_wp_range(&gstage, start, end);
if (kvm_dirty_log_manual_protect_and_init_set(kvm))
mmu_split_huge_pages(&gstage, start, end);
/*
* Remote TLB flush is not needed here since callers of
* kvm_arch_mmu_enable_log_dirty_pt_masked() already do it.