From: Borislav Petkov <bp@alien8.de>
To: Tony Luck <tony.luck@intel.com>
Cc: X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v0 11/12] x86/mce: Mark mce_timed_out() noinstr
Date: Thu, 4 Nov 2021 15:40:34 +0100 [thread overview]
Message-ID: <20211104144035.20107-12-bp@alien8.de> (raw)
In-Reply-To: <20211104144035.20107-1-bp@alien8.de>
From: Borislav Petkov <bp@suse.de>
Fixes
vmlinux.o: warning: objtool: do_machine_check()+0x482: call to mce_timed_out() leaves .noinstr.text section
Signed-off-by: Borislav Petkov <bp@suse.de>
---
arch/x86/kernel/cpu/mce/core.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 961f80a4bd6f..bc97db90ac0a 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -878,8 +878,12 @@ 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;
+
+ instrumentation_begin();
+
/*
* The others already did panic for some reason.
* Bail out like in a timeout.
@@ -899,12 +903,17 @@ static int mce_timed_out(u64 *t, const char *msg)
mce_panic(msg, NULL, NULL);
}
cpu_missing = 1;
- return 1;
+ ret = 1;
+ goto out;
}
*t -= SPINUNIT;
+
out:
touch_nmi_watchdog();
- return 0;
+
+ instrumentation_end();
+
+ return ret;
}
/*
--
2.29.2
next prev parent reply other threads:[~2021-11-04 14:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 14:40 [PATCH v0 00/12] x86/mce: Correct the noinstr annotation Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 01/12] x86/mce: Do not use memset to clear the banks bitmaps Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 02/12] x86/mce: Remove function-local cpus variables Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 03/12] x86/mce: Use mce_rdmsrl() in severity checking code Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 04/12] x86/mce: Remove noinstr annotation from mce_setup() Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 05/12] x86/mce: Allow instrumentation during task work queueing Borislav Petkov
2021-11-09 22:05 ` Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 06/12] x86/mce: Prevent severity computation from being instrumented Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 07/12] x86/mce: Mark mce_panic() noinstr Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 08/12] x86/mce: Mark mce_end() noinstr Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 09/12] x86/mce: Mark mce_read_aux() noinstr Borislav Petkov
2021-11-04 14:40 ` [PATCH v0 10/12] x86/mce: Move the tainting outside of the noinstr region Borislav Petkov
2021-11-04 14:40 ` Borislav Petkov [this message]
2021-11-04 14:40 ` [PATCH v0 12/12] x86/mce: Mark mce_start() noinstr Borislav Petkov
2021-11-09 22:08 ` [PATCH v0 00/12] x86/mce: Correct the noinstr annotation Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211104144035.20107-12-bp@alien8.de \
--to=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox