From: Martin Fernandez <martin.fernandez@eclypsium.com>
To: linux-kernel@vger.kernel.org
Cc: bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
mingo@redhat.com, tglx@linutronix.de,
daniel.gutson@eclypsium.com, hughsient@gmail.com,
alex.bazhaniuk@eclypsium.com,
Martin Fernandez <martin.fernandez@eclypsium.com>
Subject: [PATCH] x86/cpuinfo: Clear X86_FEATURE_TME if TME/MKTME is disabled by BIOS
Date: Tue, 14 Jun 2022 18:02:17 -0300 [thread overview]
Message-ID: <20220614210217.1940563-1-martin.fernandez@eclypsium.com> (raw)
Right now the only way to check this is by greping the kernel logs,
which is inconvinient. This is currently checked for fwupd for
example.
I understand that cpuinfo is supposed to report every feature in the
cpu but since AMD is doing the same for sme/sev I think is good to
have this for Intel too.
Signed-off-by: Martin Fernandez <martin.fernandez@eclypsium.com>
---
arch/x86/kernel/cpu/intel.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index fd5dead8371c..7311172aceaf 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -570,6 +570,8 @@ static void detect_tme(struct cpuinfo_x86 *c)
if (!TME_ACTIVATE_LOCKED(tme_activate) || !TME_ACTIVATE_ENABLED(tme_activate)) {
pr_info_once("x86/tme: not enabled by BIOS\n");
+ if (mktme_status == MKTME_UNINITIALIZED)
+ clear_cpu_cap(c, X86_FEATURE_TME);
mktme_status = MKTME_DISABLED;
return;
}
--
2.30.2
next reply other threads:[~2022-06-14 21:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 21:02 Martin Fernandez [this message]
2022-06-14 21:05 ` Richard Hughes
2022-06-15 19:05 ` Alison Schofield
2022-06-15 19:34 ` Richard Hughes
2022-06-15 19:54 ` Alison Schofield
2022-06-15 20:26 ` Daniel Gutson
2022-06-15 20:48 ` Martin Fernandez
2022-06-15 20:59 ` Alison Schofield
2022-06-16 2:10 ` Kai Huang
2022-06-16 14:23 ` Martin Fernandez
2022-07-04 14:20 Martin Fernandez
2022-07-04 14:22 ` Martin Fernandez
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=20220614210217.1940563-1-martin.fernandez@eclypsium.com \
--to=martin.fernandez@eclypsium.com \
--cc=alex.bazhaniuk@eclypsium.com \
--cc=bp@alien8.de \
--cc=daniel.gutson@eclypsium.com \
--cc=dave.hansen@linux.intel.com \
--cc=hughsient@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--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®