[PATCH v3 00/22] tracing vs world

Peter Zijlstra
2020-02-19T15:15:19Z

Hi all,

These here patches are the result of Mathieu and Steve trying to get commit
865e63b04e9b2 ("tracing: Add back in rcu_irq_enter/exit_irqson() for rcuidle
tracepoints") reverted again.

One of the things discovered is that tracing MUST NOT happen before nmi_enter()
or after nmi_exit(). Audit results of the previous version are still valid.

This then snowballed into auditing other exceptions, notably #MC, and #BP. Lots
of patches came out of that.

I would love for some tooling in this area. Dan, smatch has full callchains
right? Would it be possible to have an __assert_no_tracing__() marker of sorts
that validates that no possible callchain reaching that assertion has hit
tracing before that point?

It would mean you have to handle the various means of 'notrace' annotation
(both the function attribute as well as the Makefile rules), recognising
tracepoints and ideally handling NOKPROBE annotations.

Changes since -v2:

- #MC / ist_enter() audit -- first 4 patches. After this in_nmi() should
always be set 'correctly'.
- RCU IRQ enter/exit function simplification
- #BP / poke_int3_handler() audit -- last many patches.
- pulled in some locking/kcsan patches

Changes since -v1:

- Added tags
- Changed #4; changed nmi_enter() to use __preempt_count_add() vs
marking preempt_count_add() notrace.
- Changed #5; confusion on which functions are notrace due to Makefile
- Added #9; remove limitation on the perf-function-trace coupling