Re: [PATCH 1/7] stop_machine: Introduce stop_machine_nmi()

From: Borislav Petkov

Date: Tue Jan 27 2026 - 10:04:49 EST


On Mon, Jan 26, 2026 at 07:51:11PM +0800, kernel test robot wrote:
> Hi Chang,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on 24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Chang-S-Bae/stop_machine-Introduce-stop_machine_nmi/20260125-101013
> base: 24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7
> patch link: https://lore.kernel.org/r/20260125014224.249901-2-chang.seok.bae%40intel.com
> patch subject: [PATCH 1/7] stop_machine: Introduce stop_machine_nmi()
> config: x86_64-randconfig-r133-20260126 (https://download.01.org/0day-ci/archive/20260126/202601261901.Yj2kmvgI-lkp@xxxxxxxxx/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260126/202601261901.Yj2kmvgI-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202601261901.Yj2kmvgI-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> >> vmlinux.o: error: objtool: stop_machine_nmi_handler+0x23: call to {dynamic}() leaves .noinstr.text section

This one would be hard to fix because that's the

err = msdata->fn(msdata->data);

function pointer which objtool can't see through.

So my suggestion would be to do:

struct nmi_multi_stop_data {
cpu_stop_safe_fn_t fn;

note the different function pointer type which we will hopefully catch during
review in the sense that only *safe* functions should be callable by the
NMI-specific stomp_machine.

Along with:

diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 189b4b108d13..55a350048d4c 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -230,7 +230,9 @@ bool noinstr stop_machine_nmi_handler(void)
raw_cpu_write(stop_machine_nmi_ctrl.nmi_enabled, false);

msdata = raw_cpu_read(stop_machine_nmi_ctrl.msdata);
+ instrumentation_begin();
err = msdata->fn(msdata->data);
+ instrumentation_end();
raw_cpu_write(stop_machine_nmi_ctrl.err, err);
return true;
}

ofc.

Unless someone has a better idea ofc...

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette