Commit 4d839755 authored by Tom Lendacky's avatar Tom Lendacky Committed by Greg Kroah-Hartman

x86/CPU/AMD: Ensure clearing of SME/SEV features is maintained

commit a006483b upstream.

If the SME and SEV features are present via CPUID, but memory encryption
support is not enabled (MSR 0xC001_0010[23]), the feature flags are cleared
using clear_cpu_cap(). However, if get_cpu_cap() is later called, these
feature flags 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 flags is maintained.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org> # 4.16.x-
Link: https://lkml.kernel.org/r/226de90a703c3c0be5a49565047905ac4e94e8f3.1579125915.git.thomas.lendacky@amd.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7e22f494
...@@ -609,9 +609,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c) ...@@ -609,9 +609,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
return; return;
clear_all: clear_all:
clear_cpu_cap(c, X86_FEATURE_SME); setup_clear_cpu_cap(X86_FEATURE_SME);
clear_sev: clear_sev:
clear_cpu_cap(c, X86_FEATURE_SEV); setup_clear_cpu_cap(X86_FEATURE_SEV);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment