]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Apr 2020 11:09:27 +0000 (13:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Apr 2020 11:09:27 +0000 (13:09 +0200)
added patches:
x86-microcode-amd-increase-microcode-patch_max_size.patch
x86-resctrl-fix-invalid-attempt-at-removing-the-default-resource-group.patch
x86-resctrl-preserve-cdp-enable-over-cpu-hotplug.patch

queue-4.19/series
queue-4.19/x86-microcode-amd-increase-microcode-patch_max_size.patch [new file with mode: 0644]
queue-4.19/x86-resctrl-fix-invalid-attempt-at-removing-the-default-resource-group.patch [new file with mode: 0644]
queue-4.19/x86-resctrl-preserve-cdp-enable-over-cpu-hotplug.patch [new file with mode: 0644]

index 99c4ebcf5f5dcae204fbc3615e8b081f3c9acfd7..7f2ea52511270e3a28f62ae347c28fa53406ee4f 100644 (file)
@@ -29,3 +29,6 @@ ext4-do-not-zeroout-extents-beyond-i_disksize.patch
 kvm-x86-host-feature-ssbd-doesn-t-imply-guest-featur.patch
 scsi-target-remove-boilerplate-code.patch
 scsi-target-fix-hang-when-multiple-threads-try-to-de.patch
+x86-microcode-amd-increase-microcode-patch_max_size.patch
+x86-resctrl-preserve-cdp-enable-over-cpu-hotplug.patch
+x86-resctrl-fix-invalid-attempt-at-removing-the-default-resource-group.patch
diff --git a/queue-4.19/x86-microcode-amd-increase-microcode-patch_max_size.patch b/queue-4.19/x86-microcode-amd-increase-microcode-patch_max_size.patch
new file mode 100644 (file)
index 0000000..69248ef
--- /dev/null
@@ -0,0 +1,33 @@
+From bdf89df3c54518eed879d8fac7577fcfb220c67e Mon Sep 17 00:00:00 2001
+From: John Allen <john.allen@amd.com>
+Date: Thu, 9 Apr 2020 10:34:29 -0500
+Subject: x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
+
+From: John Allen <john.allen@amd.com>
+
+commit bdf89df3c54518eed879d8fac7577fcfb220c67e upstream.
+
+Future AMD CPUs will have microcode patches that exceed the default 4K
+patch size. Raise our limit.
+
+Signed-off-by: John Allen <john.allen@amd.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Cc: stable@vger.kernel.org # v4.14..
+Link: https://lkml.kernel.org/r/20200409152931.GA685273@mojo.amd.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/include/asm/microcode_amd.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/include/asm/microcode_amd.h
++++ b/arch/x86/include/asm/microcode_amd.h
+@@ -41,7 +41,7 @@ struct microcode_amd {
+       unsigned int                    mpb[0];
+ };
+-#define PATCH_MAX_SIZE PAGE_SIZE
++#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
+ #ifdef CONFIG_MICROCODE_AMD
+ extern void __init load_ucode_amd_bsp(unsigned int family);
diff --git a/queue-4.19/x86-resctrl-fix-invalid-attempt-at-removing-the-default-resource-group.patch b/queue-4.19/x86-resctrl-fix-invalid-attempt-at-removing-the-default-resource-group.patch
new file mode 100644 (file)
index 0000000..23d4140
--- /dev/null
@@ -0,0 +1,71 @@
+From b0151da52a6d4f3951ea24c083e7a95977621436 Mon Sep 17 00:00:00 2001
+From: Reinette Chatre <reinette.chatre@intel.com>
+Date: Tue, 17 Mar 2020 09:26:45 -0700
+Subject: x86/resctrl: Fix invalid attempt at removing the default resource group
+
+From: Reinette Chatre <reinette.chatre@intel.com>
+
+commit b0151da52a6d4f3951ea24c083e7a95977621436 upstream.
+
+The default resource group ("rdtgroup_default") is associated with the
+root of the resctrl filesystem and should never be removed. New resource
+groups can be created as subdirectories of the resctrl filesystem and
+they can be removed from user space.
+
+There exists a safeguard in the directory removal code
+(rdtgroup_rmdir()) that ensures that only subdirectories can be removed
+by testing that the directory to be removed has to be a child of the
+root directory.
+
+A possible deadlock was recently fixed with
+
+  334b0f4e9b1b ("x86/resctrl: Fix a deadlock due to inaccurate reference").
+
+This fix involved associating the private data of the "mon_groups"
+and "mon_data" directories to the resource group to which they belong
+instead of NULL as before. A consequence of this change was that
+the original safeguard code preventing removal of "mon_groups" and
+"mon_data" found in the root directory failed resulting in attempts to
+remove the default resource group that ends in a BUG:
+
+  kernel BUG at mm/slub.c:3969!
+  invalid opcode: 0000 [#1] SMP PTI
+
+  Call Trace:
+  rdtgroup_rmdir+0x16b/0x2c0
+  kernfs_iop_rmdir+0x5c/0x90
+  vfs_rmdir+0x7a/0x160
+  do_rmdir+0x17d/0x1e0
+  do_syscall_64+0x55/0x1d0
+  entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+Fix this by improving the directory removal safeguard to ensure that
+subdirectories of the resctrl root directory can only be removed if they
+are a child of the resctrl filesystem's root _and_ not associated with
+the default resource group.
+
+Fixes: 334b0f4e9b1b ("x86/resctrl: Fix a deadlock due to inaccurate reference")
+Reported-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
+Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Tested-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
+Cc: stable@vger.kernel.org
+Link: https://lkml.kernel.org/r/884cbe1773496b5dbec1b6bd11bb50cffa83603d.1584461853.git.reinette.chatre@intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/cpu/intel_rdt_rdtgroup.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
++++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+@@ -2923,7 +2923,8 @@ static int rdtgroup_rmdir(struct kernfs_
+        * If the rdtgroup is a mon group and parent directory
+        * is a valid "mon_groups" directory, remove the mon group.
+        */
+-      if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn) {
++      if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn &&
++          rdtgrp != &rdtgroup_default) {
+               if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP ||
+                   rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) {
+                       ret = rdtgroup_ctrl_remove(kn, rdtgrp);
diff --git a/queue-4.19/x86-resctrl-preserve-cdp-enable-over-cpu-hotplug.patch b/queue-4.19/x86-resctrl-preserve-cdp-enable-over-cpu-hotplug.patch
new file mode 100644 (file)
index 0000000..f25b87b
--- /dev/null
@@ -0,0 +1,74 @@
+From 9fe0450785abbc04b0ed5d3cf61fcdb8ab656b4b Mon Sep 17 00:00:00 2001
+From: James Morse <james.morse@arm.com>
+Date: Fri, 21 Feb 2020 16:21:05 +0000
+Subject: x86/resctrl: Preserve CDP enable over CPU hotplug
+
+From: James Morse <james.morse@arm.com>
+
+commit 9fe0450785abbc04b0ed5d3cf61fcdb8ab656b4b upstream.
+
+Resctrl assumes that all CPUs are online when the filesystem is mounted,
+and that CPUs remember their CDP-enabled state over CPU hotplug.
+
+This goes wrong when resctrl's CDP-enabled state changes while all the
+CPUs in a domain are offline.
+
+When a domain comes online, enable (or disable!) CDP to match resctrl's
+current setting.
+
+Fixes: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support")
+Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
+Signed-off-by: James Morse <james.morse@arm.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Cc: <stable@vger.kernel.org>
+Link: https://lkml.kernel.org/r/20200221162105.154163-1-james.morse@arm.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/cpu/intel_rdt.c          |    2 ++
+ arch/x86/kernel/cpu/intel_rdt.h          |    1 +
+ arch/x86/kernel/cpu/intel_rdt_rdtgroup.c |   13 +++++++++++++
+ 3 files changed, 16 insertions(+)
+
+--- a/arch/x86/kernel/cpu/intel_rdt.c
++++ b/arch/x86/kernel/cpu/intel_rdt.c
+@@ -555,6 +555,8 @@ static void domain_add_cpu(int cpu, stru
+       d->id = id;
+       cpumask_set_cpu(cpu, &d->cpu_mask);
++      rdt_domain_reconfigure_cdp(r);
++
+       if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
+               kfree(d);
+               return;
+--- a/arch/x86/kernel/cpu/intel_rdt.h
++++ b/arch/x86/kernel/cpu/intel_rdt.h
+@@ -567,5 +567,6 @@ void cqm_setup_limbo_handler(struct rdt_
+ void cqm_handle_limbo(struct work_struct *work);
+ bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d);
+ void __check_limbo(struct rdt_domain *d, bool force_free);
++void rdt_domain_reconfigure_cdp(struct rdt_resource *r);
+ #endif /* _ASM_X86_INTEL_RDT_H */
+--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
++++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+@@ -1777,6 +1777,19 @@ static int set_cache_qos_cfg(int level,
+       return 0;
+ }
++/* Restore the qos cfg state when a domain comes online */
++void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
++{
++      if (!r->alloc_capable)
++              return;
++
++      if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA])
++              l2_qos_cfg_update(&r->alloc_enabled);
++
++      if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA])
++              l3_qos_cfg_update(&r->alloc_enabled);
++}
++
+ /*
+  * Enable or disable the MBA software controller
+  * which helps user specify bandwidth in MBps.