All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Kai Huang <kai.huang@intel.com>
Cc: linux-sgx@vger.kernel.org, dave.hansen@linux.intel.com,
	seanjc@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/intel: Clear SGX bit if both SGX driver and KVM SGX are not enabled
Date: Mon, 12 Sep 2022 13:47:40 +0300	[thread overview]
Message-ID: <Yx8OTDwhqbgvGp4p@kernel.org> (raw)
In-Reply-To: <20220909080853.547058-1-kai.huang@intel.com>

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@intel.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

  parent reply	other threads:[~2022-09-12 10:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09  8:08 [PATCH] x86/intel: Clear SGX bit if both SGX driver and KVM SGX are not enabled Kai Huang
2022-09-09 11:05 ` Huang, Kai
2022-09-09 12:11 ` Dave Hansen
2022-09-12  3:09   ` Huang, Kai
2022-09-12 10:47 ` Jarkko Sakkinen [this message]
2022-09-12 14:31   ` Reinette Chatre
2022-09-12 14:34     ` Dave Hansen
2022-09-12 20:54       ` 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=Yx8OTDwhqbgvGp4p@kernel.org \
    --to=jarkko@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=kai.huang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=seanjc@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.