Skip to content

Commit 0f74d9c

Browse files
committed
Merge tag 'x86_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Fix the GDS mitigation detection on some machines after the recent attack vectors conversion - Filter out the invalid machine reset reason value -1 when running as a guest as in such cases the reason why the machine was rebooted does not make a whole lot of sense - Init the resource control machinery on Hygon hw in order to avoid a division by zero and to actually enable the feature on hw which supports it * tag 'x86_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/bugs: Fix GDS mitigation selecting when mitigation is off x86/CPU/AMD: Ignore invalid reset reason value x86/cpu/hygon: Add missing resctrl_cpu_detect() in bsp_init helper
2 parents a69dfb4 + d4932a1 commit 0f74d9c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,8 +1326,8 @@ static const char * const s5_reset_reason_txt[] = {
13261326

13271327
static __init int print_s5_reset_status_mmio(void)
13281328
{
1329-
unsigned long value;
13301329
void __iomem *addr;
1330+
u32 value;
13311331
int i;
13321332

13331333
if (!cpu_feature_enabled(X86_FEATURE_ZEN))
@@ -1340,12 +1340,16 @@ static __init int print_s5_reset_status_mmio(void)
13401340
value = ioread32(addr);
13411341
iounmap(addr);
13421342

1343+
/* Value with "all bits set" is an error response and should be ignored. */
1344+
if (value == U32_MAX)
1345+
return 0;
1346+
13431347
for (i = 0; i < ARRAY_SIZE(s5_reset_reason_txt); i++) {
13441348
if (!(value & BIT(i)))
13451349
continue;
13461350

13471351
if (s5_reset_reason_txt[i]) {
1348-
pr_info("x86/amd: Previous system reset reason [0x%08lx]: %s\n",
1352+
pr_info("x86/amd: Previous system reset reason [0x%08x]: %s\n",
13491353
value, s5_reset_reason_txt[i]);
13501354
}
13511355
}

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,10 +1068,8 @@ static void __init gds_select_mitigation(void)
10681068
if (gds_mitigation == GDS_MITIGATION_AUTO) {
10691069
if (should_mitigate_vuln(X86_BUG_GDS))
10701070
gds_mitigation = GDS_MITIGATION_FULL;
1071-
else {
1071+
else
10721072
gds_mitigation = GDS_MITIGATION_OFF;
1073-
return;
1074-
}
10751073
}
10761074

10771075
/* No microcode */

arch/x86/kernel/cpu/hygon.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <asm/spec-ctrl.h>
1717
#include <asm/delay.h>
1818
#include <asm/msr.h>
19+
#include <asm/resctrl.h>
1920

2021
#include "cpu.h"
2122

@@ -117,6 +118,8 @@ static void bsp_init_hygon(struct cpuinfo_x86 *c)
117118
x86_amd_ls_cfg_ssbd_mask = 1ULL << 10;
118119
}
119120
}
121+
122+
resctrl_cpu_detect(c);
120123
}
121124

122125
static void early_init_hygon(struct cpuinfo_x86 *c)

0 commit comments

Comments
 (0)