Skip to content

Commit 4972808

Browse files
tlendackybp3tk0v
authored andcommitted
x86/sev: Require the RMPREAD instruction after Zen4
Limit usage of the non-architectural RMP format to Zen3/Zen4 processors. The RMPREAD instruction, with architectural defined output, is available and should be used for RMP access beyond Zen4. Signed-off-by: Tom Lendacky <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Nikunj A Dadhania <[email protected]> Reviewed-by: Neeraj Upadhyay <[email protected]> Reviewed-by: Ashish Kalra <[email protected]> Link: https://lore.kernel.org/r/5be0093e091778a151266ea853352f62f838eb99.1733172653.git.thomas.lendacky@amd.com
1 parent 0cbc025 commit 4972808

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,15 @@ static void bsp_determine_snp(struct cpuinfo_x86 *c)
355355
/*
356356
* RMP table entry format is not architectural and is defined by the
357357
* per-processor PPR. Restrict SNP support on the known CPU models
358-
* for which the RMP table entry format is currently defined for.
358+
* for which the RMP table entry format is currently defined or for
359+
* processors which support the architecturally defined RMPREAD
360+
* instruction.
359361
*/
360362
if (!cpu_has(c, X86_FEATURE_HYPERVISOR) &&
361-
c->x86 >= 0x19 && snp_probe_rmptable_info()) {
363+
(cpu_feature_enabled(X86_FEATURE_ZEN3) ||
364+
cpu_feature_enabled(X86_FEATURE_ZEN4) ||
365+
cpu_feature_enabled(X86_FEATURE_RMPREAD)) &&
366+
snp_probe_rmptable_info()) {
362367
cc_platform_set(CC_ATTR_HOST_SEV_SNP);
363368
} else {
364369
setup_clear_cpu_cap(X86_FEATURE_SEV_SNP);

0 commit comments

Comments
 (0)