[PATCH 02/21] rcu: Tag rcu_irq_*_irqson() as noinstr

Frederic Weisbecker
2022-05-19T14:58:55Z

rcu_irq_*_irqson() functions can't be safely instrumented. Since they
enter/exit to/from RCU idle mode, those functions must be tagged as
"noinstr".

Unfortunately this involves converting the instrumentable
local_irq_save()/local_irq_restore() to their raw counterparts. Precious
debugging informations might be lost on the way until a better way out
is found.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Cc: Uladzislau Rezki <uladzislau.rezki@sony.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: Yu Liao<liaoyu15@huawei.com>
Cc: Phil Auld <pauld@redhat.com>
Cc: Paul Gortmaker<paul.gortmaker@windriver.com>
Cc: Alex Belits <abelits@marvell.com>
---
kernel/rcu/tree.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 02233b17cce0..ff97264d8077 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -843,13 +843,13 @@ void rcu_irq_exit_check_preempt(void)
* If you add or remove a call to rcu_irq_exit_irqson(), be sure to test
* with CONFIG_RCU_EQS_DEBUG=y.
*/
-void rcu_irq_exit_irqson(void)
+void noinstr rcu_irq_exit_irqson(void)
{
unsigned long flags;

- local_irq_save(flags);
+ raw_local_irq_save(flags);
rcu_irq_exit();
- local_irq_restore(flags);
+ raw_local_irq_restore(flags);
}

/*
@@ -1081,13 +1081,13 @@ noinstr void rcu_irq_enter(void)
* If you add or remove a call to rcu_irq_enter_irqson(), be sure to test
* with CONFIG_RCU_EQS_DEBUG=y.
*/
-void rcu_irq_enter_irqson(void)
+void noinstr rcu_irq_enter_irqson(void)
{
unsigned long flags;

- local_irq_save(flags);
+ raw_local_irq_save(flags);
rcu_irq_enter();
- local_irq_restore(flags);
+ raw_local_irq_restore(flags);
}

/*
--
2.25.1