]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Sep 2017 11:31:57 +0000 (13:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Sep 2017 11:31:57 +0000 (13:31 +0200)
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

queue-3.18/arc-re-enable-mmu-upon-machine-check-exception.patch [new file with mode: 0644]
queue-3.18/ftrace-fix-selftest-goto-location-on-error.patch [new file with mode: 0644]
queue-3.18/pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch [new file with mode: 0644]
queue-3.18/series
queue-3.18/tracing-apply-trace_clock-changes-to-instance-max-buffer.patch [new file with mode: 0644]

diff --git a/queue-3.18/arc-re-enable-mmu-upon-machine-check-exception.patch b/queue-3.18/arc-re-enable-mmu-upon-machine-check-exception.patch
new file mode 100644 (file)
index 0000000..e6bb8ec
--- /dev/null
@@ -0,0 +1,58 @@
+From 1ee55a8f7f6b7ca4c0c59e0b4b4e3584a085c2d3 Mon Sep 17 00:00:00 2001
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+Date: Fri, 1 Sep 2017 17:00:23 +0100
+Subject: ARC: Re-enable MMU upon Machine Check exception
+
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+
+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 <joabreu@synopsys.com>
+Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+[vgupta: moved code into low level handler to avoid in 2 places]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -315,6 +315,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
+@@ -689,9 +689,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-3.18/ftrace-fix-selftest-goto-location-on-error.patch b/queue-3.18/ftrace-fix-selftest-goto-location-on-error.patch
new file mode 100644 (file)
index 0000000..2947a0d
--- /dev/null
@@ -0,0 +1,32 @@
+From 46320a6acc4fb58f04bcf78c4c942cc43b20f986 Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
+Date: Fri, 1 Sep 2017 12:04:09 -0400
+Subject: ftrace: Fix selftest goto location on error
+
+From: Steven Rostedt (VMware) <rostedt@goodmis.org>
+
+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) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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-3.18/pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch b/queue-3.18/pci-shpchp-enable-bridge-bus-mastering-if-msi-is-enabled.patch
new file mode 100644 (file)
index 0000000..2c0ad98
--- /dev/null
@@ -0,0 +1,38 @@
+From 48b79a14505349a29b3e20f03619ada9b33c4b17 Mon Sep 17 00:00:00 2001
+From: Aleksandr Bezzubikov <zuban32s@gmail.com>
+Date: Tue, 18 Jul 2017 17:12:25 +0300
+Subject: PCI: shpchp: Enable bridge bus mastering if MSI is enabled
+
+From: Aleksandr Bezzubikov <zuban32s@gmail.com>
+
+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 <zuban32s@gmail.com>
+[bhelgaas: changelog]
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
+Acked-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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,
index 0e9ac4d0cd1ccf30afc965df5250d361e1cdd655..2028a598bf3e0918306d20b4cbb2de52db0aa43e 100644 (file)
@@ -27,3 +27,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-3.18/tracing-apply-trace_clock-changes-to-instance-max-buffer.patch b/queue-3.18/tracing-apply-trace_clock-changes-to-instance-max-buffer.patch
new file mode 100644 (file)
index 0000000..af5e41b
--- /dev/null
@@ -0,0 +1,38 @@
+From 170b3b1050e28d1ba0700e262f0899ffa4fccc52 Mon Sep 17 00:00:00 2001
+From: Baohong Liu <baohong.liu@intel.com>
+Date: Tue, 5 Sep 2017 16:57:19 -0500
+Subject: tracing: Apply trace_clock changes to instance max buffer
+
+From: Baohong Liu <baohong.liu@intel.com>
+
+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 <baohong.liu@intel.com>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/trace/trace.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -4966,7 +4966,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