On 9/18/26 11:16 AM, Baptiste Le Duc wrote:
Extend the guest page fault handler with store emulation to support MMIO
write accesses.

The instruction decode mirrors emulate_load() and, like it, is adapted
from Linux's KVM RISC-V implementation. As with the load path, the
completion is synchronous through try_handle_mmio() rather than KVM's
userspace exit/return split, since Xen's MMIO handlers run in the
hypervisor. Faults taken while re-reading the trapped instruction are
handled by decode_ldst_insn(), shared with the load path.

When a guest store instruction faults, the trapped instruction is decoded
using HTINST or, if unavailable, fetched via unprivileged access. At the
Nit: commit message restates the HTINST-or-unprivileged-fetch decode
mechanism, which is already described in the prep patch introducing
decode_ldst_insn()/insn_fetch_faulted(), and isn't repeated in
emulate_load()'s commit message. Suggest trimming for symmetry with the
load commit, e.g.:

   When a guest store instruction faults, the trapped instruction is
   decoded via decode_ldst_insn(), shared with the load path. At the
   moment only virtual interrupt controller (vINTC) traps are expected to
   occur, since it is currently the only backend registered with the MMIO
   handler dispatch, so in practice the store is emulated via the vINTC
   backend.


I will update the commit message.

Thanks.

~ Oleksii

Reply via email to