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()
Unified · Split
| @@ -615,9 +615,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c) · 614 unmodified lines | ||
| 615 | 615 | return; |
| 616 | 616 | |
| 617 | 617 | clear_all: |
| 618 | − clear_cpu_cap(c, X86_FEATURE_SME); | |
| 618 | + setup_clear_cpu_cap(X86_FEATURE_SME); | |
| 619 | 619 | clear_sev: |
| 620 | − clear_cpu_cap(c, X86_FEATURE_SEV); | |
| 620 | + setup_clear_cpu_cap(X86_FEATURE_SEV); | |
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | 623 | |
| @@ -618,7 +618,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r) · 617 unmodified lines | ||
| 618 | 618 | if (static_branch_unlikely(&rdt_mon_enable_key)) |
| 619 | 619 | rmdir_mondata_subdir_allrdtgrp(r, d->id); |
| 620 | 620 | list_del(&d->list); |
| 621 | − if (is_mbm_enabled()) | |
| 621 | + if (r->mon_capable && is_mbm_enabled()) | |
| 622 | 622 | cancel_delayed_work(&d->mbm_over); |
| 623 | 623 | if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) { |
| 624 | 624 | /* |
| @@ -1741,9 +1741,6 @@ static int set_cache_qos_cfg(int level, bool enable) · 1740 unmodified lines | ||
| 1741 | 1741 | struct rdt_domain *d; |
| 1742 | 1742 | int cpu; |
| 1743 | 1743 | |
| 1744 | − if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL)) | |
| 1745 | − return -ENOMEM; | |
| 1746 | − | |
| 1747 | 1744 | if (level == RDT_RESOURCE_L3) |
| 1748 | 1745 | update = l3_qos_cfg_update; |
| 1749 | 1746 | else if (level == RDT_RESOURCE_L2) |
| @@ -1751,6 +1748,9 @@ static int set_cache_qos_cfg(int level, bool enable) · 1 unmodified line | ||
| 1751 | 1748 | else |
| 1752 | 1749 | return -EINVAL; |
| 1753 | 1750 | |
| 1751 | + if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL)) | |
| 1752 | + return -ENOMEM; | |
| 1753 | + | |
| 1754 | 1754 | r_l = &rdt_resources_all[level]; |
| 1755 | 1755 | list_for_each_entry(d, &r_l->domains, list) { |
| 1756 | 1756 | /* Pick one CPU from each domain instance to update MSR */ |