Re: [PATCH] KVM: riscv: Only fast-path dirty-log write faults on host-writable leaves

From: Jinyu Tang

Date: Fri Oct 23 2026 - 07:59:32 EST


On Sat, Oct 17, 2026 at 12:09:26PM +0900, SeungJu Cheon wrote:
> + /* Let the slow path handle host-side write protection and CoW. */
> + if (!(pte_val(old_pte) & KVM_GSTAGE_PTE_HOST_WRITABLE)) {
> + ret = false;
> + break;
> + }

Thanks for fixing this.
Tested on QEMU 10.2.1 with a private memfd mapping and dirty logging.
A guest read followed by a write corrupts the shared backing without
this fix; and with it, CoW occurs and the backing stays unchanged.

Reviewed-by: Jinyu Tang <jinyu.tang@xxxxxxxxx>

Thanks,
Jinyu