Re: [PATCH v4] RISC-V: KVM: Serialize virtual interrupt pending state updates

From: Xie Bo

Date: Tue Jul 14 2026 - 22:04:37 EST


Hi Anup,

I addressed your comments in v5:

- kept kvm_riscv_vcpu_aia_has_interrupts() as a single helper and made
it acquire irqs_pending_lock internally while checking the high
pending bitmap;
- released irqs_pending_lock before the IMSIC VS-file check, since that
path takes vsfile_lock;
- kept the guest CSR updates outside the critical section and protected
only the dirty bitmap updates; and
- added the requested whitespace and clarified the race example.

The patch remains based on Linux 7.2-rc3. RV64, RV32, and RV64 with
PREEMPT_RT KVM builds pass, and checkpatch reports no issues.

The v5 patch follows this reply.

Regards,
Xie Bo