From: Borislav Petkov <bp@alien8.de>
To: X86 ML <x86@kernel.org>
Cc: Tony Luck <tony.luck@intel.com>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] x86/microcode: Taint and warn on late loading
Date: Wed, 25 May 2022 18:12:31 +0200 [thread overview]
Message-ID: <20220525161232.14924-4-bp@alien8.de> (raw)
In-Reply-To: <20220525161232.14924-1-bp@alien8.de>
From: Borislav Petkov <bp@suse.de>
Warn before it is attempted and taint the kernel.
Signed-off-by: Borislav Petkov <bp@suse.de>
---
arch/x86/kernel/cpu/microcode/core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index c717db6b6856..801b44ac3851 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -493,6 +493,9 @@ static int microcode_reload_late(void)
{
int ret;
+ pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
+ pr_err("You should switch to early loading, if possible.\n");
+
atomic_set(&late_cpus_in, 0);
atomic_set(&late_cpus_out, 0);
@@ -541,6 +544,8 @@ static ssize_t reload_store(struct device *dev,
if (ret == 0)
ret = size;
+ add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+
return ret;
}
--
2.35.1
next prev parent reply other threads:[~2022-05-25 16:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 16:12 [PATCH 0/4] x86/microcode: Drop old interface and default-disable " Borislav Petkov
2022-05-25 16:12 ` [PATCH 1/4] x86/microcode: Rip out the OLD_INTERFACE Borislav Petkov
2022-05-31 7:34 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov
2022-05-25 16:12 ` [PATCH 2/4] x86/microcode: Default-disable late loading Borislav Petkov
2022-05-31 7:34 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov
2022-05-25 16:12 ` Borislav Petkov [this message]
2022-05-31 7:34 ` [tip: x86/microcode] x86/microcode: Taint and warn on " tip-bot2 for Borislav Petkov
2022-05-25 16:12 ` [PATCH 4/4] x86/microcode: Remove unnecessary perf callback Borislav Petkov
2022-05-31 7:34 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov
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=20220525161232.14924-4-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
all inboxes | Powered by JetHome®