All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bingsong Si <sibs@chinatelecom.cn>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: Bingsong Si <sibs@chinatelecom.cn>, linux-kernel@vger.kernel.org
Subject: [PATCH v2] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS
Date: Mon, 11 Mar 2024 15:19:37 +0800	[thread overview]
Message-ID: <20240311071938.13247-1-sibs@chinatelecom.cn> (raw)
In-Reply-To: <20240308122752.3342-1-sibs@chinatelecom.cn>

When TME is disabled by BIOS, dmesg output is "x86/mktme: enabled by
BIOS" but the TME feature is still shown in the output of/proc/cpuinfo.

Signed-off-by: Bingsong Si <sibs@chinatelecom.cn>
---
 arch/x86/kernel/cpu/intel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index a927a8fc9624..22f0c829784d 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -526,6 +526,7 @@ 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");
 		mktme_status = MKTME_DISABLED;
+		clear_cpu_cap(c, X86_FEATURE_TME);
 		return;
 	}
 
-- 
2.34.1


  parent reply	other threads:[~2024-03-11  7:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 12:27 [PATCH] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS Bingsong Si
2024-03-11  6:13 ` Huang, Kai
2024-03-12 10:35   ` [PATCH v3] " Bingsong Si
2024-03-11  7:19 ` Bingsong Si [this message]
2024-03-26  8:56   ` [tip: x86/cpu] " tip-bot2 for Bingsong Si

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=20240311071938.13247-1-sibs@chinatelecom.cn \
    --to=sibs@chinatelecom.cn \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.