From: Greg Kroah-Hartman Date: Fri, 22 Sep 2017 11:33:05 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.18.72~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc5711ffaec90be18277c0534a936a18cd1f46ae;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: arc-re-enable-mmu-upon-machine-check-exception.patch ftrace-fix-selftest-goto-location-on-error.patch pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch tracing-apply-trace_clock-changes-to-instance-max-buffer.patch --- diff --git a/queue-4.4/arc-re-enable-mmu-upon-machine-check-exception.patch b/queue-4.4/arc-re-enable-mmu-upon-machine-check-exception.patch new file mode 100644 index 00000000000..c718af6e1af --- /dev/null +++ b/queue-4.4/arc-re-enable-mmu-upon-machine-check-exception.patch @@ -0,0 +1,58 @@ +From 1ee55a8f7f6b7ca4c0c59e0b4b4e3584a085c2d3 Mon Sep 17 00:00:00 2001 +From: Jose Abreu +Date: Fri, 1 Sep 2017 17:00:23 +0100 +Subject: ARC: Re-enable MMU upon Machine Check exception + +From: Jose Abreu + +commit 1ee55a8f7f6b7ca4c0c59e0b4b4e3584a085c2d3 upstream. + +I recently came upon a scenario where I would get a double fault +machine check exception tiriggered by a kernel module. +However the ensuing crash stacktrace (ksym lookup) was not working +correctly. + +Turns out that machine check auto-disables MMU while modules are allocated +in kernel vaddr spapce. + +This patch re-enables the MMU before start printing the stacktrace +making stacktracing of modules work upon a fatal exception. + +Signed-off-by: Jose Abreu +Reviewed-by: Alexey Brodkin +Signed-off-by: Vineet Gupta +[vgupta: moved code into low level handler to avoid in 2 places] +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arc/kernel/entry.S | 6 ++++++ + arch/arc/mm/tlb.c | 3 --- + 2 files changed, 6 insertions(+), 3 deletions(-) + +--- a/arch/arc/kernel/entry.S ++++ b/arch/arc/kernel/entry.S +@@ -104,6 +104,12 @@ ENTRY(EV_MachineCheck) + lr r0, [efa] + mov r1, sp + ++ ; hardware auto-disables MMU, re-enable it to allow kernel vaddr ++ ; access for say stack unwinding of modules for crash dumps ++ lr r3, [ARC_REG_PID] ++ or r3, r3, MMU_ENABLE ++ sr r3, [ARC_REG_PID] ++ + lsr r3, r2, 8 + bmsk r3, r3, 7 + brne r3, ECR_C_MCHK_DUP_TLB, 1f +--- a/arch/arc/mm/tlb.c ++++ b/arch/arc/mm/tlb.c +@@ -885,9 +885,6 @@ void do_tlb_overlap_fault(unsigned long + + local_irq_save(flags); + +- /* re-enable the MMU */ +- write_aux_reg(ARC_REG_PID, MMU_ENABLE | read_aux_reg(ARC_REG_PID)); +- + /* loop thru all sets of TLB */ + for (set = 0; set < mmu->sets; set++) { + diff --git a/queue-4.4/ftrace-fix-selftest-goto-location-on-error.patch b/queue-4.4/ftrace-fix-selftest-goto-location-on-error.patch new file mode 100644 index 00000000000..2947a0d5e74 --- /dev/null +++ b/queue-4.4/ftrace-fix-selftest-goto-location-on-error.patch @@ -0,0 +1,32 @@ +From 46320a6acc4fb58f04bcf78c4c942cc43b20f986 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Fri, 1 Sep 2017 12:04:09 -0400 +Subject: ftrace: Fix selftest goto location on error + +From: Steven Rostedt (VMware) + +commit 46320a6acc4fb58f04bcf78c4c942cc43b20f986 upstream. + +In the second iteration of trace_selftest_ops(), the error goto label is +wrong in the case where trace_selftest_test_global_cnt is off. In the +case of error, it leaks the dynamic ops that was allocated. + +Fixes: 95950c2e ("ftrace: Add self-tests for multiple function trace users") +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/trace_selftest.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/trace/trace_selftest.c ++++ b/kernel/trace/trace_selftest.c +@@ -272,7 +272,7 @@ static int trace_selftest_ops(struct tra + goto out_free; + if (cnt > 1) { + if (trace_selftest_test_global_cnt == 0) +- goto out; ++ goto out_free; + } + if (trace_selftest_test_dyn_cnt == 0) + goto out_free; diff --git a/queue-4.4/pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch b/queue-4.4/pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch new file mode 100644 index 00000000000..2c0ad980c22 --- /dev/null +++ b/queue-4.4/pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch @@ -0,0 +1,38 @@ +From 48b79a14505349a29b3e20f03619ada9b33c4b17 Mon Sep 17 00:00:00 2001 +From: Aleksandr Bezzubikov +Date: Tue, 18 Jul 2017 17:12:25 +0300 +Subject: PCI: shpchp: Enable bridge bus mastering if MSI is enabled + +From: Aleksandr Bezzubikov + +commit 48b79a14505349a29b3e20f03619ada9b33c4b17 upstream. + +An SHPC may generate MSIs to notify software about slot or controller +events (SHPC spec r1.0, sec 4.7). A PCI device can only generate an MSI if +it has bus mastering enabled. + +Enable bus mastering if the bridge contains an SHPC that uses MSI for event +notifications. + +Signed-off-by: Aleksandr Bezzubikov +[bhelgaas: changelog] +Signed-off-by: Bjorn Helgaas +Reviewed-by: Marcel Apfelbaum +Acked-by: Michael S. Tsirkin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/hotplug/shpchp_hpc.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/pci/hotplug/shpchp_hpc.c ++++ b/drivers/pci/hotplug/shpchp_hpc.c +@@ -1062,6 +1062,8 @@ int shpc_init(struct controller *ctrl, s + if (rc) { + ctrl_info(ctrl, "Can't get msi for the hotplug controller\n"); + ctrl_info(ctrl, "Use INTx for the hotplug controller\n"); ++ } else { ++ pci_set_master(pdev); + } + + rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED, diff --git a/queue-4.4/series b/queue-4.4/series index 0b9b734792b..827b54e2f4b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -49,3 +49,7 @@ scsi-sg-off-by-one-in-sg_ioctl.patch scsi-sg-factor-out-sg_fill_request_table.patch scsi-sg-fixup-infoleak-when-using-sg_get_request_table.patch scsi-qla2xxx-fix-an-integer-overflow-in-sysfs-code.patch +ftrace-fix-selftest-goto-location-on-error.patch +tracing-apply-trace_clock-changes-to-instance-max-buffer.patch +arc-re-enable-mmu-upon-machine-check-exception.patch +pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch diff --git a/queue-4.4/tracing-apply-trace_clock-changes-to-instance-max-buffer.patch b/queue-4.4/tracing-apply-trace_clock-changes-to-instance-max-buffer.patch new file mode 100644 index 00000000000..0af5587ec36 --- /dev/null +++ b/queue-4.4/tracing-apply-trace_clock-changes-to-instance-max-buffer.patch @@ -0,0 +1,38 @@ +From 170b3b1050e28d1ba0700e262f0899ffa4fccc52 Mon Sep 17 00:00:00 2001 +From: Baohong Liu +Date: Tue, 5 Sep 2017 16:57:19 -0500 +Subject: tracing: Apply trace_clock changes to instance max buffer + +From: Baohong Liu + +commit 170b3b1050e28d1ba0700e262f0899ffa4fccc52 upstream. + +Currently trace_clock timestamps are applied to both regular and max +buffers only for global trace. For instance trace, trace_clock +timestamps are applied only to regular buffer. But, regular and max +buffers can be swapped, for example, following a snapshot. So, for +instance trace, bad timestamps can be seen following a snapshot. +Let's apply trace_clock timestamps to instance max buffer as well. + +Link: http://lkml.kernel.org/r/ebdb168d0be042dcdf51f81e696b17fabe3609c1.1504642143.git.tom.zanussi@linux.intel.com + +Fixes: 277ba0446 ("tracing: Add interface to allow multiple trace buffers") +Signed-off-by: Baohong Liu +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/trace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -5237,7 +5237,7 @@ static int tracing_set_clock(struct trac + tracing_reset_online_cpus(&tr->trace_buffer); + + #ifdef CONFIG_TRACER_MAX_TRACE +- if (tr->flags & TRACE_ARRAY_FL_GLOBAL && tr->max_buffer.buffer) ++ if (tr->max_buffer.buffer) + ring_buffer_set_clock(tr->max_buffer.buffer, trace_clocks[i].func); + tracing_reset_online_cpus(&tr->max_buffer); + #endif