public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/cpufeatures: SGX: Adjust the error message when BIOS does not support SGX
@ 2024-07-30  2:49 WangYuli
  2024-07-30 11:57 ` Huang, Kai
  0 siblings, 1 reply; 7+ messages in thread
From: WangYuli @ 2024-07-30  2:49 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, hpa, wangyuli, seanjc, xiangzelong
  Cc: x86, linux-kernel, wubo, guanwentao, baimingcong

When SGX is not supported by the BIOS, we still output the error
'SGX disabled by BIOS', which can be confusing since there might not be
an SGX-related option in the BIOS settings.

As a kernel, it's difficult for us to distinguish between the BIOS not
supporting SGX and the BIOS supporting SGX but it's disabled.

Therefore, we should update the error message to
'SGX disabled or unsupported by BIOS' to make it easier for those reading
kernel logs to understand what's happening.

Reported-by: Bo Wu <wubo@uniontech.com>
Link: https://github.com/linuxdeepin/developer-center/issues/10032
Signed-off-by: Zelong Xiang <xiangzelong@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 arch/x86/kernel/cpu/feat_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/feat_ctl.c b/arch/x86/kernel/cpu/feat_ctl.c
index 1640ae76548f..4a4118784c13 100644
--- a/arch/x86/kernel/cpu/feat_ctl.c
+++ b/arch/x86/kernel/cpu/feat_ctl.c
@@ -188,7 +188,7 @@ void init_ia32_feat_ctl(struct cpuinfo_x86 *c)
 update_sgx:
 	if (!(msr & FEAT_CTL_SGX_ENABLED)) {
 		if (enable_sgx_kvm || enable_sgx_driver)
-			pr_err_once("SGX disabled by BIOS.\n");
+			pr_err_once("SGX disabled or unsupported by BIOS.\n");
 		clear_cpu_cap(c, X86_FEATURE_SGX);
 		return;
 	}
-- 
2.43.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-31 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30  2:49 [PATCH] x86/cpufeatures: SGX: Adjust the error message when BIOS does not support SGX WangYuli
2024-07-30 11:57 ` Huang, Kai
2024-07-30 17:56   ` Sean Christopherson
2024-07-30 22:48     ` Huang, Kai
2024-07-31  3:58       ` WangYuli
2024-07-31  3:22   ` WangYuli
2024-07-31 12:20     ` Huang, Kai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox