提交 59bc300b 编写于 作者: P Peter Zijlstra 提交者: Thomas Gleixner

x86/entry: Clarify irq_{enter,exit}_rcu()

Because:

  irq_enter_rcu() includes lockdep_hardirq_enter()
  irq_exit_rcu() does *NOT* include lockdep_hardirq_exit()

Which resulted in two 'stray' lockdep_hardirq_exit() calls in
idtentry.h, and me spending a long time trying to find the matching
enter calls.
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200529213321.359433429@infradead.org

上级 fd501d4f
...@@ -206,7 +206,6 @@ __visible noinstr void func(struct pt_regs *regs, \ ...@@ -206,7 +206,6 @@ __visible noinstr void func(struct pt_regs *regs, \
kvm_set_cpu_l1tf_flush_l1d(); \ kvm_set_cpu_l1tf_flush_l1d(); \
__##func (regs, (u8)error_code); \ __##func (regs, (u8)error_code); \
irq_exit_rcu(); \ irq_exit_rcu(); \
lockdep_hardirq_exit(); \
instrumentation_end(); \ instrumentation_end(); \
idtentry_exit_cond_rcu(regs, rcu_exit); \ idtentry_exit_cond_rcu(regs, rcu_exit); \
} \ } \
...@@ -249,7 +248,6 @@ __visible noinstr void func(struct pt_regs *regs) \ ...@@ -249,7 +248,6 @@ __visible noinstr void func(struct pt_regs *regs) \
kvm_set_cpu_l1tf_flush_l1d(); \ kvm_set_cpu_l1tf_flush_l1d(); \
run_on_irqstack_cond(__##func, regs, regs); \ run_on_irqstack_cond(__##func, regs, regs); \
irq_exit_rcu(); \ irq_exit_rcu(); \
lockdep_hardirq_exit(); \
instrumentation_end(); \ instrumentation_end(); \
idtentry_exit_cond_rcu(regs, rcu_exit); \ idtentry_exit_cond_rcu(regs, rcu_exit); \
} \ } \
......
...@@ -404,12 +404,7 @@ static inline void tick_irq_exit(void) ...@@ -404,12 +404,7 @@ static inline void tick_irq_exit(void)
#endif #endif
} }
/** static inline void __irq_exit_rcu(void)
* irq_exit_rcu() - Exit an interrupt context without updating RCU
*
* Also processes softirqs if needed and possible.
*/
void irq_exit_rcu(void)
{ {
#ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED #ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED
local_irq_disable(); local_irq_disable();
...@@ -424,6 +419,18 @@ void irq_exit_rcu(void) ...@@ -424,6 +419,18 @@ void irq_exit_rcu(void)
tick_irq_exit(); tick_irq_exit();
} }
/**
* irq_exit_rcu() - Exit an interrupt context without updating RCU
*
* Also processes softirqs if needed and possible.
*/
void irq_exit_rcu(void)
{
__irq_exit_rcu();
/* must be last! */
lockdep_hardirq_exit();
}
/** /**
* irq_exit - Exit an interrupt context, update RCU and lockdep * irq_exit - Exit an interrupt context, update RCU and lockdep
* *
...@@ -431,7 +438,7 @@ void irq_exit_rcu(void) ...@@ -431,7 +438,7 @@ void irq_exit_rcu(void)
*/ */
void irq_exit(void) void irq_exit(void)
{ {
irq_exit_rcu(); __irq_exit_rcu();
rcu_irq_exit(); rcu_irq_exit();
/* must be last! */ /* must be last! */
lockdep_hardirq_exit(); lockdep_hardirq_exit();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册