Skip to content

Commit

Permalink
x86/mce: Mark mce_timed_out() noinstr
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
suryasaimadhu committed Dec 13, 2021
1 parent 75581a2 commit edb3d07
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions arch/x86/kernel/cpu/mce/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,13 @@ static cpumask_t mce_missing_cpus = CPU_MASK_ALL;
/*
* Check if a timeout waiting for other CPUs happened.
*/
static int mce_timed_out(u64 *t, const char *msg)
static noinstr int mce_timed_out(u64 *t, const char *msg)
{
int ret = 0;

/* Enable instrumentation around calls to external facilities */
instrumentation_begin();

/*
* The others already did panic for some reason.
* Bail out like in a timeout.
Expand All @@ -903,12 +908,17 @@ static int mce_timed_out(u64 *t, const char *msg)
cpumask_pr_args(&mce_missing_cpus));
mce_panic(msg, NULL, NULL);
}
return 1;
ret = 1;
goto out;
}
*t -= SPINUNIT;

out:
touch_nmi_watchdog();
return 0;

instrumentation_end();

return ret;
}

/*
Expand Down

0 comments on commit edb3d07

Please sign in to comment.