Skip to content

Commit de360d9

Browse files
suryasaimadhugregkh
authored andcommitted
x86/mce: Allow instrumentation during task work queueing
[ Upstream commit 4fbce46 ] Fixes vmlinux.o: warning: objtool: do_machine_check()+0xdb1: call to queue_task_work() leaves .noinstr.text section Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/20211208111343.8130-6-bp@alien8.de Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent af371e0 commit de360d9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,14 @@ noinstr void do_machine_check(struct pt_regs *regs)
14431443
if (worst != MCE_AR_SEVERITY && !kill_it)
14441444
goto out;
14451445

1446+
/*
1447+
* Enable instrumentation around the external facilities like
1448+
* task_work_add() (via queue_task_work()), fixup_exception() etc.
1449+
* For now, that is. Fixing this properly would need a lot more involved
1450+
* reorganization.
1451+
*/
1452+
instrumentation_begin();
1453+
14461454
/* Fault was in user mode and we need to take some action */
14471455
if ((m.cs & 3) == 3) {
14481456
/* If this triggers there is no way to recover. Die hard. */
@@ -1468,6 +1476,9 @@ noinstr void do_machine_check(struct pt_regs *regs)
14681476
if (m.kflags & MCE_IN_KERNEL_COPYIN)
14691477
queue_task_work(&m, msg, kill_it);
14701478
}
1479+
1480+
instrumentation_end();
1481+
14711482
out:
14721483
mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);
14731484
}

0 commit comments

Comments
 (0)