Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-06-11 11:06:24 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-06-11 11:06:24 +0200
commit66cdb9df9655f59abcc5c266908437c7a85a1c1f (patch)
tree1feb6d3d6cf3ef216fa4d39e85c89b96cb0f788c
parent48fe1c5efe9a083c1a6eff2a0a85818f25437ef8 (diff)
parent6105eaef2b3b74d44109c89d2ac20e63814dd163 (diff)
Merge branch 'users/msuchanek/SLE15/for-next' into SLE15
Pull POWER fixes from Michal Suchanek
-rw-r--r--blacklist.conf2
-rw-r--r--patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch90
-rw-r--r--patches.arch/powerpc-Fix-HMIs-on-big-endian-with-CONFIG_RELOCATAB.patch40
-rw-r--r--patches.arch/powerpc-eeh-Fix-race-with-driver-un-bind.patch262
-rw-r--r--patches.arch/powerpc-msi-Fix-NULL-pointer-access-in-teardown-code.patch58
-rw-r--r--patches.arch/powerpc-powernv-idle-Restore-IAMR-after-idle.patch83
-rw-r--r--patches.arch/powerpc-process-Fix-sparse-address-space-warnings.patch46
-rw-r--r--patches.drivers/ibmvnic-Do-not-close-unopened-driver-during-reset.patch38
-rw-r--r--patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch55
-rw-r--r--patches.drivers/ibmvnic-Refresh-device-multicast-list-after-reset.patch38
-rw-r--r--series.conf11
11 files changed, 723 insertions, 0 deletions
diff --git a/blacklist.conf b/blacklist.conf
index d5c28c6995..89277cdf1b 100644
--- a/blacklist.conf
+++ b/blacklist.conf
@@ -1243,3 +1243,5 @@ f627caf55b8e735dcec8fa6538e9668632b55276 # sm712fb driver not enabled: fbdev: sm
6053d3a4793e5bde6299ac5388e76a3bf679ff65 # sm712fb driver not enabled: fbdev: sm712fb: fix support for 1024x768-16 mode
4ed7d2ccb7684510ec5f7a8f7ef534bc6a3d55b2 # sm712fb driver not enabled: fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled display
2f0799a0ffc033bf3cc82d5032acc3ec633464c2 # this reverts ac5b2c18911f and there is a disagreement over this policy. We want to have ac5b2c18911f applied
+406d2b6ae3420f5bb2b3db6986dc6f0b6dbb637b # powerpc/64: Make meltdown reporting Book3S 64 specific - we compile only this arch
+ebcd1bfc33c7a90df941df68a6e5d4018c022fba # powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E
diff --git a/patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch b/patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch
new file mode 100644
index 0000000000..1ed3619e19
--- /dev/null
+++ b/patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch
@@ -0,0 +1,90 @@
+From 186b8f1587c79c2fa04bfa392fdf084443e398c1 Mon Sep 17 00:00:00 2001
+From: Seth Forshee <seth.forshee@canonical.com>
+Date: Thu, 28 Sep 2017 09:33:39 -0400
+Subject: [PATCH] powerpc: Always initialize input array when calling
+ epapr_hypercall()
+
+References: bsc#1065729
+Patch-mainline: v4.15-rc1
+Git-commit: 186b8f1587c79c2fa04bfa392fdf084443e398c1
+
+Several callers to epapr_hypercall() pass an uninitialized stack
+allocated array for the input arguments, presumably because they
+have no input arguments. However this can produce errors like
+this one
+
+ arch/powerpc/include/asm/epapr_hcalls.h:470:42: error: 'in' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ unsigned long register r3 asm("r3") = in[0];
+ ~~^~~
+
+Fix callers to this function to always zero-initialize the input
+arguments array to prevent this.
+
+Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/include/asm/epapr_hcalls.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
+index 334459ad145b..90863245df53 100644
+--- a/arch/powerpc/include/asm/epapr_hcalls.h
++++ b/arch/powerpc/include/asm/epapr_hcalls.h
+@@ -508,7 +508,7 @@ static unsigned long epapr_hypercall(unsigned long *in,
+
+ static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+ unsigned long r;
+
+@@ -520,7 +520,7 @@ static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
+
+ static inline long epapr_hypercall0(unsigned int nr)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ return epapr_hypercall(in, out, nr);
+@@ -528,7 +528,7 @@ static inline long epapr_hypercall0(unsigned int nr)
+
+ static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+@@ -538,7 +538,7 @@ static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
+ static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
+ unsigned long p2)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+@@ -549,7 +549,7 @@ static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
+ static inline long epapr_hypercall3(unsigned int nr, unsigned long p1,
+ unsigned long p2, unsigned long p3)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+@@ -562,7 +562,7 @@ static inline long epapr_hypercall4(unsigned int nr, unsigned long p1,
+ unsigned long p2, unsigned long p3,
+ unsigned long p4)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+--
+2.20.1
+
diff --git a/patches.arch/powerpc-Fix-HMIs-on-big-endian-with-CONFIG_RELOCATAB.patch b/patches.arch/powerpc-Fix-HMIs-on-big-endian-with-CONFIG_RELOCATAB.patch
new file mode 100644
index 0000000000..76ba8f40ea
--- /dev/null
+++ b/patches.arch/powerpc-Fix-HMIs-on-big-endian-with-CONFIG_RELOCATAB.patch
@@ -0,0 +1,40 @@
+From 505a314fb28ce122091691c51426fa85c084e115 Mon Sep 17 00:00:00 2001
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Mon, 8 Oct 2018 15:08:31 +1100
+Subject: [PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y
+
+References: bsc#1065729
+Patch-mainline: v5.0-rc1
+Git-commit: 505a314fb28ce122091691c51426fa85c084e115
+
+HMIs will crash the kernel due to
+
+ BRANCH_LINK_TO_FAR(hmi_exception_realmode)
+
+Calling into the OPD instead of the actual code.
+
+Fixes: 2337d207288f ("powerpc/64: CONFIG_RELOCATABLE support for hmi interrupts")
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+[mpe: Use DOTSYM() rather than #ifdef]
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/exceptions-64s.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
+index 89d32bb79d5e..ed3d6fa8be53 100644
+--- a/arch/powerpc/kernel/exceptions-64s.S
++++ b/arch/powerpc/kernel/exceptions-64s.S
+@@ -1031,7 +1031,7 @@ TRAMP_REAL_BEGIN(hmi_exception_early)
+ EXCEPTION_PROLOG_COMMON_2(PACA_EXGEN)
+ EXCEPTION_PROLOG_COMMON_3(0xe60)
+ addi r3,r1,STACK_FRAME_OVERHEAD
+- BRANCH_LINK_TO_FAR(hmi_exception_realmode) /* Function call ABI */
++ BRANCH_LINK_TO_FAR(DOTSYM(hmi_exception_realmode)) /* Function call ABI */
+ cmpdi cr0,r3,0
+
+ /* Windup the stack. */
+--
+2.20.1
+
diff --git a/patches.arch/powerpc-eeh-Fix-race-with-driver-un-bind.patch b/patches.arch/powerpc-eeh-Fix-race-with-driver-un-bind.patch
new file mode 100644
index 0000000000..f270f3a932
--- /dev/null
+++ b/patches.arch/powerpc-eeh-Fix-race-with-driver-un-bind.patch
@@ -0,0 +1,262 @@
+From f0295e047fcf52ccb42561fb7de6942f5201b676 Mon Sep 17 00:00:00 2001
+From: Michael Neuling <mikey@neuling.org>
+Date: Mon, 26 Mar 2018 15:17:07 +1100
+Subject: [PATCH] powerpc/eeh: Fix race with driver un/bind
+
+References: bsc#1065729
+Patch-mainline: v4.17-rc1
+Git-commit: f0295e047fcf52ccb42561fb7de6942f5201b676
+
+The current EEH callbacks can race with a driver unbind. This can
+result in a backtraces like this:
+
+ EEH: Frozen PHB#0-PE#1fc detected
+ EEH: PE location: S000009, PHB location: N/A
+ CPU: 2 PID: 2312 Comm: kworker/u258:3 Not tainted 4.15.6-openpower1 #2
+ Workqueue: nvme-wq nvme_reset_work [nvme]
+ Call Trace:
+ dump_stack+0x9c/0xd0 (unreliable)
+ eeh_dev_check_failure+0x420/0x470
+ eeh_check_failure+0xa0/0xa4
+ nvme_reset_work+0x138/0x1414 [nvme]
+ process_one_work+0x1ec/0x328
+ worker_thread+0x2e4/0x3a8
+ kthread+0x14c/0x154
+ ret_from_kernel_thread+0x5c/0xc8
+ nvme nvme1: Removing after probe failure status: -19
+ <snip>
+ cpu 0x23: Vector: 300 (Data Access) at [c000000ff50f3800]
+ pc: c0080000089a0eb0: nvme_error_detected+0x4c/0x90 [nvme]
+ lr: c000000000026564: eeh_report_error+0xe0/0x110
+ sp: c000000ff50f3a80
+ msr: 9000000000009033
+ dar: 400
+ dsisr: 40000000
+ current = 0xc000000ff507c000
+ paca = 0xc00000000fdc9d80 softe: 0 irq_happened: 0x01
+ pid = 782, comm = eehd
+ Linux version 4.15.6-openpower1 (smc@smc-desktop) (gcc version 6.4.0 (Buildroot 2017.11.2-00008-g4b6188e)) #2 SM P Tue Feb 27 12:33:27 PST 2018
+ enter ? for help
+ eeh_report_error+0xe0/0x110
+ eeh_pe_dev_traverse+0xc0/0xdc
+ eeh_handle_normal_event+0x184/0x4c4
+ eeh_handle_event+0x30/0x288
+ eeh_event_handler+0x124/0x170
+ kthread+0x14c/0x154
+ ret_from_kernel_thread+0x5c/0xc8
+
+The first part is an EEH (on boot), the second half is the resulting
+crash. nvme probe starts the nvme_reset_work() worker thread. This
+worker thread starts touching the device which see a device error
+(EEH) and hence queues up an event in the powerpc EEH worker
+thread. nvme_reset_work() then continues and runs
+nvme_remove_dead_ctrl_work() which results in unbinding the driver
+from the device and hence releases all resources. At the same time,
+the EEH worker thread starts doing the EEH .error_detected() driver
+callback, which no longer works since the resources have been freed.
+
+This fixes the problem in the same way the generic PCIe AER code (in
+drivers/pci/pcie/aer/aerdrv_core.c) does. It makes the EEH code hold
+the device_lock() while performing the driver EEH callbacks and
+associated code. This ensures either the callbacks are no longer
+register, or if they are registered the driver will not be removed
+from underneath us.
+
+This has been broken forever. The EEH call backs were first introduced
+in 2005 (in 77bd7415610) but it's not clear if a lock was needed back
+then.
+
+Fixes: 77bd74156101 ("[PATCH] powerpc: PCI Error Recovery: PPC64 core recovery routines")
+Cc: stable@vger.kernel.org # v2.6.16+
+Signed-off-by: Michael Neuling <mikey@neuling.org>
+Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/eeh_driver.c | 68 ++++++++++++++++++++------------
+ 1 file changed, 42 insertions(+), 26 deletions(-)
+
+diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
+index 43ceb6263cd8..b8a329f04814 100644
+--- a/arch/powerpc/kernel/eeh_driver.c
++++ b/arch/powerpc/kernel/eeh_driver.c
+@@ -207,18 +207,18 @@ static void *eeh_report_error(void *data, void *userdata)
+
+ if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ return NULL;
++
++ device_lock(&dev->dev);
+ dev->error_state = pci_channel_io_frozen;
+
+ driver = eeh_pcid_get(dev);
+- if (!driver) return NULL;
++ if (!driver) goto out_no_dev;
+
+ eeh_disable_irq(dev);
+
+ if (!driver->err_handler ||
+- !driver->err_handler->error_detected) {
+- eeh_pcid_put(dev);
+- return NULL;
+- }
++ !driver->err_handler->error_detected)
++ goto out;
+
+ rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen);
+
+@@ -227,8 +227,12 @@ static void *eeh_report_error(void *data, void *userdata)
+ if (*res == PCI_ERS_RESULT_NONE) *res = rc;
+
+ edev->in_error = true;
+- eeh_pcid_put(dev);
+ pci_uevent_ers(dev, PCI_ERS_RESULT_NONE);
++
++out:
++ eeh_pcid_put(dev);
++out_no_dev:
++ device_unlock(&dev->dev);
+ return NULL;
+ }
+
+@@ -251,15 +255,14 @@ static void *eeh_report_mmio_enabled(void *data, void *userdata)
+ if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ return NULL;
+
++ device_lock(&dev->dev);
+ driver = eeh_pcid_get(dev);
+- if (!driver) return NULL;
++ if (!driver) goto out_no_dev;
+
+ if (!driver->err_handler ||
+ !driver->err_handler->mmio_enabled ||
+- (edev->mode & EEH_DEV_NO_HANDLER)) {
+- eeh_pcid_put(dev);
+- return NULL;
+- }
++ (edev->mode & EEH_DEV_NO_HANDLER))
++ goto out;
+
+ rc = driver->err_handler->mmio_enabled(dev);
+
+@@ -267,7 +270,10 @@ static void *eeh_report_mmio_enabled(void *data, void *userdata)
+ if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
+ if (*res == PCI_ERS_RESULT_NONE) *res = rc;
+
++out:
+ eeh_pcid_put(dev);
++out_no_dev:
++ device_unlock(&dev->dev);
+ return NULL;
+ }
+
+@@ -290,20 +296,20 @@ static void *eeh_report_reset(void *data, void *userdata)
+
+ if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ return NULL;
++
++ device_lock(&dev->dev);
+ dev->error_state = pci_channel_io_normal;
+
+ driver = eeh_pcid_get(dev);
+- if (!driver) return NULL;
++ if (!driver) goto out_no_dev;
+
+ eeh_enable_irq(dev);
+
+ if (!driver->err_handler ||
+ !driver->err_handler->slot_reset ||
+ (edev->mode & EEH_DEV_NO_HANDLER) ||
+- (!edev->in_error)) {
+- eeh_pcid_put(dev);
+- return NULL;
+- }
++ (!edev->in_error))
++ goto out;
+
+ rc = driver->err_handler->slot_reset(dev);
+ if ((*res == PCI_ERS_RESULT_NONE) ||
+@@ -311,7 +317,10 @@ static void *eeh_report_reset(void *data, void *userdata)
+ if (*res == PCI_ERS_RESULT_DISCONNECT &&
+ rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
+
++out:
+ eeh_pcid_put(dev);
++out_no_dev:
++ device_unlock(&dev->dev);
+ return NULL;
+ }
+
+@@ -362,10 +371,12 @@ static void *eeh_report_resume(void *data, void *userdata)
+
+ if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ return NULL;
++
++ device_lock(&dev->dev);
+ dev->error_state = pci_channel_io_normal;
+
+ driver = eeh_pcid_get(dev);
+- if (!driver) return NULL;
++ if (!driver) goto out_no_dev;
+
+ was_in_error = edev->in_error;
+ edev->in_error = false;
+@@ -375,18 +386,20 @@ static void *eeh_report_resume(void *data, void *userdata)
+ !driver->err_handler->resume ||
+ (edev->mode & EEH_DEV_NO_HANDLER) || !was_in_error) {
+ edev->mode &= ~EEH_DEV_NO_HANDLER;
+- eeh_pcid_put(dev);
+- return NULL;
++ goto out;
+ }
+
+ driver->err_handler->resume(dev);
+
+- eeh_pcid_put(dev);
+ pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED);
++out:
++ eeh_pcid_put(dev);
+ #ifdef CONFIG_PCI_IOV
+ if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev))
+ eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
+ #endif
++out_no_dev:
++ device_unlock(&dev->dev);
+ return NULL;
+ }
+
+@@ -406,23 +419,26 @@ static void *eeh_report_failure(void *data, void *userdata)
+
+ if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ return NULL;
++
++ device_lock(&dev->dev);
+ dev->error_state = pci_channel_io_perm_failure;
+
+ driver = eeh_pcid_get(dev);
+- if (!driver) return NULL;
++ if (!driver) goto out_no_dev;
+
+ eeh_disable_irq(dev);
+
+ if (!driver->err_handler ||
+- !driver->err_handler->error_detected) {
+- eeh_pcid_put(dev);
+- return NULL;
+- }
++ !driver->err_handler->error_detected)
++ goto out;
+
+ driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
+
+- eeh_pcid_put(dev);
+ pci_uevent_ers(dev, PCI_ERS_RESULT_DISCONNECT);
++out:
++ eeh_pcid_put(dev);
++out_no_dev:
++ device_unlock(&dev->dev);
+ return NULL;
+ }
+
+--
+2.20.1
+
diff --git a/patches.arch/powerpc-msi-Fix-NULL-pointer-access-in-teardown-code.patch b/patches.arch/powerpc-msi-Fix-NULL-pointer-access-in-teardown-code.patch
new file mode 100644
index 0000000000..d7e962770e
--- /dev/null
+++ b/patches.arch/powerpc-msi-Fix-NULL-pointer-access-in-teardown-code.patch
@@ -0,0 +1,58 @@
+From 78e7b15e17ac175e7eed9e21c6f92d03d3b0a6fa Mon Sep 17 00:00:00 2001
+From: Radu Rendec <radu.rendec@gmail.com>
+Date: Tue, 27 Nov 2018 22:20:48 -0500
+Subject: [PATCH] powerpc/msi: Fix NULL pointer access in teardown code
+
+References: bsc#1065729
+Patch-mainline: v4.20-rc7
+Git-commit: 78e7b15e17ac175e7eed9e21c6f92d03d3b0a6fa
+
+The arch_teardown_msi_irqs() function assumes that controller ops
+pointers were already checked in arch_setup_msi_irqs(), but this
+assumption is wrong: arch_teardown_msi_irqs() can be called even when
+arch_setup_msi_irqs() returns an error (-ENOSYS).
+
+This can happen in the following scenario:
+ - msi_capability_init() calls pci_msi_setup_msi_irqs()
+ - pci_msi_setup_msi_irqs() returns -ENOSYS
+ - msi_capability_init() notices the error and calls free_msi_irqs()
+ - free_msi_irqs() calls pci_msi_teardown_msi_irqs()
+
+This is easier to see when CONFIG_PCI_MSI_IRQ_DOMAIN is not set and
+pci_msi_setup_msi_irqs() and pci_msi_teardown_msi_irqs() are just
+aliases to arch_setup_msi_irqs() and arch_teardown_msi_irqs().
+
+The call to free_msi_irqs() upon pci_msi_setup_msi_irqs() failure
+seems legit, as it does additional cleanup; e.g.
+list_del(&entry->list) and kfree(entry) inside free_msi_irqs() do
+happen (MSI descriptors are allocated before pci_msi_setup_msi_irqs()
+is called and need to be cleaned up if that fails).
+
+Fixes: 6b2fd7efeb88 ("PCI/MSI/PPC: Remove arch_msi_check_device()")
+Cc: stable@vger.kernel.org # v3.18+
+Signed-off-by: Radu Rendec <radu.rendec@gmail.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/msi.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
+index dab616a33b8d..f2197654be07 100644
+--- a/arch/powerpc/kernel/msi.c
++++ b/arch/powerpc/kernel/msi.c
+@@ -34,5 +34,10 @@ void arch_teardown_msi_irqs(struct pci_dev *dev)
+ {
+ struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+- phb->controller_ops.teardown_msi_irqs(dev);
++ /*
++ * We can be called even when arch_setup_msi_irqs() returns -ENOSYS,
++ * so check the pointer again.
++ */
++ if (phb->controller_ops.teardown_msi_irqs)
++ phb->controller_ops.teardown_msi_irqs(dev);
+ }
+--
+2.20.1
+
diff --git a/patches.arch/powerpc-powernv-idle-Restore-IAMR-after-idle.patch b/patches.arch/powerpc-powernv-idle-Restore-IAMR-after-idle.patch
new file mode 100644
index 0000000000..cf2db4ac35
--- /dev/null
+++ b/patches.arch/powerpc-powernv-idle-Restore-IAMR-after-idle.patch
@@ -0,0 +1,83 @@
+From a3f3072db6cad40895c585dce65e36aab997f042 Mon Sep 17 00:00:00 2001
+From: Russell Currey <ruscur@russell.cc>
+Date: Thu, 18 Apr 2019 16:51:16 +1000
+Subject: [PATCH] powerpc/powernv/idle: Restore IAMR after idle
+
+References: bsc#1065729
+Patch-mainline: v5.2-rc1
+Git-commit: a3f3072db6cad40895c585dce65e36aab997f042
+
+Without restoring the IAMR after idle, execution prevention on POWER9
+with Radix MMU is overwritten and the kernel can freely execute
+userspace without faulting.
+
+This is necessary when returning from any stop state that modifies
+user state, as well as hypervisor state.
+
+To test how this fails without this patch, load the lkdtm driver and
+do the following:
+
+ $ echo EXEC_USERSPACE > /sys/kernel/debug/provoke-crash/DIRECT
+
+which won't fault, then boot the kernel with powersave=off, where it
+will fault. Applying this patch will fix this.
+
+Fixes: 3b10d0095a1e ("powerpc/mm/radix: Prevent kernel execution of user space")
+Cc: stable@vger.kernel.org # v4.10+
+Signed-off-by: Russell Currey <ruscur@russell.cc>
+Reviewed-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
+Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/idle_book3s.S | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
+index 7f5ac2e8581b..36178000a2f2 100644
+--- a/arch/powerpc/kernel/idle_book3s.S
++++ b/arch/powerpc/kernel/idle_book3s.S
+@@ -170,6 +170,9 @@ core_idle_lock_held:
+ bne- core_idle_lock_held
+ blr
+
++/* Reuse an unused pt_regs slot for IAMR */
++#define PNV_POWERSAVE_IAMR _DAR
++
+ /*
+ * Pass requested state in r3:
+ * r3 - PNV_THREAD_NAP/SLEEP/WINKLE in POWER8
+@@ -200,6 +203,12 @@ pnv_powersave_common:
+ /* Continue saving state */
+ SAVE_GPR(2, r1)
+ SAVE_NVGPRS(r1)
++
++BEGIN_FTR_SECTION
++ mfspr r5, SPRN_IAMR
++ std r5, PNV_POWERSAVE_IAMR(r1)
++END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
++
+ mfcr r5
+ std r5,_CCR(r1)
+ std r1,PACAR1(r13)
+@@ -924,6 +933,17 @@ BEGIN_FTR_SECTION
+ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
+ REST_NVGPRS(r1)
+ REST_GPR(2, r1)
++
++BEGIN_FTR_SECTION
++ /* IAMR was saved in pnv_powersave_common() */
++ ld r5, PNV_POWERSAVE_IAMR(r1)
++ mtspr SPRN_IAMR, r5
++ /*
++ * We don't need an isync here because the upcoming mtmsrd is
++ * execution synchronizing.
++ */
++END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
++
+ ld r4,PACAKMSR(r13)
+ ld r5,_LINK(r1)
+ ld r6,_CCR(r1)
+--
+2.20.1
+
diff --git a/patches.arch/powerpc-process-Fix-sparse-address-space-warnings.patch b/patches.arch/powerpc-process-Fix-sparse-address-space-warnings.patch
new file mode 100644
index 0000000000..94ebff38f4
--- /dev/null
+++ b/patches.arch/powerpc-process-Fix-sparse-address-space-warnings.patch
@@ -0,0 +1,46 @@
+From e33ad429d25df3746d47f2db1888ee82236edbc6 Mon Sep 17 00:00:00 2001
+From: Christophe Leroy <christophe.leroy@c-s.fr>
+Date: Sat, 6 Oct 2018 16:51:12 +0000
+Subject: [PATCH] powerpc/process: Fix sparse address space warnings
+
+References: bsc#1065729
+Patch-mainline: v4.20-rc1
+Git-commit: 3b35bd48b8a06e02a25af84baba782876b8a6572
+
+This patch fixes the following warnings, which are leftovers
+from when __get_user() was replaced by probe_kernel_address().
+
+arch/powerpc/kernel/process.c:1287:22: warning: incorrect type in argument 2 (different address spaces)
+arch/powerpc/kernel/process.c:1287:22: expected void const *src
+arch/powerpc/kernel/process.c:1287:22: got unsigned int [noderef] <asn:1>*<noident>
+arch/powerpc/kernel/process.c:1319:21: warning: incorrect type in argument 2 (different address spaces)
+arch/powerpc/kernel/process.c:1319:21: expected void const *src
+arch/powerpc/kernel/process.c:1319:21: got unsigned int [noderef] <asn:1>*<noident>
+
+Fixes: 7b051f665c32d ("powerpc: Use probe_kernel_address in show_instructions")
+Reviewed-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
+Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
+[mpe: Split out of larger patch]
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+[we don't have show_user_instructions in 4.12]
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/process.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
+index dee3f6d76b61..5a24b0e3b429 100644
+--- a/arch/powerpc/kernel/process.c
++++ b/arch/powerpc/kernel/process.c
+@@ -1314,7 +1314,7 @@ static void show_instructions(struct pt_regs *regs)
+ #endif
+
+ if (!__kernel_text_address(pc) ||
+- probe_kernel_address((unsigned int __user *)pc, instr)) {
++ probe_kernel_address((const void *)pc, instr)) {
+ pr_cont("XXXXXXXX ");
+ } else {
+ if (regs->nip == pc)
+--
+2.20.1
+
diff --git a/patches.drivers/ibmvnic-Do-not-close-unopened-driver-during-reset.patch b/patches.drivers/ibmvnic-Do-not-close-unopened-driver-during-reset.patch
new file mode 100644
index 0000000000..c5a7b22902
--- /dev/null
+++ b/patches.drivers/ibmvnic-Do-not-close-unopened-driver-during-reset.patch
@@ -0,0 +1,38 @@
+From 1f94608b0ce141be5286dde31270590bdf35b86a Mon Sep 17 00:00:00 2001
+From: Thomas Falcon <tlfalcon@linux.ibm.com>
+Date: Fri, 7 Jun 2019 16:03:53 -0500
+Subject: [PATCH] ibmvnic: Do not close unopened driver during reset
+
+References: bsc#1137752
+Patch-mainline: queued
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+Git-commit: 1f94608b0ce141be5286dde31270590bdf35b86a
+
+Check driver state before halting it during a reset. If the driver is
+not running, do nothing. Otherwise, a request to deactivate a down link
+can cause an error and the reset will fail.
+
+Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ drivers/net/ethernet/ibm/ibmvnic.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
+index 3da392bfd659..bc2a91205eec 100644
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -1745,7 +1745,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,
+
+ ibmvnic_cleanup(netdev);
+
+- if (adapter->reset_reason != VNIC_RESET_MOBILITY &&
++ if (reset_state == VNIC_OPEN &&
++ adapter->reset_reason != VNIC_RESET_MOBILITY &&
+ adapter->reset_reason != VNIC_RESET_FAILOVER) {
+ rc = __ibmvnic_close(netdev);
+ if (rc)
+--
+2.20.1
+
diff --git a/patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch b/patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch
new file mode 100644
index 0000000000..f730273849
--- /dev/null
+++ b/patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch
@@ -0,0 +1,55 @@
+From 7c940b1a5291e5069d561f5b8f0e51db6b7a259a Mon Sep 17 00:00:00 2001
+From: Thomas Falcon <tlfalcon@linux.ibm.com>
+Date: Fri, 7 Jun 2019 16:03:55 -0500
+Subject: [PATCH] ibmvnic: Fix unchecked return codes of memory allocations
+
+References: bsc#1137752
+Patch-mainline: queued
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+Git-commit: 7c940b1a5291e5069d561f5b8f0e51db6b7a259a
+
+The return values for these memory allocations are unchecked,
+which may cause an oops if the driver does not handle them after
+a failure. Fix by checking the function's return code.
+
+Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ drivers/net/ethernet/ibm/ibmvnic.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
+index 9e9f4096db58..3da680073265 100644
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -428,9 +428,10 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter)
+ if (rx_pool->buff_size != be64_to_cpu(size_array[i])) {
+ free_long_term_buff(adapter, &rx_pool->long_term_buff);
+ rx_pool->buff_size = be64_to_cpu(size_array[i]);
+- alloc_long_term_buff(adapter, &rx_pool->long_term_buff,
+- rx_pool->size *
+- rx_pool->buff_size);
++ rc = alloc_long_term_buff(adapter,
++ &rx_pool->long_term_buff,
++ rx_pool->size *
++ rx_pool->buff_size);
+ } else {
+ rc = reset_long_term_buff(adapter,
+ &rx_pool->long_term_buff);
+@@ -696,9 +697,9 @@ static int init_tx_pools(struct net_device *netdev)
+ return rc;
+ }
+
+- init_one_tx_pool(netdev, &adapter->tso_pool[i],
+- IBMVNIC_TSO_BUFS,
+- IBMVNIC_TSO_BUF_SZ);
++ rc = init_one_tx_pool(netdev, &adapter->tso_pool[i],
++ IBMVNIC_TSO_BUFS,
++ IBMVNIC_TSO_BUF_SZ);
+ if (rc) {
+ release_tx_pools(adapter);
+ return rc;
+--
+2.20.1
+
diff --git a/patches.drivers/ibmvnic-Refresh-device-multicast-list-after-reset.patch b/patches.drivers/ibmvnic-Refresh-device-multicast-list-after-reset.patch
new file mode 100644
index 0000000000..2b6d40e8ec
--- /dev/null
+++ b/patches.drivers/ibmvnic-Refresh-device-multicast-list-after-reset.patch
@@ -0,0 +1,38 @@
+From be32a24372cf162e825332da1a7ccef058d4f20b Mon Sep 17 00:00:00 2001
+From: Thomas Falcon <tlfalcon@linux.ibm.com>
+Date: Fri, 7 Jun 2019 16:03:54 -0500
+Subject: [PATCH] ibmvnic: Refresh device multicast list after reset
+
+References: bsc#1137752
+Patch-mainline: queued
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+Git-commit: be32a24372cf162e825332da1a7ccef058d4f20b
+
+It was observed that multicast packets were no longer received after
+a device reset. The fix is to resend the current multicast list to
+the backing device after recovery.
+
+Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ drivers/net/ethernet/ibm/ibmvnic.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
+index bc2a91205eec..9e9f4096db58 100644
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -1845,6 +1845,9 @@ static int do_reset(struct ibmvnic_adapter *adapter,
+ return 0;
+ }
+
++ /* refresh device's multicast list */
++ ibmvnic_set_multi(netdev);
++
+ /* kick napi */
+ for (i = 0; i < adapter->req_rx_queues; i++)
+ napi_schedule(&adapter->napi[i]);
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 5b82c74925..8fe5dfbf88 100644
--- a/series.conf
+++ b/series.conf
@@ -10078,6 +10078,7 @@
patches.arch/powerpc-kprobes-Fix-warnings-from-__this_cpu_read-on-preempt-kernels
patches.arch/powerpc-jprobes-Disable-preemption-when-triggered-th.patch
patches.arch/powerpc-powernv-Make-opal_event_shutdown-callable-fr.patch
+ patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch
patches.arch/selftests-powerpc-Use-snprintf-to-construct-DSCR-sys.patch
patches.arch/cxl-Add-support-for-POWER9-DD2.patch
patches.arch/cxl-Rename-register-PSL9_FIR2-to-PSL9_FIR_MASK.patch
@@ -15419,6 +15420,7 @@
patches.arch/powerpc-setup-Add-cpu_to_phys_id-array.patch
patches.arch/powerpc-kvm-Fix-guest-boot-failure-on-Power9-since-D.patch
patches.arch/powerpc-kexec_file-Fix-error-code-when-trying-to-loa.patch
+ patches.arch/powerpc-eeh-Fix-race-with-driver-un-bind.patch
patches.arch/powerpc-64s-idle-avoid-sync-for-KVM-state-when-wakin.patch
patches.arch/powerpc-64s-Add-all-POWER9-features-to-CPU_FTRS_ALWA.patch
patches.arch/powerpc-64s-Explicitly-add-vector-features-to-CPU_FT.patch
@@ -19836,6 +19838,7 @@
patches.arch/powerpc-64s-consolidate-MCE-counter-increment.patch
patches.arch/powerpc-tm-Reformat-comments.patch
patches.arch/powerpc-64s-hash-Do-not-use-PPC_INVALIDATE_ERAT-on-C.patch
+ patches.arch/powerpc-process-Fix-sparse-address-space-warnings.patch
patches.arch/powerpc-boot-Expose-Kconfig-symbols-to-wrapper.patch
patches.arch/powerpc-boot-Fix-opal-console-in-boot-wrapper.patch
patches.arch/powerpc-pseries-mobility-Extend-start-stop-topology-.patch
@@ -20434,6 +20437,7 @@
patches.drm/0001-drm-nouveau-kms-Fix-memory-leak-in-nv50_mstm_del.patch
patches.drivers/pinctrl-meson-fix-pull-enable-register-calculation.patch
patches.drivers/pinctrl-sunxi-a83t-Fix-IRQ-offset-typo-for-PH11.patch
+ patches.arch/powerpc-msi-Fix-NULL-pointer-access-in-teardown-code.patch
patches.arch/powerpc-boot-Fix-build-failures-with-j-1.patch
patches.fixes/0011-arm64-dma-mapping-Fix-FORCE_CONTIGUOUS-buffer-cleari.patch
patches.fixes/aio-fix-spectre-gadget-in-lookup_ioctx.patch
@@ -20599,6 +20603,7 @@
patches.arch/powerpc-tm-Print-scratch-value.patch
patches.arch/powerpc-tm-Unset-MSR-TS-if-not-recheckpointing.patch
patches.arch/powerpc-pkeys-Fix-handling-of-pkey-state-across-fork.patch
+ patches.arch/powerpc-Fix-HMIs-on-big-endian-with-CONFIG_RELOCATAB.patch
patches.fixes/pstore-ram-Do-not-treat-empty-buffers-as-valid.patch
patches.fixes/pstore-ram-Avoid-NULL-deref-in-ftrace-merging-failur.patch
patches.fixes/selinux-always-allow-mounting-submounts.patch
@@ -22187,6 +22192,7 @@
patches.suse/tipc-fix-hanging-clients-using-poll-with-EPOLLOUT-fl.patch
patches.arch/powerpc-numa-improve-control-of-topology-updates.patch
patches.arch/powerpc-numa-document-topology_updates_enabled-disab.patch
+ patches.arch/powerpc-powernv-idle-Restore-IAMR-after-idle.patch
patches.arch/powerpc-pseries-Track-LMB-nid-instead-of-using-devic.patch
patches.arch/powerpc-tm-Avoid-machine-crash-on-rt_sigreturn.patch
patches.drivers/pwm-Fix-deadlock-warning-when-removing-PWM-device.patch
@@ -22303,6 +22309,11 @@
patches.drm/0002-drm-i915-gvt-refine-ggtt-range-validation.patch
patches.drm/0003-drm-i915-gvt-Fix-cmd-length-of-VEB_DI_IECP.patch
+ # davem/net
+ patches.drivers/ibmvnic-Do-not-close-unopened-driver-during-reset.patch
+ patches.drivers/ibmvnic-Refresh-device-multicast-list-after-reset.patch
+ patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch
+
# dhowells/linux-fs keys-uefi
patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch
patches.suse/0002-efi-Add-EFI-signature-data-types.patch