mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Bingsong Si" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Bingsong Si <sibs@chinatelecom.cn>,
	Ingo Molnar <mingo@kernel.org>,
	"Huang, Kai" <kai.huang@intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/cpu] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS
Date: Tue, 26 Mar 2024 08:56:04 -0000	[thread overview]
Message-ID: <171144336418.10875.2002917635921003194.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240311071938.13247-1-sibs@chinatelecom.cn>

The following commit has been merged into the x86/cpu branch of tip:

Commit-ID:     cd2236c2f49eb46443fd7573d0ddad5373577b11
Gitweb:        https://git.kernel.org/tip/cd2236c2f49eb46443fd7573d0ddad5373577b11
Author:        Bingsong Si <sibs@chinatelecom.cn>
AuthorDate:    Mon, 11 Mar 2024 15:19:37 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 26 Mar 2024 09:49:32 +01:00

x86/cpu: Clear TME feature flag if TME is not enabled by BIOS

When TME is disabled by BIOS, the dmesg output is:

  x86/tme: not enabled by BIOS

... and TME functionality is not enabled by the kernel, but the TME feature
is still shown in /proc/cpuinfo.

Clear it.

[ mingo: Clarified changelog ]

Signed-off-by: Bingsong Si <sibs@chinatelecom.cn>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: "Huang, Kai" <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20240311071938.13247-1-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 be30d7f..3c3e7e5 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -228,6 +228,7 @@ static void detect_tme_early(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;
 	}
 

      reply	other threads:[~2024-03-26  8:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 12:27 [PATCH] " Bingsong Si
2024-03-11  6:13 ` Huang, Kai
2024-03-12 10:35   ` [PATCH v3] " Bingsong Si
2024-03-11  7:19 ` [PATCH v2] " Bingsong Si
2024-03-26  8:56   ` tip-bot2 for Bingsong Si [this message]

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=171144336418.10875.2002917635921003194.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=kai.huang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sibs@chinatelecom.cn \
    --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®