All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH dovetail v2 0/4] riscv: dovetail: trap handling fixes
@ 2026-11-21 16:59 Tobias Schaffner
  2026-11-21 16:59 ` [PATCH dovetail v2 1/4] riscv: dovetail: do not notify traps again from do_trap() Tobias Schaffner
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Tobias Schaffner @ 2026-11-21 16:59 UTC (permalink / raw)
  To: xenomai; +Cc: rpm, jan.kiszka, florian.bezdeka, Tobias Schaffner

Hi all,

this series fixes the riscv trap handling of Dovetail.

Thanks to Jan for sharing his AI reviews on this which made me have
a look at this.

The bugs were verified by running a trap matrix test, which raises
every kind of trap from an out-of-band EVL thread, with a more detailed
oob_trap RV monitor from the Dovetail RV RFC enabled.

Testing was done on v7.3 with EVL under QEMU riscv64 and on a StarFive
VisionFive2: the trap matrix test, the libevl suite and kprobe tests
hitting out-of-band syscalls, IRQ handlers and nested faults all pass
with a clean kernel log and no monitor reaction. For 3/4, the oob_trap
monitor was extended to report an interrupt or a context switch while a
kernel trap over a context with hard irqs off runs, and the trap matrix
got kprobes whose fetch argument faults within the trap, in-band and
out-of-band, under timer interrupts: with v1 of that patch the monitor
reports every run, with v2 none.

Changes in v2:
 - Dropped "riscv: dovetail: do not nest the unknown trap handler in
   software checks": in favour of Jans changes that handle this for
   all architectures.
 - 3/4: Reworked. We inherit the hard irq state of the interrupted
   context from parents state instead of enabling hard irqs for kernel
   mode faults whenever in-band now. Thanks for the review @Florian

Thanks,
Tobias

Tobias Schaffner (4):
  riscv: dovetail: do not notify traps again from do_trap()
  riscv: dovetail: run kernel trap handlers the core did not demote for
  riscv: dovetail: inherit the hard irq state on kernel page faults
  riscv: dovetail: read the CFI trap value from the saved registers

 arch/riscv/kernel/traps.c | 51 ++++++++++++++++++---------------------
 arch/riscv/mm/fault.c     |  7 ++++--
 2 files changed, 28 insertions(+), 30 deletions(-)


base-commit: 2089e615c61844a111f5a09e80a6a7e2959e48f9
-- 
2.53.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-11-27 12:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 16:59 [PATCH dovetail v2 0/4] riscv: dovetail: trap handling fixes Tobias Schaffner
2026-11-21 16:59 ` [PATCH dovetail v2 1/4] riscv: dovetail: do not notify traps again from do_trap() Tobias Schaffner
2026-11-21 16:59 ` [PATCH dovetail v2 2/4] riscv: dovetail: run kernel trap handlers the core did not demote for Tobias Schaffner
2026-11-21 16:59 ` [PATCH dovetail v2 3/4] riscv: dovetail: inherit the hard irq state on kernel page faults Tobias Schaffner
2026-11-22 22:12   ` Florian Bezdeka
2026-11-22 22:18   ` Florian Bezdeka
2026-11-23 11:39     ` Tobias Schaffner
2026-11-23 12:05       ` Florian Bezdeka
2026-11-23 12:26         ` Bezdeka, Florian
2026-11-23 13:43         ` Tobias Schaffner
2026-11-23 22:12           ` Florian Bezdeka
2026-11-24 19:53             ` Tobias Schaffner
2026-11-25 11:13               ` Florian Bezdeka
2026-11-27 12:25                 ` Tobias Schaffner
2026-11-21 16:59 ` [PATCH dovetail v2 4/4] riscv: dovetail: read the CFI trap value from the saved registers Tobias Schaffner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.