[PATCH 20/46] softirq, lto: Mark irq_enter/exit_rcu() as __visible

From: Jiri Slaby (SUSE)
Date: Mon Nov 14 2022 - 06:45:56 EST


From: Andi Kleen <andi@xxxxxxxxxxxxxx>

Symbols referenced from assembler (either directly or e.f. from
DEFINE_STATIC_KEY()) need to be global and visible in gcc LTO because
they could end up in a different object file than the assembler. This
can lead to linker errors without this patch.

So mark irq_enter_rcu() and irq_exit_rcu() as __visible.

Signed-off-by: Andi Kleen <andi@xxxxxxxxxxxxxx>
Signed-off-by: Martin Liska <mliska@xxxxxxx>
Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
---
kernel/softirq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index c8a6913c067d..9d62e09c9581 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -604,7 +604,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void)
/**
* irq_enter_rcu - Enter an interrupt context with RCU watching
*/
-void irq_enter_rcu(void)
+__visible void irq_enter_rcu(void)
{
__irq_enter_raw();

@@ -657,7 +657,7 @@ static inline void __irq_exit_rcu(void)
*
* Also processes softirqs if needed and possible.
*/
-void irq_exit_rcu(void)
+__visible void irq_exit_rcu(void)
{
__irq_exit_rcu();
/* must be last! */
--
2.38.1