Skip to content

Commit b481353

Browse files
committed
x86/mce: Mark mce_end() noinstr
It is called by the #MC handler which is noinstr. Fixes vmlinux.o: warning: objtool: do_machine_check()+0xbd6: call to memset() leaves .noinstr.text section Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3c7ce80 commit b481353

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,10 +1064,13 @@ static int mce_start(int *no_way_out)
10641064
* Synchronize between CPUs after main scanning loop.
10651065
* This invokes the bulk of the Monarch processing.
10661066
*/
1067-
static int mce_end(int order)
1067+
static noinstr int mce_end(int order)
10681068
{
1069-
int ret = -1;
10701069
u64 timeout = (u64)mca_cfg.monarch_timeout * NSEC_PER_USEC;
1070+
int ret = -1;
1071+
1072+
/* Allow instrumentation around external facilities. */
1073+
instrumentation_begin();
10711074

10721075
if (!timeout)
10731076
goto reset;
@@ -1108,7 +1111,8 @@ static int mce_end(int order)
11081111
/*
11091112
* Don't reset anything. That's done by the Monarch.
11101113
*/
1111-
return 0;
1114+
ret = 0;
1115+
goto out;
11121116
}
11131117

11141118
/*
@@ -1124,6 +1128,10 @@ static int mce_end(int order)
11241128
* Let others run again.
11251129
*/
11261130
atomic_set(&mce_executing, 0);
1131+
1132+
out:
1133+
instrumentation_end();
1134+
11271135
return ret;
11281136
}
11291137

0 commit comments

Comments
 (0)