[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yx8OTDwhqbgvGp4p@kernel.org>
Date: Mon, 12 Sep 2022 13:47:40 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Kai Huang <kai.huang@...el.com>
Cc: linux-sgx@...r.kernel.org, dave.hansen@...ux.intel.com,
seanjc@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/intel: Clear SGX bit if both SGX driver and KVM SGX
are not enabled
On Fri, Sep 09, 2022 at 08:08:53PM +1200, Kai Huang wrote:
> Currently on platform which has SGX enabled, if CONFIG_X86_SGX is not
> enabled, the X86_FEATURE_SGX is not cleared, resulting in /proc/cpuinfo
> shows "sgx" feature. This is not desired.
>
> Clear SGX feature bit if both SGX driver and KVM SGX are not enabled in
> init_ia32_feat_ctl().
>
> Signed-off-by: Kai Huang <kai.huang@...el.com>
Is it a pattern that flags are cleared when they are disabled by the
kernel? I don't know the answer for this.
I could imagine that sometimes you might want to know whether the CPU
supports a feature, even if e.g. your distribution kernel does not.
There's of course other ways to answer such qeustion, e.g. by using
cpuid utility.
BR, Jarkko
Powered by blists - more mailing lists