Skip to content

Commit a006483

Browse files
tlendackysuryasaimadhu
authored andcommitted
x86/CPU/AMD: Ensure clearing of SME/SEV features is maintained
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: Tom Lendacky <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: <[email protected]> # 4.16.x- Link: https://lkml.kernel.org/r/226de90a703c3c0be5a49565047905ac4e94e8f3.1579125915.git.thomas.lendacky@amd.com
1 parent ab6a211 commit a006483

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
615615
return;
616616

617617
clear_all:
618-
clear_cpu_cap(c, X86_FEATURE_SME);
618+
setup_clear_cpu_cap(X86_FEATURE_SME);
619619
clear_sev:
620-
clear_cpu_cap(c, X86_FEATURE_SEV);
620+
setup_clear_cpu_cap(X86_FEATURE_SEV);
621621
}
622622
}
623623

0 commit comments

Comments
 (0)