Skip to contentSkip to conversation

x86/resctrl: Fix panic on systems that do not enable local MBM

PATCH New Prarit Bhargava 2 participants 2 messages Jun 10, 2019 – Jun 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/resctrl: Fix panic on systems that do not enable local MBM

Booting with kernel parameter "rdt=cmt,mbmtotal,memlocal,l3cat,mba" and executing "mount -t resctrl resctrl -o mba_MBps /sys/fs/resctrl" results in a panic on systems without local MBM support enabled in firmware.

BUG: kernel NULL pointer dereference, address: 0000000000000020
PGD 0 P4D 0
Oops: 0000 [#1] SMP PTI
CPU: 0 PID: 722 Comm: kworker/0:3 Not tainted 5.2.0-0.rc3.git0.1.el7_UNSUPPORTED.x86_64 #2
Hardware name: Dell Inc. PowerEdge R740/0923K0, BIOS 2.1.8 04/30/2019
Workqueue: events mbm_handle_overflow
RIP: 0010:mbm_handle_overflow+0x150/0x2b0

Only call the bandwith update loop if the system has local MBM enabled.

Cc Fenghua Yu <[email protected]>
Cc Reinette Chatre <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/kernel/cpu/resctrl/monitor.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/kernel/cpu/resctrl/monitor.c +3 -0
index 7ee93125a211..397206f23d14 100644
@@ -360,6 +360,9 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm)
 	struct list_head *head;
 	struct rdtgroup *entry;
 
+	if (!is_mbm_local_enabled())
+		return;
+
 	r_mba = &rdt_resources_all[RDT_RESOURCE_MBA];
 	closid = rgrp->closid;
 	rmid = rgrp->mon.rmid;
Signature · 1 line
2.21.0
#1 lore raw

[tip:x86/urgent] x86/resctrl: Prevent NULL pointer dereference when local MBM is disabled

x86/resctrl: Prevent NULL pointer dereference when local MBM is disabled
Commit-ID:  c7563e62a6d720aa3b068e26ddffab5f0df29263
Gitweb:     https://git.kernel.org/tip/c7563e62a6d720aa3b068e26ddffab5f0df29263
Author:     Prarit Bhargava <[email protected]>
AuthorDate: Mon, 10 Jun 2019 13:15:44 -0400
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed, 12 Jun 2019 10:31:50 +0200

x86/resctrl: Prevent NULL pointer dereference when local MBM is disabled

Booting with kernel parameter "rdt=cmt,mbmtotal,memlocal,l3cat,mba" and executing "mount -t resctrl resctrl -o mba_MBps /sys/fs/resctrl" results in a NULL pointer dereference on systems which do not have local MBM support enabled..

BUG: kernel NULL pointer dereference, address: 0000000000000020
PGD 0 P4D 0
Oops: 0000 [#1] SMP PTI
CPU: 0 PID: 722 Comm: kworker/0:3 Not tainted 5.2.0-0.rc3.git0.1.el7_UNSUPPORTED.x86_64 #2
Workqueue: events mbm_handle_overflow
RIP: 0010:mbm_handle_overflow+0x150/0x2b0

Only enter the bandwith update loop if the system has local MBM enabled.

Fixes de73f38f7680 ("x86/intel_rdt/mba_sc: Feedback loop to dynamically update mem bandwidth")
Cc Fenghua Yu <[email protected]>
Cc Reinette Chatre <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/kernel/cpu/resctrl/monitor.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/kernel/cpu/resctrl/monitor.c +3 -0
index 1573a0a6b525..ff6e8e561405 100644
@@ -368,6 +368,9 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm)
 	struct list_head *head;
 	struct rdtgroup *entry;
 
+	if (!is_mbm_local_enabled())
+		return;
+
 	r_mba = &rdt_resources_all[RDT_RESOURCE_MBA];
 	closid = rgrp->closid;
 	rmid = rgrp->mon.rmid;