Skip to content

Commit f3f3251

Browse files
committed
x86/cpu: Move AMD erratum 1386 table over to 'x86_cpu_id'
The AMD erratum 1386 detection code uses and old style 'x86_cpu_desc' table. Replace it with 'x86_cpu_id' so the old style can be removed. I did not create a new helper macro here. The new table is certainly more noisy than the old and it can be improved on. But I was hesitant to create a new macro just for a single site that is only two ugly lines in the end. Signed-off-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/all/20241213185132.07555E1D%40davehans-spike.ostc.intel.com
1 parent 3fa5626 commit f3f3251

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,9 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
795795
clear_rdrand_cpuid_bit(c);
796796
}
797797

798-
static const struct x86_cpu_desc erratum_1386_microcode[] = {
799-
AMD_CPU_DESC(0x17, 0x1, 0x2, 0x0800126e),
800-
AMD_CPU_DESC(0x17, 0x31, 0x0, 0x08301052),
801-
{},
798+
static const struct x86_cpu_id erratum_1386_microcode[] = {
799+
X86_MATCH_VFM_STEPS(VFM_MAKE(X86_VENDOR_AMD, 0x17, 0x01), 0x2, 0x2, 0x0800126e),
800+
X86_MATCH_VFM_STEPS(VFM_MAKE(X86_VENDOR_AMD, 0x17, 0x31), 0x0, 0x0, 0x08301052),
802801
};
803802

804803
static void fix_erratum_1386(struct cpuinfo_x86 *c)
@@ -814,7 +813,7 @@ static void fix_erratum_1386(struct cpuinfo_x86 *c)
814813
* Clear the feature flag only on microcode revisions which
815814
* don't have the fix.
816815
*/
817-
if (x86_cpu_has_min_microcode_rev(erratum_1386_microcode))
816+
if (x86_match_min_microcode_rev(erratum_1386_microcode))
818817
return;
819818

820819
clear_cpu_cap(c, X86_FEATURE_XSAVES);

0 commit comments

Comments
 (0)