Skip to content

Commit edb3d07

Browse files
committed
x86/mce: Mark mce_timed_out() noinstr
Fixes vmlinux.o: warning: objtool: do_machine_check()+0x482: call to mce_timed_out() leaves .noinstr.text section Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 75581a2 commit edb3d07

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,13 @@ static cpumask_t mce_missing_cpus = CPU_MASK_ALL;
883883
/*
884884
* Check if a timeout waiting for other CPUs happened.
885885
*/
886-
static int mce_timed_out(u64 *t, const char *msg)
886+
static noinstr int mce_timed_out(u64 *t, const char *msg)
887887
{
888+
int ret = 0;
889+
890+
/* Enable instrumentation around calls to external facilities */
891+
instrumentation_begin();
892+
888893
/*
889894
* The others already did panic for some reason.
890895
* Bail out like in a timeout.
@@ -903,12 +908,17 @@ static int mce_timed_out(u64 *t, const char *msg)
903908
cpumask_pr_args(&mce_missing_cpus));
904909
mce_panic(msg, NULL, NULL);
905910
}
906-
return 1;
911+
ret = 1;
912+
goto out;
907913
}
908914
*t -= SPINUNIT;
915+
909916
out:
910917
touch_nmi_watchdog();
911-
return 0;
918+
919+
instrumentation_end();
920+
921+
return ret;
912922
}
913923

914924
/*

0 commit comments

Comments
 (0)