All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>,
	Borislav Petkov <bp@alien8.de>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>
Cc: Kees Cook <keescook@chromium.org>,
	hughsient@gmail.com,
	Martin Fernandez <martin.fernandez@eclypsium.com>,
	linux-kernel@vger.kernel.org,
	Brijesh Singh <brijesh.singh@amd.com>
Subject: Re: [PATCH v2 3/4] x86/cpu: clear SME features when not in use
Date: Fri, 11 Feb 2022 15:17:16 -0600	[thread overview]
Message-ID: <56dbbd52-93bd-2c70-3862-3b62231a4024@amd.com> (raw)
In-Reply-To: <20220211210255.9820-4-mario.limonciello@amd.com>

On 2/11/22 15:02, Mario Limonciello wrote:
> Currently the SME CPU feature flag is reflective of whether the CPU
> supports the features but not whether they have been activated by the
> kernel.
> 
> Change this around to clear the features if the kernel is not using
> them so userspace can determine if they are available and in use
> from `/proc/cpuinfo`.
> 
> As the feature flag is now cleared on systems that SME isn't active
> use CPUID 0x8000001f to confirm SME availability before calling
> `native_wbinvd`.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---

>   
> +		if (!sme_me_mask)
> +			goto clear_all;
> +

This is incorrect. Just because host memory encryption is not active 
doesn't mean that SEV guests can't be run. This should only clear the SME 
feature bit.

Thanks,
Tom

  reply	other threads:[~2022-02-11 21:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 21:02 [PATCH v2 0/4] Only export SME/SEV/SEV_ES features when activated Mario Limonciello
2022-02-11 21:02 ` [PATCH v2 1/4] crypto: ccp: Use cc_platform_has to determine SEV presence Mario Limonciello
2022-02-11 21:02 ` [PATCH v2 2/4] KVM: SVM: Use cc_platform_has instead of CPU feature flags Mario Limonciello
2022-02-11 21:02 ` [PATCH v2 3/4] x86/cpu: clear SME features when not in use Mario Limonciello
2022-02-11 21:17   ` Tom Lendacky [this message]
2022-02-11 21:02 ` [PATCH v2 4/4] x86/cpu: clear SEV/SEV_ES " Mario Limonciello
2022-02-11 21:13 ` [PATCH v2 0/4] Only export SME/SEV/SEV_ES features when activated Tom Lendacky

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=56dbbd52-93bd-2c70-3862-3b62231a4024@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=hughsient@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=martin.fernandez@eclypsium.com \
    --cc=x86@kernel.org \
    /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.