Skip to content

target/riscv: Make MIP accesses atomic and BQL-safe

Philippe Mathieu-Daudé qemu-devel qemu-riscv 1 version Applied

Status from this message: Applied to riscv-to-apply.next

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest7 patches 9 repliesApplied

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/7target/riscv: Document riscv_cpu_update_mip()target/riscv/cpu.h+14 -01 reply
2/7target/riscv: Document kvm_riscv_set_irq()target/riscv/kvm/kvm_riscv.h+6 -01 reply
3/7target/riscv: Clarify riscv_accel_set_irq() argumentstarget/riscv/time_helper.c+9 -32 replies
4/7target/riscv: Have riscv_cpu_set_mode() call riscv_cpu_interrupt()target/riscv/tcg/cpu_helper.c+1 -11 reply
5/7target/riscv: Add riscv_cpu_get_mip()hw/intc/riscv_aclint.c target/riscv/cpu.c target/riscv/cpu.h +2 more+26 -91 reply
6/7target/riscv: Access MIP atomicallytarget/riscv/cpu.c target/riscv/tcg/cpu_helper.c+4 -21 reply
7/7target/riscv: Skip redundant MIP updatestarget/riscv/cpu.h target/riscv/tcg/cpu_helper.c target/riscv/time_helper.c+16 -31 reply

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonAlistair FrancisDaniel Henrique Barboza
1/7R-b
2/7R-b
3/7R-b R-b
4/7R-b
5/7R-b
6/7R-b R-b
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/7] target/riscv: Make MIP accesses atomic and BQL-safe

RISCV-specific patches extracted from the bigger v3:
https://lore.kernel.org/qemu-devel/[email protected]/

- 1-3: document riscv_cpu_update_mip() and kvm_riscv_set_irq(), and make the differing TCG (MIP mask) and KVM (IRQ number) argument conventions of riscv_accel_set_irq() explicit
- 4: riscv_cpu_set_mode() calls riscv_cpu_interrupt() directly
- 5-6: add riscv_cpu_get_mip() and make it atomic
- 7: drop the zero-mask callers of riscv_cpu_update_mip() and assert a non-zero mask

Patch 7 was drafted with AI assistance which suggested checking zero mask was a no-op as not reachable so I added the AI-used-for trailer.

Testing: CI pipeline

Philippe Mathieu-Daudé (7):
target/riscv: Document riscv_cpu_update_mip() target/riscv: Document kvm_riscv_set_irq() target/riscv: Clarify riscv_accel_set_irq() arguments target/riscv: Have riscv_cpu_set_mode() call riscv_cpu_interrupt() target/riscv: Add riscv_cpu_get_mip()
target/riscv: Access MIP atomically
target/riscv: Skip redundant MIP updates

 target/riscv/cpu.h            | 21 +++++++++++++++++++++
 target/riscv/kvm/kvm_riscv.h  |  6 ++++++
 hw/intc/riscv_aclint.c        |  2 +-
 target/riscv/cpu.c            |  9 ++++++++-
 target/riscv/tcg/cpu_helper.c | 21 ++++++++++++++-------
 target/riscv/tcg/csr.c        |  6 ++++--
 target/riscv/time_helper.c    | 21 ++++++++++++++++++---
 7 files changed, 72 insertions(+), 14 deletions(-)
Signature · 1 line
2.55.0