From: Joerg Roedel <joro@8bytes.org>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Brijesh Singh <brijesh.singh@amd.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] x86/CPU/AMD: Ensure clearing of SME/SEV features is maintained
Date: Fri, 17 Jan 2020 14:00:47 +0100 [thread overview]
Message-ID: <20200117130047.GA3685@8bytes.org> (raw)
In-Reply-To: <226de90a703c3c0be5a49565047905ac4e94e8f3.1579125915.git.thomas.lendacky@amd.com>
On Wed, Jan 15, 2020 at 04:05:16PM -0600, Tom Lendacky wrote:
> If the SME and SEV features are present via CPUID, but memory encryption
> support is not enabled (MSR 0xC001_0010[23]), the features are cleared
> using clear_cpu_cap(). However, if get_cpu_cap() is later called, these
> features will be reset back to present, which is not desired.
>
> Change from using clear_cpu_cap() to setup_clear_cpu_cap() so that the
> clearing of the features is maintained.
>
> Cc: <stable@vger.kernel.org> # 4.16.x-
> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
> ---
> arch/x86/kernel/cpu/amd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index 90f75e515876..62c30279be77 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -615,9 +615,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
> return;
>
> clear_all:
> - clear_cpu_cap(c, X86_FEATURE_SME);
> + setup_clear_cpu_cap(X86_FEATURE_SME);
> clear_sev:
> - clear_cpu_cap(c, X86_FEATURE_SEV);
> + setup_clear_cpu_cap(X86_FEATURE_SEV);
> }
> }
>
> --
> 2.17.1
prev parent reply other threads:[~2020-01-17 13:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 22:05 [PATCH] x86/CPU/AMD: Ensure clearing of SME/SEV features is maintained Tom Lendacky
2020-01-17 13:00 ` Joerg Roedel [this message]
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=20200117130047.GA3685@8bytes.org \
--to=joro@8bytes.org \
--cc=bp@alien8.de \
--cc=brijesh.singh@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.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.