* [PATCH] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS
@ 2024-03-08 12:27 Bingsong Si
2024-03-11 6:13 ` Huang, Kai
2024-03-11 7:19 ` [PATCH v2] " Bingsong Si
0 siblings, 2 replies; 5+ messages in thread
From: Bingsong Si @ 2024-03-08 12:27 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin
Cc: Bingsong Si, linux-kernel
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS
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 ` [PATCH v2] " Bingsong Si
1 sibling, 1 reply; 5+ messages in thread
From: Huang, Kai @ 2024-03-11 6:13 UTC (permalink / raw)
To: tglx, x86, mingo, hpa, sibs, bp, dave.hansen; +Cc: linux-kernel
On Fri, 2024-03-08 at 20:27 +0800, Bingsong Si wrote:
> Signed-off-by: Bingsong Si <sibs@chinatelecom.cn>
Please add changelog to justify this patch. Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS
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-11 7:19 ` Bingsong Si
2024-03-26 8:56 ` [tip: x86/cpu] " tip-bot2 for Bingsong Si
1 sibling, 1 reply; 5+ messages in thread
From: Bingsong Si @ 2024-03-11 7:19 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin
Cc: Bingsong Si, linux-kernel
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS
2024-03-11 6:13 ` Huang, Kai
@ 2024-03-12 10:35 ` Bingsong Si
0 siblings, 0 replies; 5+ messages in thread
From: Bingsong Si @ 2024-03-12 10:35 UTC (permalink / raw)
To: kai.huang, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin
Cc: linux-kernel, sibs
When TME is disabled by BIOS, dmesg output is "x86/tme: not 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 40dec9b56f87..119ae291573b 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;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [tip: x86/cpu] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS
2024-03-11 7:19 ` [PATCH v2] " Bingsong Si
@ 2024-03-26 8:56 ` tip-bot2 for Bingsong Si
0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Bingsong Si @ 2024-03-26 8:56 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Bingsong Si, Ingo Molnar, Huang, Kai, x86, linux-kernel
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;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-03-26 8:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v2] " Bingsong Si
2024-03-26 8:56 ` [tip: x86/cpu] " tip-bot2 for Bingsong Si
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).