Skip to contentSkip to conversation

linux-next: build warning after merge of the tip tree

DISCUSSION Stephen Rothwell 4 participants 8 messages Sep 17, 2021 – Nov 23, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the tip tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

vmlinux.o: warning: objtool: mce_setup()+0x22: call to memset() leaves .noinstr.text section
vmlinux.o: warning: objtool: do_machine_check()+0x51: call to mce_gather_info() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x0: call to rcu_dynticks_task_trace_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0xe: call to rcu_dynticks_task_trace_exit() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_nmi_enter()+0x36: call to __kasan_check_read() leaves .noinstr.text section

I don't know what produced these warnings.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 7 lines · Stephen Rothwell

Hi all,

After merging the tip tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

vmlinux.o: warning: objtool: mce_setup()+0x22: call to memset() leaves .noinstr.text section vmlinux.o: warning: objtool: do_machine_check()+0x51: call to mce_gather_info() leaves .noinstr.text section

Those are pre-existing and Boris is lokoing into them, these however, are new:

Quoted 2 lines

vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x0: call to rcu_dynticks_task_trace_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0xe: call to rcu_dynticks_task_trace_exit() leaves .noinstr.text section

These are from 7d0c9c50c5a1 ("rcu-tasks: Avoid IPIing userspace/idle tasks if kernel is so built").

The below seems to help.

Quoted 1 line

vmlinux.o: warning: objtool: rcu_nmi_enter()+0x36: call to __kasan_check_read() leaves .noinstr.text section

That's 2be57f732889 ("rcu: Weaken ->dynticks accesses and updates"), doing:

- return !(arch_atomic_read(&this_cpu_ptr(&rcu_data)->dynticks) & 0x1);
+ return !(atomic_read(this_cpu_ptr(&rcu_data.dynticks)) & 0x1);

and causing instrumentation to be inserted where none is acceptable. Flipping that back to arch_atomic_read() makes it go away as expected.

---

kernel/rcu/tree_plugin.h +4 -4
index 1a6fdb03d0a5..5199559fbbf0 100644
@@ -1479,7 +1479,7 @@ static void rcu_bind_gp_kthread(void)
 }
 
 /* Record the current task on dyntick-idle entry. */
-static void noinstr rcu_dynticks_task_enter(void)
+static __always_inline void rcu_dynticks_task_enter(void)
 {
 #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL)
 	WRITE_ONCE(current->rcu_tasks_idle_cpu, smp_processor_id());
@@ -1487,7 +1487,7 @@ static void noinstr rcu_dynticks_task_enter(void)
 }
 
 /* Record no current task on dyntick-idle exit. */
-static void noinstr rcu_dynticks_task_exit(void)
+static __always_inline void rcu_dynticks_task_exit(void)
 {
 #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL)
 	WRITE_ONCE(current->rcu_tasks_idle_cpu, -1);
@@ -1495,7 +1495,7 @@ static void noinstr rcu_dynticks_task_exit(void)
 }
 
 /* Turn on heavyweight RCU tasks trace readers on idle/user entry. */
-static void rcu_dynticks_task_trace_enter(void)
+static __always_inline void rcu_dynticks_task_trace_enter(void)
 {
 #ifdef CONFIG_TASKS_TRACE_RCU
 	if (IS_ENABLED(CONFIG_TASKS_TRACE_RCU_READ_MB))
@@ -1504,7 +1504,7 @@ static void rcu_dynticks_task_trace_enter(void)
 }
 
 /* Turn off heavyweight RCU tasks trace readers on idle/user exit. */
-static void rcu_dynticks_task_trace_exit(void)
+static __always_inline void rcu_dynticks_task_trace_exit(void)
 {
 #ifdef CONFIG_TASKS_TRACE_RCU
 	if (IS_ENABLED(CONFIG_TASKS_TRACE_RCU_READ_MB))
maintainer Tested-by
#2 lore raw
Quoted 28 lines · Peter Zijlstra
Quoted 7 lines · Stephen Rothwell

Hi all,

After merging the tip tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

vmlinux.o: warning: objtool: mce_setup()+0x22: call to memset() leaves .noinstr.text section vmlinux.o: warning: objtool: do_machine_check()+0x51: call to mce_gather_info() leaves .noinstr.text section

Those are pre-existing and Boris is lokoing into them, these however, are new:

Quoted 2 lines

vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x0: call to rcu_dynticks_task_trace_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0xe: call to rcu_dynticks_task_trace_exit() leaves .noinstr.text section

These are from 7d0c9c50c5a1 ("rcu-tasks: Avoid IPIing userspace/idle tasks if kernel is so built").

The below seems to help.

Quoted 1 line

vmlinux.o: warning: objtool: rcu_nmi_enter()+0x36: call to __kasan_check_read() leaves .noinstr.text section

That's 2be57f732889 ("rcu: Weaken ->dynticks accesses and updates"), doing:

(quoted diff) +1 -1
-       return !(arch_atomic_read(&this_cpu_ptr(&rcu_data)->dynticks) & 0x1);
+       return !(atomic_read(this_cpu_ptr(&rcu_data.dynticks)) & 0x1);
Quoted 2 lines

and causing instrumentation to be inserted where none is acceptable. Flipping that back to arch_atomic_read() makes it go away as expected.

The 2be57f732889 commit went in during the v5.15 merge window and the 7d0c9c50c5a1 went into v5.8, but perhaps Linus won't be averse to taking a fix for an older bug along with the regression. ;-)

Given no Signed-off-by, I am guessing that you would like to push this separately. If so:

Quoted 42 lines

---

kernel/rcu/tree_plugin.h +4 -4
index 1a6fdb03d0a5..5199559fbbf0 100644
@@ -1479,7 +1479,7 @@ static void rcu_bind_gp_kthread(void)
 }
 
 /* Record the current task on dyntick-idle entry. */
-static void noinstr rcu_dynticks_task_enter(void)
+static __always_inline void rcu_dynticks_task_enter(void)
 {
 #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL)
 	WRITE_ONCE(current->rcu_tasks_idle_cpu, smp_processor_id());
@@ -1487,7 +1487,7 @@ static void noinstr rcu_dynticks_task_enter(void)
 }
 
 /* Record no current task on dyntick-idle exit. */
-static void noinstr rcu_dynticks_task_exit(void)
+static __always_inline void rcu_dynticks_task_exit(void)
 {
 #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL)
 	WRITE_ONCE(current->rcu_tasks_idle_cpu, -1);
@@ -1495,7 +1495,7 @@ static void noinstr rcu_dynticks_task_exit(void)
 }
 
 /* Turn on heavyweight RCU tasks trace readers on idle/user entry. */
-static void rcu_dynticks_task_trace_enter(void)
+static __always_inline void rcu_dynticks_task_trace_enter(void)
 {
 #ifdef CONFIG_TASKS_TRACE_RCU
 	if (IS_ENABLED(CONFIG_TASKS_TRACE_RCU_READ_MB))
@@ -1504,7 +1504,7 @@ static void rcu_dynticks_task_trace_enter(void)
 }
 
 /* Turn off heavyweight RCU tasks trace readers on idle/user exit. */
-static void rcu_dynticks_task_trace_exit(void)
+static __always_inline void rcu_dynticks_task_trace_exit(void)
 {
 #ifdef CONFIG_TASKS_TRACE_RCU
 	if (IS_ENABLED(CONFIG_TASKS_TRACE_RCU_READ_MB))
#3 lore raw
In reply to Peter Zijlstra

Hi all,

Quoted 10 lines · On Fri, 17 Sep 2021 10:23:48 +0200 Peter Zijlstra <[email protected]> wrote:
Quoted 6 lines · Stephen Rothwell

After merging the tip tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

vmlinux.o: warning: objtool: mce_setup()+0x22: call to memset() leaves .noinstr.text section vmlinux.o: warning: objtool: do_machine_check()+0x51: call to mce_gather_info() leaves .noinstr.text section

Those are pre-existing and Boris is lokoing into them

I am still seeing the above 2 warnings and also now:

vmlinux.o: warning: objtool: xen_get_debugreg()+0xb: call to HYPERVISOR_get_debugreg() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_set_debugreg()+0x15: call to HYPERVISOR_set_debugreg.isra.0() leaves .noinstr.text section

Presumably caused by

f4afb713e5c3 ("x86/xen: Make get_debugreg() noinstr") 7361fac0465b ("x86/xen: Make set_debugreg() noinstr")

Signature · 2 lines
Cheers,
Stephen Rothwell
#4 lore raw
In reply to Stephen Rothwell

Hi all,

Quoted 9 lines · On Fri, 17 Sep 2021 11:58:59 +1000 Stephen Rothwell <[email protected]>…

After merging the tip tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

vmlinux.o: warning: objtool: mce_setup()+0x22: call to memset() leaves .noinstr.text section
vmlinux.o: warning: objtool: do_machine_check()+0x51: call to mce_gather_info() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x0: call to rcu_dynticks_task_trace_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0xe: call to rcu_dynticks_task_trace_exit() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_nmi_enter()+0x36: call to __kasan_check_read() leaves .noinstr.text section

Today, we added these:

vmlinux.o: warning: objtool: xen_irq_disable()+0xa: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_irq_enable()+0xb: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: check_preemption_disabled()+0x81: call to is_percpu_thread() leaves .noinstr.text section

and the rcu_nmi_enter one changed to:

vmlinux.o: warning: objtool: rcu_nmi_enter()+0x5d: call to __kasan_check_read() leaves .noinstr.text section

Signature · 2 lines
Cheers,
Stephen Rothwell
#5 lore raw

Hi all,

Quoted 14 lines · On Mon, 20 Sep 2021 11:38:09 +1000 Stephen Rothwell <[email protected]>…
Quoted 9 lines · On Fri, 17 Sep 2021 11:58:59 +1000 Stephen Rothwell <[email protected]>…

After merging the tip tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

vmlinux.o: warning: objtool: mce_setup()+0x22: call to memset() leaves .noinstr.text section
vmlinux.o: warning: objtool: do_machine_check()+0x51: call to mce_gather_info() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x0: call to rcu_dynticks_task_trace_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0xe: call to rcu_dynticks_task_trace_exit() leaves .noinstr.text section vmlinux.o: warning: objtool: rcu_nmi_enter()+0x36: call to __kasan_check_read() leaves .noinstr.text section

Today, we added these:

Quoted 7 lines

vmlinux.o: warning: objtool: xen_irq_disable()+0xa: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_irq_enable()+0xb: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: check_preemption_disabled()+0x81: call to is_percpu_thread() leaves .noinstr.text section

and the rcu_nmi_enter one changed to:

vmlinux.o: warning: objtool: rcu_nmi_enter()+0x5d: call to __kasan_check_read() leaves .noinstr.text section

Currently, I am getting these:

vmlinux.o: warning: objtool: xen_irq_disable()+0xa: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_irq_enable()+0xb: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: mce_setup()+0x22: call to memset() leaves .noinstr.text section vmlinux.o: warning: objtool: do_machine_check()+0x99: call to mce_gather_info() leaves .noinstr.text section

(the rcu ones are gone once I merge the rcu tree)

Signature · 2 lines
Cheers,
Stephen Rothwell
#6 lore raw
Quoted 2 lines · Stephen Rothwell

vmlinux.o: warning: objtool: xen_irq_disable()+0xa: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_irq_enable()+0xb: call to preempt_count_add() leaves .noinstr.text section

https://lkml.kernel.org/r/[email protected]

Juergen, where are we with those patches?

#7 lore raw
Quoted 8 lines · Peter Zijlstra
Quoted 2 lines · Stephen Rothwell

vmlinux.o: warning: objtool: xen_irq_disable()+0xa: call to preempt_count_add() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_irq_enable()+0xb: call to preempt_count_add() leaves .noinstr.text section

https://lkml.kernel.org/r/[email protected]

Juergen, where are we with those patches?

Queued for 5.16.

Juergen