All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH dovetail 0/7] rv: runtime verification monitors for Dovetail
@ 2026-11-10 18:08 Tobias Schaffner
  2026-11-10 18:08 ` [RFC PATCH dovetail 1/7] dovetail: factor out the mayday check on return to user mode Tobias Schaffner
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Tobias Schaffner @ 2026-11-10 18:08 UTC (permalink / raw)
  To: xenomai; +Cc: rpm, jan.kiszka, Tobias Schaffner

Hi all,

with this RFC I would like to propose using the Linux kernel Runtime
Verification (RV) system [1] for runtime verification of Dovetail based
cokernels.

Running a system with RV monitors active should ensure that the system
behaves as described in the model. As this is checked at runtime we can
verify if the system is even behaving as inteded when it is running the
real workload.

My ultimate goal is not only to use it for verification but also for wakeup
latency tracing and decomposition in EVL by describing the whole wakeup
path. I am working on upstreaming dwell time measurements in the RV system
in parallel for that [2].

This would allow us not only to get a worst case latency and decomposition
for a latency evaluation tool like latmus but to get a worst case latency
for any load applied to the system (e.g. the real application of the user).

This patch set proposes three Dovetail monitors bundled in one container:

 * offstage checks that Linux leaves a task alone while it runs out-of-band. It
must neither schedule the task nor let it raise a signal on itself.

 * oob_trap checks that every out-of-band trap notification is unwound for the
same trap before the task goes out-of-band again.

 * oob_signal checks that a task receiving a signal out-of-band is kicked
in-band. Once the cokernel handled the notification, the task must not return
to user mode out-of-band without a mayday pending. I think his monitor found
a present bug in EVL: since "evl/sched: get rid of this_evl_rq_thread()"
evl_kick_thread() skips the mayday for a thread running out-of-band on a
remote CPU, so the thread ignores all signals, even SIGKILL.

For the monitors the series adds a few bare tracepoints to Dovetail. They are
not exposed in tracefs.

The monitors can be built by setting CONFIG_RV_DOVETAIL, which enables RV,
the monitors and the printk reactor. oob_signal is not available on 32-bit
arm yet, as the out-of-band syscall fast path there is written in assembly.

To execute them:

  # cd /sys/kernel/tracing/rv
  # echo printk > monitors/dovetail/reactors
  # echo 1 > monitors/dovetail/enable

Looking forward to your feedback, input and ideas on how to use and improve
this further.

Best,
Tobias

[1] https://docs.kernel.org/trace/rv/runtime-verification.html
[2] https://lore.kernel.org/linux-trace-kernel/20260827072400.45734-1-tobias.schaffner@siemens.com

Tobias Schaffner (7):
  dovetail: factor out the mayday check on return to user mode
  dovetail: trace stage switches
  rv: add dovetail container and offstage monitor
  dovetail: trace out-of-band trap notifications
  rv: add oob_trap monitor
  dovetail: trace signal notifications and out-of-band returns
  rv: add oob_signal monitor

 Documentation/trace/rv/index.rst              |   1 +
 Documentation/trace/rv/monitor_dovetail.rst   | 124 +++++++++++++++
 include/linux/dovetail.h                      |  19 ++-
 include/trace/events/dovetail.h               |  40 +++++
 kernel/Kconfig.dovetail                       |  14 ++
 kernel/dovetail.c                             |  35 ++++-
 kernel/irq/pipeline.c                         |   4 +-
 kernel/sched/core.c                           |   2 +
 kernel/trace/rv/Kconfig                       |   5 +
 kernel/trace/rv/Makefile                      |   4 +
 kernel/trace/rv/monitors/dovetail/Kconfig     |  13 ++
 kernel/trace/rv/monitors/dovetail/dovetail.c  |  41 +++++
 kernel/trace/rv/monitors/dovetail/dovetail.h  |   3 +
 kernel/trace/rv/monitors/offstage/Kconfig     |  15 ++
 kernel/trace/rv/monitors/offstage/offstage.c  | 114 ++++++++++++++
 kernel/trace/rv/monitors/offstage/offstage.h  |  61 ++++++++
 .../rv/monitors/offstage/offstage_trace.h     |  15 ++
 kernel/trace/rv/monitors/oob_signal/Kconfig   |  16 ++
 .../trace/rv/monitors/oob_signal/oob_signal.c | 114 ++++++++++++++
 .../trace/rv/monitors/oob_signal/oob_signal.h |  74 +++++++++
 .../rv/monitors/oob_signal/oob_signal_trace.h |  15 ++
 kernel/trace/rv/monitors/oob_trap/Kconfig     |  14 ++
 kernel/trace/rv/monitors/oob_trap/oob_trap.c  | 144 ++++++++++++++++++
 kernel/trace/rv/monitors/oob_trap/oob_trap.h  |  61 ++++++++
 .../rv/monitors/oob_trap/oob_trap_trace.h     |  19 +++
 kernel/trace/rv/rv_trace.h                    |   3 +
 tools/verification/models/offstage.dot        |  14 ++
 tools/verification/models/oob_signal.dot      |  23 +++
 tools/verification/models/oob_trap.dot        |  14 ++
 29 files changed, 1013 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/trace/rv/monitor_dovetail.rst
 create mode 100644 include/trace/events/dovetail.h
 create mode 100644 kernel/trace/rv/monitors/dovetail/Kconfig
 create mode 100644 kernel/trace/rv/monitors/dovetail/dovetail.c
 create mode 100644 kernel/trace/rv/monitors/dovetail/dovetail.h
 create mode 100644 kernel/trace/rv/monitors/offstage/Kconfig
 create mode 100644 kernel/trace/rv/monitors/offstage/offstage.c
 create mode 100644 kernel/trace/rv/monitors/offstage/offstage.h
 create mode 100644 kernel/trace/rv/monitors/offstage/offstage_trace.h
 create mode 100644 kernel/trace/rv/monitors/oob_signal/Kconfig
 create mode 100644 kernel/trace/rv/monitors/oob_signal/oob_signal.c
 create mode 100644 kernel/trace/rv/monitors/oob_signal/oob_signal.h
 create mode 100644 kernel/trace/rv/monitors/oob_signal/oob_signal_trace.h
 create mode 100644 kernel/trace/rv/monitors/oob_trap/Kconfig
 create mode 100644 kernel/trace/rv/monitors/oob_trap/oob_trap.c
 create mode 100644 kernel/trace/rv/monitors/oob_trap/oob_trap.h
 create mode 100644 kernel/trace/rv/monitors/oob_trap/oob_trap_trace.h
 create mode 100644 tools/verification/models/offstage.dot
 create mode 100644 tools/verification/models/oob_signal.dot
 create mode 100644 tools/verification/models/oob_trap.dot


base-commit: a3ad77d7ba3eac8a73f64026272747c01dd84fc6
-- 
2.53.0


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

end of thread, other threads:[~2026-11-19 19:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10 18:08 [RFC PATCH dovetail 0/7] rv: runtime verification monitors for Dovetail Tobias Schaffner
2026-11-10 18:08 ` [RFC PATCH dovetail 1/7] dovetail: factor out the mayday check on return to user mode Tobias Schaffner
2026-11-10 18:08 ` [RFC PATCH dovetail 2/7] dovetail: trace stage switches Tobias Schaffner
2026-11-11  7:40   ` Jan Kiszka
2026-11-19 19:07     ` Philippe Gerum
2026-11-10 18:08 ` [RFC PATCH dovetail 3/7] rv: add dovetail container and offstage monitor Tobias Schaffner
2026-11-10 18:08 ` [RFC PATCH dovetail 4/7] dovetail: trace out-of-band trap notifications Tobias Schaffner
2026-11-10 18:08 ` [RFC PATCH dovetail 5/7] rv: add oob_trap monitor Tobias Schaffner
2026-11-10 18:08 ` [RFC PATCH dovetail 6/7] dovetail: trace signal notifications and out-of-band returns Tobias Schaffner
2026-11-10 18:08 ` [RFC PATCH dovetail 7/7] rv: add oob_signal monitor Tobias Schaffner
2026-11-19 19:14 ` [RFC PATCH dovetail 0/7] rv: runtime verification monitors for Dovetail Philippe Gerum

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.