Re: [PATCH v4 2/9] stop_machine: Add NMI-based execution path

From: Chang S. Bae

Date: Mon Nov 09 2026 - 22:11:54 EST


On 11/9/2026 6:46 PM, Borislav Petkov wrote:
On Wed, Nov 04, 2026 at 06:23:15PM +0000, Chang S. Bae wrote:
+/*
+ * Instrumentation may trigger nested exceptions such as #INT3, #DB,
+ * or #PF. IRET from those would re-enable NMIs, which opposes the goal
+ * of this NMI stop-machine facility.
+ */
+bool noinstr stop_machine_nmi_handler(void)

stop_machine_nmi()

+{
+ struct multi_stop_data *msdata = raw_cpu_read(nmi_stop.data);
+ unsigned int cpu = raw_smp_processor_id();
+ int ret;
+
+ if (!msdata || !arch_test_and_clear_bit(cpu, cpumask_bits(msdata->nmi_cpus)))
+ return false;
+
+ /*
+ * The indirect call to @nmisafe_fn() is indistinguishable at
+ * post-compilation. Temporarily enabling instrumentation avoids
+ * objtool false positives.
+ */
+ instrumentation_begin();
+ ret = msdata->nmisafe_fn(msdata->data);
+ instrumentation_end();

This is just silly. We should fix objtool here.

Here is your previous thought:

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

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

function pointer which objtool can't see through.

https://lore.kernel.org/lkml/20260127144947.GKaXjQi8R9cE17WYKM@fat_crate.local/