mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "seanjc@google.com" <seanjc@google.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"wangyuli@uniontech.com" <wangyuli@uniontech.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"xiangzelong@uniontech.com" <xiangzelong@uniontech.com>
Cc: "baimingcong@uniontech.com" <baimingcong@uniontech.com>,
	"linux-sgx@vger.kernel.org" <linux-sgx@vger.kernel.org>,
	"jarkko@kernel.org" <jarkko@kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"guanwentao@uniontech.com" <guanwentao@uniontech.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"haitao.huang@linux.intel.com" <haitao.huang@linux.intel.com>,
	"wubo@uniontech.com" <wubo@uniontech.com>
Subject: Re: [PATCH] x86/cpufeatures: SGX: Adjust the error message when BIOS does not support SGX
Date: Tue, 30 Jul 2024 11:57:39 +0000	[thread overview]
Message-ID: <a56bc12f6c60107c935db31d7330d28980ac4d5a.camel@intel.com> (raw)
In-Reply-To: <D345627B0A699F37+20240730024931.1026933-1-wangyuli@uniontech.com>

On Tue, 2024-07-30 at 10:49 +0800, WangYuli wrote:
> 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.

+linux-sgx list, Jarkko, Haitao.

This message is only printed when SGX is reported in CPUID but is not
enabled in the FEAT_CTL MSR.  I can only recall this can happen when the
BIOS actually provides an option for the user to turn on/off SGX, in
which case the current message is correct.

I could be wrong, but I don't recall I have met any machine that doesn't
have any SGX option in the BIOS but still reports SGX in the CPUID.  Can
you confirm this is the case?  

I don't see this is mentioned in the github link below which reports this
issue.  In fact, it says:

	非bug,主板bios关闭了SGX,正常内核提醒

.. which is

	Not bug, the motherboard BIOS disabled SGX, normal kernel
message

And the link also shows this issue is "closed".

Please clarify.

> 
> 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;
>  	}


  reply	other threads:[~2024-07-30 11:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30  2:49 WangYuli
2024-07-30 11:57 ` Huang, Kai [this message]
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

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=a56bc12f6c60107c935db31d7330d28980ac4d5a.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=baimingcong@uniontech.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=guanwentao@uniontech.com \
    --cc=haitao.huang@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jarkko@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=wangyuli@uniontech.com \
    --cc=wubo@uniontech.com \
    --cc=x86@kernel.org \
    --cc=xiangzelong@uniontech.com \
    /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®