[PATCH v5 0/5] Implement Eager Page Splitting for RISC-V

Anup Patel anup at brainfault.org
Sat Aug 1 01:35:29 PDT 2026


On Fri, Jul 31, 2026 at 2:45 PM Wang Yechao <wang.yechao255 at zte.com.cn> wrote:
>
> Eager Page Splitting is implemented on x86 and ARM. It improves the
> performance of dirty logging (used in live migrations) when guest memory
> is backed by huge pages.
>
> This series implement Eager Page Splitting for RISC-V. The Implementation
> similar to x86 and ARM. It provides two ways to split huge pages in ioctl
> context instead of on fault in vCPU context:
>
> - Split huge pages when dirty logging is enabled when
>   KVM_DIRTY_LOG_INITIALLY_SET is not set. This happens when enabling the
>   KVM_MEM_LOG_DIRTY_PAGES flag of a memslot, and splits the whole memslot
>   into 4K mappings.
>
> - Split huge pages during KVM_CLEAR_DIRTY_LOG when
>   KVM_DIRTY_LOG_INITIALLY_SET is set. This happens when enabling dirty log
>   in small chunks. It does not split the whole memslot, but only the
>   requested chunk range.
>
> Changes in v5:
>  - PATCH1: Move pgd_split_page_cache freeing to kvm_riscv_mmu_free_pgd().
>  - PATCH3: Add a comment to explain why TLB flush is not needed here.
>  - Link to v4:
>  https://lore.kernel.org/linux-riscv/20260701120954.129873-1-wang.yechao255@zte.com.cn/
>
> Changes in v4:
>  - Rebase on v7.2-rc1 version.
>  sashiko-bot AI review
>  (https://sashiko.dev/#/patchset/20260624160054463wcDvJaMoydSggcNOWgcfB@zte.com.cn)
>  - Add the rwlock_needbreak() check when toup split cache.
>  - ALIGN_DOWN the start addr to PMD_SIZE.
>
> Changes in v3 resend:
>  - Fix patch format to ensure emails reach the linux-riscv and kvm-riscv
>    mailing lists.
>  - Move the free pgd_split_page_cache into kvm_arch_destroy_vm().
>  https://lore.kernel.org/kvm-riscv/20260624160054463wcDvJaMoydSggcNOWgcfB@zte.com.cn/
>
> Changes in v3:
>  - Rebase on v7.1 version.
>  - Add patch03 to remove the redundant TLB flush operations.
>
>  sashiko-bot AI review
>  (https://sashiko.dev/#/message/20260603104847.9692C1F00893%40smtp.kernel.org)
>  - Check the kvm->arch.pgd before split huge pages.
>  - Align the start address to PMD_SIZE before split.
>  - Flushing remote TLBs before Dropping mmu_lock.
>
> Changes in v2:
>  - Rename the split_page_cache.
>  - Rename the kvm_riscv_split_huge_pages and
>    kvm_riscv_split_memory_region.
>  - Add lockdep_assert_held check before split huge pages.
>  - Update Documentation/admin-guide/kernel-parameters.txt.
>  - Link to v2
>  https://lore.kernel.org/linux-riscv/20260603175256408L0jnqGs1cJGc0ijCdujci@zte.com.cn/
>
>  - Link to v1:
>  https://lore.kernel.org/linux-riscv/20260513153656847l3c4fI5hBsAyoIZi8aGIs@zte.com.cn/
>
> Wang Yechao (5):
>   RISC-V: KVM: Add the split page cache for ioctl context
>   RISC-V: KVM: Split huge pages when dirty logging is enabled
>   RISC-V: KVM: Remove redundant TLB flush operations
>   RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG
>   RISC-V: KVM: Add the eager_page_split module parameter
>
>  .../admin-guide/kernel-parameters.txt         |   7 +-
>  arch/riscv/include/asm/kvm_gstage.h           |   6 +-
>  arch/riscv/include/asm/kvm_host.h             |   1 +
>  arch/riscv/kvm/gstage.c                       |  23 ++--
>  arch/riscv/kvm/mmu.c                          | 100 +++++++++++++++++-
>  5 files changed, 120 insertions(+), 17 deletions(-)
>

Queued this series for Linux-7.3

Thanks,
Anup



More information about the kvm-riscv mailing list