Skip to content

Commit dbfc642

Browse files
committed
Merge tag 'x86_urgent_for_v6.18_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Remove dead code leftovers after a recent mitigations cleanup which fail a Clang build - Make sure a Retbleed mitigation message is printed only when necessary - Correct the last Zen1 microcode revision for which Entrysign sha256 check is needed - Fix a NULL ptr deref when mounting the resctrl fs on a system which supports assignable counters but where L3 total and local bandwidth monitoring has been disabled at boot * tag 'x86_urgent_for_v6.18_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/bugs: Remove dead code which might prevent from building x86/bugs: Qualify RETBLEED_INTEL_MSG x86/microcode: Fix Entrysign revision check for Zen1/Naples x86,fs/resctrl: Fix NULL pointer dereference with events force-disabled in mbm_event mode
2 parents 5fee0da + 84dfce6 commit dbfc642

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,9 @@ static void __init retbleed_update_mitigation(void)
14631463
break;
14641464
default:
14651465
if (retbleed_mitigation != RETBLEED_MITIGATION_STUFF) {
1466-
pr_err(RETBLEED_INTEL_MSG);
1466+
if (retbleed_mitigation != RETBLEED_MITIGATION_NONE)
1467+
pr_err(RETBLEED_INTEL_MSG);
1468+
14671469
retbleed_mitigation = RETBLEED_MITIGATION_NONE;
14681470
}
14691471
}
@@ -1825,13 +1827,6 @@ void unpriv_ebpf_notify(int new_state)
18251827
}
18261828
#endif
18271829

1828-
static inline bool match_option(const char *arg, int arglen, const char *opt)
1829-
{
1830-
int len = strlen(opt);
1831-
1832-
return len == arglen && !strncmp(arg, opt, len);
1833-
}
1834-
18351830
/* The kernel command line selection for spectre v2 */
18361831
enum spectre_v2_mitigation_cmd {
18371832
SPECTRE_V2_CMD_NONE,

arch/x86/kernel/cpu/microcode/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static bool need_sha_check(u32 cur_rev)
194194
}
195195

196196
switch (cur_rev >> 8) {
197-
case 0x80012: return cur_rev <= 0x800126f; break;
197+
case 0x80012: return cur_rev <= 0x8001277; break;
198198
case 0x80082: return cur_rev <= 0x800820f; break;
199199
case 0x83010: return cur_rev <= 0x830107c; break;
200200
case 0x86001: return cur_rev <= 0x860010e; break;

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,16 @@ int __init rdt_get_mon_l3_config(struct rdt_resource *r)
458458
r->mon.mbm_cfg_mask = ecx & MAX_EVT_CONFIG_BITS;
459459
}
460460

461-
if (rdt_cpu_has(X86_FEATURE_ABMC)) {
461+
/*
462+
* resctrl assumes a system that supports assignable counters can
463+
* switch to "default" mode. Ensure that there is a "default" mode
464+
* to switch to. This enforces a dependency between the independent
465+
* X86_FEATURE_ABMC and X86_FEATURE_CQM_MBM_TOTAL/X86_FEATURE_CQM_MBM_LOCAL
466+
* hardware features.
467+
*/
468+
if (rdt_cpu_has(X86_FEATURE_ABMC) &&
469+
(rdt_cpu_has(X86_FEATURE_CQM_MBM_TOTAL) ||
470+
rdt_cpu_has(X86_FEATURE_CQM_MBM_LOCAL))) {
462471
r->mon.mbm_cntr_assignable = true;
463472
cpuid_count(0x80000020, 5, &eax, &ebx, &ecx, &edx);
464473
r->mon.num_mbm_cntrs = (ebx & GENMASK(15, 0)) + 1;

fs/resctrl/monitor.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,15 +1782,13 @@ int resctrl_mon_resource_init(void)
17821782
mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID;
17831783

17841784
if (r->mon.mbm_cntr_assignable) {
1785-
if (!resctrl_is_mon_event_enabled(QOS_L3_MBM_TOTAL_EVENT_ID))
1786-
resctrl_enable_mon_event(QOS_L3_MBM_TOTAL_EVENT_ID);
1787-
if (!resctrl_is_mon_event_enabled(QOS_L3_MBM_LOCAL_EVENT_ID))
1788-
resctrl_enable_mon_event(QOS_L3_MBM_LOCAL_EVENT_ID);
1789-
mon_event_all[QOS_L3_MBM_TOTAL_EVENT_ID].evt_cfg = r->mon.mbm_cfg_mask;
1790-
mon_event_all[QOS_L3_MBM_LOCAL_EVENT_ID].evt_cfg = r->mon.mbm_cfg_mask &
1791-
(READS_TO_LOCAL_MEM |
1792-
READS_TO_LOCAL_S_MEM |
1793-
NON_TEMP_WRITE_TO_LOCAL_MEM);
1785+
if (resctrl_is_mon_event_enabled(QOS_L3_MBM_TOTAL_EVENT_ID))
1786+
mon_event_all[QOS_L3_MBM_TOTAL_EVENT_ID].evt_cfg = r->mon.mbm_cfg_mask;
1787+
if (resctrl_is_mon_event_enabled(QOS_L3_MBM_LOCAL_EVENT_ID))
1788+
mon_event_all[QOS_L3_MBM_LOCAL_EVENT_ID].evt_cfg = r->mon.mbm_cfg_mask &
1789+
(READS_TO_LOCAL_MEM |
1790+
READS_TO_LOCAL_S_MEM |
1791+
NON_TEMP_WRITE_TO_LOCAL_MEM);
17941792
r->mon.mbm_assign_on_mkdir = true;
17951793
resctrl_file_fflags_init("num_mbm_cntrs",
17961794
RFTYPE_MON_INFO | RFTYPE_RES_CACHE);

0 commit comments

Comments
 (0)