Skip to content

Commit 9a0b9bb

Browse files
bp3tk0vgregkh
authored andcommitted
x86/CPU/AMD: Properly check the TSA microcode
In order to simplify backports, I resorted to an older version of the microcode revision checking which didn't pull in the whole struct x86_cpu_id matching machinery. My simpler method, however, forgot to add the extended CPU model to the patch revision, which lead to mismatches when determining whether TSA mitigation support is present. So add that forgotten extended model. Also, fix a backport mismerge which put tsa_init() where it doesn't belong. This is a stable-only fix and the preference is to do it this way because it is a lot simpler. Also, the Fixes: tag below points to the respective stable patch. Fixes: 90293047df18 ("x86/bugs: Add a Transient Scheduler Attacks mitigation") Reported-by: Thomas Voegtle <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Message-ID: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dfc486e commit 9a0b9bb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ static bool amd_check_tsa_microcode(void)
561561

562562
p.ext_fam = c->x86 - 0xf;
563563
p.model = c->x86_model;
564+
p.ext_model = c->x86_model >> 4;
564565
p.stepping = c->x86_stepping;
565566

566567
if (c->x86 == 0x19) {
@@ -675,6 +676,8 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
675676
}
676677

677678
resctrl_cpu_detect(c);
679+
680+
tsa_init(c);
678681
}
679682

680683
static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
@@ -719,8 +722,6 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
719722
goto clear_sev;
720723

721724

722-
tsa_init(c);
723-
724725
return;
725726

726727
clear_all:

0 commit comments

Comments
 (0)