Skip to content

Commit 0cc2682

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Misc fixes: - a resctrl fix for uninitialized objects found by debugobjects - a resctrl memory leak fix - fix the unintended re-enabling of the of SME and SEV CPU flags if memory encryption was disabled at bootup via the MSR space" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/CPU/AMD: Ensure clearing of SME/SEV features is maintained x86/resctrl: Fix potential memory leak x86/resctrl: Fix an imbalance in domain_remove_cpu()
2 parents 7ff15cd + a006483 commit 0cc2682

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
615615
return;
616616

617617
clear_all:
618-
clear_cpu_cap(c, X86_FEATURE_SME);
618+
setup_clear_cpu_cap(X86_FEATURE_SME);
619619
clear_sev:
620-
clear_cpu_cap(c, X86_FEATURE_SEV);
620+
setup_clear_cpu_cap(X86_FEATURE_SEV);
621621
}
622622
}
623623

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)
618618
if (static_branch_unlikely(&rdt_mon_enable_key))
619619
rmdir_mondata_subdir_allrdtgrp(r, d->id);
620620
list_del(&d->list);
621-
if (is_mbm_enabled())
621+
if (r->mon_capable && is_mbm_enabled())
622622
cancel_delayed_work(&d->mbm_over);
623623
if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {
624624
/*

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,16 +1741,16 @@ static int set_cache_qos_cfg(int level, bool enable)
17411741
struct rdt_domain *d;
17421742
int cpu;
17431743

1744-
if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1745-
return -ENOMEM;
1746-
17471744
if (level == RDT_RESOURCE_L3)
17481745
update = l3_qos_cfg_update;
17491746
else if (level == RDT_RESOURCE_L2)
17501747
update = l2_qos_cfg_update;
17511748
else
17521749
return -EINVAL;
17531750

1751+
if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1752+
return -ENOMEM;
1753+
17541754
r_l = &rdt_resources_all[level];
17551755
list_for_each_entry(d, &r_l->domains, list) {
17561756
/* Pick one CPU from each domain instance to update MSR */

0 commit comments

Comments
 (0)