提交 696cc432 编写于 作者: B Borislav Petkov 提交者: Zheng Zengkai

x86/mce: Allow instrumentation during task work queueing

stable inclusion
from stable-v5.10.94
commit de360d94438688fd29e548a79abb9ee6ecd4de0f
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=de360d94438688fd29e548a79abb9ee6ecd4de0f

--------------------------------

[ Upstream commit 4fbce464 ]

Fixes

  vmlinux.o: warning: objtool: do_machine_check()+0xdb1: call to queue_task_work() leaves .noinstr.text section
Signed-off-by: NBorislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20211208111343.8130-6-bp@alien8.deSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 940d4713
...@@ -1447,6 +1447,14 @@ noinstr void do_machine_check(struct pt_regs *regs) ...@@ -1447,6 +1447,14 @@ noinstr void do_machine_check(struct pt_regs *regs)
if (worst != MCE_AR_SEVERITY && !kill_it) if (worst != MCE_AR_SEVERITY && !kill_it)
goto out; goto out;
/*
* Enable instrumentation around the external facilities like
* task_work_add() (via queue_task_work()), fixup_exception() etc.
* For now, that is. Fixing this properly would need a lot more involved
* reorganization.
*/
instrumentation_begin();
/* Fault was in user mode and we need to take some action */ /* Fault was in user mode and we need to take some action */
if ((m.cs & 3) == 3) { if ((m.cs & 3) == 3) {
/* If this triggers there is no way to recover. Die hard. */ /* If this triggers there is no way to recover. Die hard. */
...@@ -1472,6 +1480,9 @@ noinstr void do_machine_check(struct pt_regs *regs) ...@@ -1472,6 +1480,9 @@ noinstr void do_machine_check(struct pt_regs *regs)
if (m.kflags & MCE_IN_KERNEL_COPYIN) if (m.kflags & MCE_IN_KERNEL_COPYIN)
queue_task_work(&m, msg, kill_it); queue_task_work(&m, msg, kill_it);
} }
instrumentation_end();
out: out:
mce_wrmsrl(MSR_IA32_MCG_STATUS, 0); mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册