Skip to content

Commit 4fbce46

Browse files
committed
x86/mce: Allow instrumentation during task work queueing
Fixes vmlinux.o: warning: objtool: do_machine_check()+0xdb1: call to queue_task_work() leaves .noinstr.text section Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 487d654 commit 4fbce46

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

arch/x86/kernel/cpu/mce/core.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,14 @@ noinstr void do_machine_check(struct pt_regs *regs)
14591459
if (worst != MCE_AR_SEVERITY && !kill_current_task)
14601460
goto out;
14611461

1462+
/*
1463+
* Enable instrumentation around the external facilities like
1464+
* task_work_add() (via queue_task_work()), fixup_exception() etc.
1465+
* For now, that is. Fixing this properly would need a lot more involved
1466+
* reorganization.
1467+
*/
1468+
instrumentation_begin();
1469+
14621470
/* Fault was in user mode and we need to take some action */
14631471
if ((m.cs & 3) == 3) {
14641472
/* If this triggers there is no way to recover. Die hard. */
@@ -1487,6 +1495,9 @@ noinstr void do_machine_check(struct pt_regs *regs)
14871495
if (m.kflags & MCE_IN_KERNEL_COPYIN)
14881496
queue_task_work(&m, msg, kill_me_never);
14891497
}
1498+
1499+
instrumentation_end();
1500+
14901501
out:
14911502
mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);
14921503
}

0 commit comments

Comments
 (0)