Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-01-12 17:34:35 +0100
committerTakashi Iwai <tiwai@suse.de>2018-01-12 17:34:35 +0100
commit4ef70a26fc2542024ac08084f37a8814a513a213 (patch)
tree81ac2f18a98507cd389ec5b2187fae242e7aea78
parent1eb315eaa5a4ea86fe2d909e2fbf1eed5218a53f (diff)
parent588da4b74822d697b1c790822aeb209c23d985e8 (diff)
Merge branch 'users/jthumshirn/SLE15/for-next' into SLE15
-rw-r--r--patches.arch/s390-disassembler-correct-disassembly-lines-alignmen.patch39
-rw-r--r--patches.arch/s390-sles15-02-01-s390-disassembler-increase-show_code-buffer-size.patch108
-rw-r--r--patches.arch/s390-sles15-02-02-te-ctl.patch141
-rw-r--r--patches.arch/s390-sles15-02-03-dis-end-marker.patch56
-rw-r--r--patches.arch/s390-sles15-02-04-01-qeth-fix-early-exit-from-error-path.patch68
-rw-r--r--patches.arch/s390-sles15-02-06-pci-handle-insufficient-resources-during-dma-tl.patch85
-rw-r--r--series.conf6
7 files changed, 503 insertions, 0 deletions
diff --git a/patches.arch/s390-disassembler-correct-disassembly-lines-alignmen.patch b/patches.arch/s390-disassembler-correct-disassembly-lines-alignmen.patch
new file mode 100644
index 0000000000..9c0aaf5d3d
--- /dev/null
+++ b/patches.arch/s390-disassembler-correct-disassembly-lines-alignmen.patch
@@ -0,0 +1,39 @@
+From: Vasily Gorbik <gor@linux.vnet.ibm.com>
+Date: Thu, 23 Nov 2017 10:50:23 +0100
+Subject: s390/disassembler: correct disassembly lines alignment
+Patch-mainline: v4.15-rc2
+Git-commit: 26f4e759ef9b8a2bab1823d692ed6d56d40b66e3
+References: bnc#1072915, LTC#161577
+
+176.718956 Krnl Code: 00000000004d38b0: a54c0018 llihh %r4,24
+176.718956 00000000004d38b4: b9080014 agr %r1,%r4
+ ^
+Using a tab to align disassembly lines which follow the first line with
+"Krnl Code: " doesn't always work, e.g. if there is a prefix (timestamp
+or syslog prefix) which is not 8 chars aligned. Go back to alignment
+with spaces.
+
+Fixes: b192571d1ae3 ("s390/disassembler: increase show_code buffer size")
+Signed-off-by: Vasily Gorbik <gor@linux.vnet.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ arch/s390/kernel/dis.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
+index 465d52b5e470..0a0e14335a04 100644
+--- a/arch/s390/kernel/dis.c
++++ b/arch/s390/kernel/dis.c
+@@ -548,7 +548,7 @@ void show_code(struct pt_regs *regs)
+ start += opsize;
+ pr_cont("%s", buffer);
+ ptr = buffer;
+- ptr += sprintf(ptr, "\n\t ");
++ ptr += sprintf(ptr, "\n ");
+ hops++;
+ }
+ pr_cont("\n");
+--
+2.12.3
+
diff --git a/patches.arch/s390-sles15-02-01-s390-disassembler-increase-show_code-buffer-size.patch b/patches.arch/s390-sles15-02-01-s390-disassembler-increase-show_code-buffer-size.patch
new file mode 100644
index 0000000000..6c6e366557
--- /dev/null
+++ b/patches.arch/s390-sles15-02-01-s390-disassembler-increase-show_code-buffer-size.patch
@@ -0,0 +1,108 @@
+From: Vasily Gorbik <gor@linux.vnet.ibm.com>
+Subject: s390/disassembler: increase show_code buffer size
+Patch-mainline: v4.15-rc1
+Git-commit: b192571d1ae375e0bbe0aa3ccfa1a3c3704454b9
+References: bnc#1072915, LTC#161577
+
+Description: disassembler: possible stack corruption during dump_stack
+Symptom: potential crash after the kernel stack trace
+Problem: Current buffer size of 64 is too small. objdump shows
+ that there are instructions which would require up to
+ 75 bytes buffer (with current formating).
+Solution: Increase the buffer size from 64 to 128 bytes,
+ replace some spaces with a tab.
+Reproduction: The issue has been noticed due to kasan report.
+ The core dump triggered via
+ 'echo c > /proc/sysrq-trigger' produces the kernel
+ stack trace log which overflows the buffer.
+
+Upstream-Description:
+
+ s390/disassembler: increase show_code buffer size
+
+ Current buffer size of 64 is too small. objdump shows that there are
+ instructions which would require up to 75 bytes buffer (with current
+ formating). 128 bytes "ought to be enough for anybody".
+
+ Also replaces 8 spaces with a single tab to reduce the memory footprint.
+
+ Fixes the following KASAN finding:
+
+ BUG: KASAN: stack-out-of-bounds in number+0x3fe/0x538
+ Write of size 1 at addr 000000005a4a75a0 by task bash/1282
+
+ CPU: 1 PID: 1282 Comm: bash Not tainted 4.14.0+ #215
+ Hardware name: IBM 2964 N96 702 (z/VM 6.4.0)
+ Call Trace:
+ ([<000000000011eeb6>] show_stack+0x56/0x88)
+ [<0000000000e1ce1a>] dump_stack+0x15a/0x1b0
+ [<00000000004e2994>] print_address_description+0xf4/0x288
+ [<00000000004e2cf2>] kasan_report+0x13a/0x230
+ [<0000000000e38ae6>] number+0x3fe/0x538
+ [<0000000000e3dfe4>] vsnprintf+0x194/0x948
+ [<0000000000e3ea42>] sprintf+0xa2/0xb8
+ [<00000000001198dc>] print_insn+0x374/0x500
+ [<0000000000119346>] show_code+0x4ee/0x538
+ [<000000000011f234>] show_registers+0x34c/0x388
+ [<000000000011f2ae>] show_regs+0x3e/0xa8
+ [<000000000011f502>] die+0x1ea/0x2e8
+ [<0000000000138f0e>] do_no_context+0x106/0x168
+ [<0000000000139a1a>] do_protection_exception+0x4da/0x7d0
+ [<0000000000e55914>] pgm_check_handler+0x16c/0x1c0
+ [<000000000090639e>] sysrq_handle_crash+0x46/0x58
+ ([<0000000000000007>] 0x7)
+ [<00000000009073fa>] __handle_sysrq+0x102/0x218
+ [<0000000000907c06>] write_sysrq_trigger+0xd6/0x100
+ [<000000000061d67a>] proc_reg_write+0xb2/0x128
+ [<0000000000520be6>] __vfs_write+0xee/0x368
+ [<0000000000521222>] vfs_write+0x21a/0x278
+ [<000000000052156a>] SyS_write+0xda/0x178
+ [<0000000000e555cc>] system_call+0xc4/0x270
+
+ The buggy address belongs to the page:
+ page:000003d1016929c0 count:0 mapcount:0 mapping: (null) index:0x0
+ flags: 0x0()
+ raw: 0000000000000000 0000000000000000 0000000000000000 ffffffff00000000
+ raw: 0000000000000100 0000000000000200 0000000000000000 0000000000000000
+ page dumped because: kasan: bad access detected
+
+ Memory state around the buggy address:
+ 000000005a4a7480: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
+ 000000005a4a7500: 00 00 00 00 00 00 00 00 f2 f2 f2 f2 00 00 00 00
+ >000000005a4a7580: 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00
+ ^
+ 000000005a4a7600: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f8 f8
+ 000000005a4a7680: f2 f2 f2 f2 f2 f2 f8 f8 f2 f2 f3 f3 f3 f3 00 00
+ ==================================================================
+
+ Cc: <stable@vger.kernel.org>
+ Signed-off-by: Vasily Gorbik <gor@linux.vnet.ibm.com>
+ Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+
+Signed-off-by: Vasily Gorbik <gor@linux.vnet.ibm.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ arch/s390/kernel/dis.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/s390/kernel/dis.c
++++ b/arch/s390/kernel/dis.c
+@@ -1953,7 +1953,7 @@ void show_code(struct pt_regs *regs)
+ {
+ char *mode = user_mode(regs) ? "User" : "Krnl";
+ unsigned char code[64];
+- char buffer[64], *ptr;
++ char buffer[128], *ptr;
+ mm_segment_t old_fs;
+ unsigned long addr;
+ int start, end, opsize, hops, i;
+@@ -2016,7 +2016,7 @@ void show_code(struct pt_regs *regs)
+ start += opsize;
+ pr_cont("%s", buffer);
+ ptr = buffer;
+- ptr += sprintf(ptr, "\n ");
++ ptr += sprintf(ptr, "\n\t ");
+ hops++;
+ }
+ pr_cont("\n");
diff --git a/patches.arch/s390-sles15-02-02-te-ctl.patch b/patches.arch/s390-sles15-02-02-te-ctl.patch
new file mode 100644
index 0000000000..0a6fb1bb83
--- /dev/null
+++ b/patches.arch/s390-sles15-02-02-te-ctl.patch
@@ -0,0 +1,141 @@
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Subject: s390: fix transactional execution control register handling
+Patch-mainline: v4.15-rc1
+Git-commit: a1c5befc1c24eb9c1ee83f711e0f21ee79cbb556
+References: bnc#1072915, LTC#162116
+
+Description: transactional execution: control register handling
+Symptom: User process crashes on transactional execution related
+ instructions like tbegin.
+Problem: There are several bugs with control register handling with
+ respect to transactional execution:
+ - on task switch update_per_regs() is only called if the
+ next task has an mm (is not a kernel thread). This
+ however is incorrect. This breaks e.g. for user mode
+ helper handling, where the kernel creates a kernel
+ thread and then execve's a user space program. Control
+ register contents related to transactional execution
+ won't be updated on execve. If the previous task ran
+ with transactional execution disabled then the new
+ task will also run with transactional execution
+ disabled, which is incorrect.
+ - on startup the transactional execution facility is not
+ enabled for the idle thread. This is not really a bug,
+ but an inconsistency to other facilities. Therefore
+ - on fork the new thread's per_flags field is not
+ cleared. This means that a child process inherits the
+ PER_FLAG_NO_TE flag. This flag can be set with a
+ ptrace request to disable transactional execution for
+ the current process. It should not be inherited by new
+ child processes in order to be consistent with the
+ handling of all other PER related debugging
+ options.
+Solution: Call update_per_regs() unconditionally within switch_to(),
+ enable the transactional execution facility as early as
+ possible if it is available, and clear the per_flags field
+ in copy_thread_tls().
+Reproduction: -
+
+Upstream-Description:
+
+ s390: fix transactional execution control register handling
+
+ Dan Horák reported the following crash related to transactional execution:
+
+ User process fault: interruption code 0013 ilc:3 in libpthread-2.26.so[3ff93c00000+1b000]
+ CPU: 2 PID: 1 Comm: /init Not tainted 4.13.4-300.fc27.s390x #1
+ Hardware name: IBM 2827 H43 400 (z/VM 6.4.0)
+ task: 00000000fafc8000 task.stack: 00000000fafc4000
+ User PSW : 0705200180000000 000003ff93c14e70
+ R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:1 AS:0 CC:2 PM:0 RI:0 EA:3
+ User GPRS: 0000000000000077 000003ff00000000 000003ff93144d48 000003ff93144d5e
+ 0000000000000000 0000000000000002 0000000000000000 000003ff00000000
+ 0000000000000000 0000000000000418 0000000000000000 000003ffcc9fe770
+ 000003ff93d28f50 000003ff9310acf0 000003ff92b0319a 000003ffcc9fe6d0
+ User Code: 000003ff93c14e62: 60e0b030 std %f14,48(%r11)
+ 000003ff93c14e66: 60f0b038 std %f15,56(%r11)
+ #000003ff93c14e6a: e5600000ff0e tbegin 0,65294
+ >000003ff93c14e70: a7740006 brc 7,3ff93c14e7c
+ 000003ff93c14e74: a7080000 lhi %r0,0
+ 000003ff93c14e78: a7f40023 brc 15,3ff93c14ebe
+ 000003ff93c14e7c: b2220000 ipm %r0
+ 000003ff93c14e80: 8800001c srl %r0,28
+
+ There are several bugs with control register handling with respect to
+ transactional execution:
+
+ - on task switch update_per_regs() is only called if the next task has
+ an mm (is not a kernel thread). This however is incorrect. This
+ breaks e.g. for user mode helper handling, where the kernel creates
+ a kernel thread and then execve's a user space program. Control
+ register contents related to transactional execution won't be
+ updated on execve. If the previous task ran with transactional
+ execution disabled then the new task will also run with
+ transactional execution disabled, which is incorrect. Therefore call
+ update_per_regs() unconditionally within switch_to().
+
+ - on startup the transactional execution facility is not enabled for
+ the idle thread. This is not really a bug, but an inconsistency to
+ other facilities. Therefore enable the facility if it is available.
+
+ - on fork the new thread's per_flags field is not cleared. This means
+ that a child process inherits the PER_FLAG_NO_TE flag. This flag can
+ be set with a ptrace request to disable transactional execution for
+ the current process. It should not be inherited by new child
+ processes in order to be consistent with the handling of all other
+ PER related debugging options. Therefore clear the per_flags field in
+ copy_thread_tls().
+
+ Reported-and-tested-by: Dan Horák <dan@danny.cz>
+ Fixes: d35339a42dd1 ("s390: add support for transactional memory")
+ Cc: <stable@vger.kernel.org> # v3.7+
+ Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+ Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
+ Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
+ Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ arch/s390/include/asm/switch_to.h | 2 +-
+ arch/s390/kernel/early.c | 4 +++-
+ arch/s390/kernel/process.c | 1 +
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+--- a/arch/s390/include/asm/switch_to.h
++++ b/arch/s390/include/asm/switch_to.h
+@@ -36,8 +36,8 @@ static inline void restore_access_regs(u
+ save_ri_cb(prev->thread.ri_cb); \
+ save_gs_cb(prev->thread.gs_cb); \
+ } \
++ update_cr_regs(next); \
+ if (next->mm) { \
+- update_cr_regs(next); \
+ set_cpu_flag(CIF_FPU); \
+ restore_access_regs(&next->thread.acrs[0]); \
+ restore_ri_cb(next->thread.ri_cb, prev->thread.ri_cb); \
+--- a/arch/s390/kernel/early.c
++++ b/arch/s390/kernel/early.c
+@@ -373,8 +373,10 @@ static __init void detect_machine_facili
+ S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
+ if (test_facility(40))
+ S390_lowcore.machine_flags |= MACHINE_FLAG_LPP;
+- if (test_facility(50) && test_facility(73))
++ if (test_facility(50) && test_facility(73)) {
+ S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
++ __ctl_set_bit(0, 55);
++ }
+ if (test_facility(51))
+ S390_lowcore.machine_flags |= MACHINE_FLAG_TLB_LC;
+ if (test_facility(129)) {
+--- a/arch/s390/kernel/process.c
++++ b/arch/s390/kernel/process.c
+@@ -99,6 +99,7 @@ int copy_thread_tls(unsigned long clone_
+ memset(&p->thread.per_user, 0, sizeof(p->thread.per_user));
+ memset(&p->thread.per_event, 0, sizeof(p->thread.per_event));
+ clear_tsk_thread_flag(p, TIF_SINGLE_STEP);
++ p->thread.per_flags = 0;
+ /* Initialize per thread user and system timer values */
+ p->thread.user_timer = 0;
+ p->thread.guest_timer = 0;
diff --git a/patches.arch/s390-sles15-02-03-dis-end-marker.patch b/patches.arch/s390-sles15-02-03-dis-end-marker.patch
new file mode 100644
index 0000000000..ff57d5c961
--- /dev/null
+++ b/patches.arch/s390-sles15-02-03-dis-end-marker.patch
@@ -0,0 +1,56 @@
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Subject: s390/disassembler: add missing end marker for e7 table
+Patch-mainline: v4.15-rc1
+Git-commit: 5c50538752af7968f53924b22dede8ed4ce4cb3b
+References: bnc#1072915, LTC#162117
+
+Description: disassembler: missing end marker
+Symptom: Kernel crashes or emits wrong disassembly.
+Problem: The e7 opcode table does not have an end marker. Hence
+ when trying to find an unknown e7 instruction the code
+ will access memory behind the table until it finds
+ something that matches the opcode, or the kernel
+ crashes, whatever comes first.
+ This affects not only the in-kernel disassembler but
+ also uprobes and kprobes which refuse to set a probe on
+ unknown instructions, and therefore search the opcode
+ tables to figure out if instructions are known or not.
+Solution: Add missing end marker.
+Reproduction: -
+
+Upstream-Description:
+
+ s390/disassembler: add missing end marker for e7 table
+
+ The e7 opcode table does not have an end marker. Hence when trying to
+ find an unknown e7 instruction the code will access memory behind the
+ table until it finds something that matches the opcode, or the kernel
+ crashes, whatever comes first.
+
+ This affects not only the in-kernel disassembler but also uprobes and
+ kprobes which refuse to set a probe on unknown instructions, and
+ therefore search the opcode tables to figure out if instructions are
+ known or not.
+
+ Cc: <stable@vger.kernel.org> # v3.18+
+ Fixes: 3585cb0280654 ("s390/disassembler: add vector instructions")
+ Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+ Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ arch/s390/kernel/dis.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/s390/kernel/dis.c
++++ b/arch/s390/kernel/dis.c
+@@ -1548,6 +1548,7 @@ static struct s390_insn opcode_e7[] = {
+ { "vfsq", 0xce, INSTR_VRR_VV000MM },
+ { "vfs", 0xe2, INSTR_VRR_VVV00MM },
+ { "vftci", 0x4a, INSTR_VRI_VVIMM },
++ { "", 0, INSTR_INVALID }
+ };
+
+ static struct s390_insn opcode_eb[] = {
diff --git a/patches.arch/s390-sles15-02-04-01-qeth-fix-early-exit-from-error-path.patch b/patches.arch/s390-sles15-02-04-01-qeth-fix-early-exit-from-error-path.patch
new file mode 100644
index 0000000000..0810d1bd71
--- /dev/null
+++ b/patches.arch/s390-sles15-02-04-01-qeth-fix-early-exit-from-error-path.patch
@@ -0,0 +1,68 @@
+From: Julian Wiedmann <jwi@linux.vnet.ibm.com>
+Subject: s390/qeth: fix early exit from error path
+Patch-mainline: v4.15-rc1
+Git-commit: 83cf79a2fec3cf499eb6cb9eb608656fc2a82776
+References: bnc#1072915, LTC#162173
+
+Description: qeth: fixes for L3 set_rx_mode improvements
+Symptom: The L3 set_rx_mode improvements introduced some
+ problems that can result in access of uninitialized
+ memory, a blocked refcount and intermittent loss
+ of inbound IPv4 multicast traffic.
+Problem: see individual patch descriptions
+Solution: Apply all relevant fixes.
+Reproduction: -
+
+Upstream-Description:
+
+ s390/qeth: fix early exit from error path
+
+ When the allocation of the addr buffer fails, we need to free
+ our refcount on the inetdevice before returning.
+
+ Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
+ Signed-off-by: David S. Miller <davem@davemloft.net>
+
+
+Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/s390/net/qeth_l3_main.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/s390/net/qeth_l3_main.c
++++ b/drivers/s390/net/qeth_l3_main.c
+@@ -1553,7 +1553,7 @@ static void qeth_l3_free_vlan_addresses4
+
+ addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4);
+ if (!addr)
+- return;
++ goto out;
+
+ spin_lock_bh(&card->ip_lock);
+
+@@ -1567,6 +1567,7 @@ static void qeth_l3_free_vlan_addresses4
+ spin_unlock_bh(&card->ip_lock);
+
+ kfree(addr);
++out:
+ in_dev_put(in_dev);
+ }
+
+@@ -1591,7 +1592,7 @@ static void qeth_l3_free_vlan_addresses6
+
+ addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV6);
+ if (!addr)
+- return;
++ goto out;
+
+ spin_lock_bh(&card->ip_lock);
+
+@@ -1606,6 +1607,7 @@ static void qeth_l3_free_vlan_addresses6
+ spin_unlock_bh(&card->ip_lock);
+
+ kfree(addr);
++out:
+ in6_dev_put(in6_dev);
+ #endif /* CONFIG_QETH_IPV6 */
+ }
diff --git a/patches.arch/s390-sles15-02-06-pci-handle-insufficient-resources-during-dma-tl.patch b/patches.arch/s390-sles15-02-06-pci-handle-insufficient-resources-during-dma-tl.patch
new file mode 100644
index 0000000000..629348e722
--- /dev/null
+++ b/patches.arch/s390-sles15-02-06-pci-handle-insufficient-resources-during-dma-tl.patch
@@ -0,0 +1,85 @@
+From: Sebastian Ott <sebott@linux.vnet.ibm.com>
+Subject: s390/pci: handle insufficient resources during dma tlb flush
+Patch-mainline: v4.15-rc7
+Git-commit: a5f1005517534aeb1fac20180badfbf0896c183c
+References: bnc#1072915, LTC#163393
+
+Description: s390/pci: improve lazy IOTLB flushing mode
+Symptom: Some PCI workloads don't reach full
+ performance potential.
+Problem: Even with lazy IOTLB flushing it is done
+ more often than needed.
+Solution: Improve that and be as lazy as possible.
+Reproduction: -
+
+Upstream-Description:
+
+ s390/pci: handle insufficient resources during dma tlb flush
+
+ In a virtualized setup lazy flushing can lead to the hypervisor
+ running out of resources when lots of guest pages need to be
+ pinned. In this situation simply trigger a global flush to give
+ the hypervisor a chance to free some of these resources.
+
+ Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
+ Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+ Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
+ Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+
+Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ arch/s390/pci/pci_dma.c | 21 +++++++++++++++++++--
+ arch/s390/pci/pci_insn.c | 3 +++
+ 2 files changed, 22 insertions(+), 2 deletions(-)
+
+--- a/arch/s390/pci/pci_dma.c
++++ b/arch/s390/pci/pci_dma.c
+@@ -178,6 +178,9 @@ out_unlock:
+ static int __dma_purge_tlb(struct zpci_dev *zdev, dma_addr_t dma_addr,
+ size_t size, int flags)
+ {
++ unsigned long irqflags;
++ int ret;
++
+ /*
+ * With zdev->tlb_refresh == 0, rpcit is not required to establish new
+ * translations when previously invalid translation-table entries are
+@@ -193,8 +196,22 @@ static int __dma_purge_tlb(struct zpci_d
+ return 0;
+ }
+
+- return zpci_refresh_trans((u64) zdev->fh << 32, dma_addr,
+- PAGE_ALIGN(size));
++ ret = zpci_refresh_trans((u64) zdev->fh << 32, dma_addr,
++ PAGE_ALIGN(size));
++ if (ret == -ENOMEM && !s390_iommu_strict) {
++ /* enable the hypervisor to free some resources */
++ if (zpci_refresh_global(zdev))
++ goto out;
++
++ spin_lock_irqsave(&zdev->iommu_bitmap_lock, irqflags);
++ bitmap_andnot(zdev->iommu_bitmap, zdev->iommu_bitmap,
++ zdev->lazy_bitmap, zdev->iommu_pages);
++ bitmap_zero(zdev->lazy_bitmap, zdev->iommu_pages);
++ spin_unlock_irqrestore(&zdev->iommu_bitmap_lock, irqflags);
++ ret = 0;
++ }
++out:
++ return ret;
+ }
+
+ static int dma_update_trans(struct zpci_dev *zdev, unsigned long pa,
+--- a/arch/s390/pci/pci_insn.c
++++ b/arch/s390/pci/pci_insn.c
+@@ -87,6 +87,9 @@ int zpci_refresh_trans(u64 fn, u64 addr,
+ if (cc)
+ zpci_err_insn(cc, status, addr, range);
+
++ if (cc == 1 && (status == 4 || status == 16))
++ return -ENOMEM;
++
+ return (cc) ? -EIO : 0;
+ }
+
diff --git a/series.conf b/series.conf
index 00ba28ff53..33c665a1a5 100644
--- a/series.conf
+++ b/series.conf
@@ -5715,11 +5715,13 @@
patches.drivers/net-mlx5e-Set-page-to-null-in-case-dma-mapping-fails.patch
patches.drivers/net-mlx5e-Increase-Striding-RQ-minimum-size-limit-to.patch
patches.drivers/mmc-sdhci-pci-remove-outdated-declaration
+ patches.arch/s390-sles15-02-03-dis-end-marker.patch
patches.arch/s390-sles15-00-10-01-kernel-sthyi-reorganize-sthyi-implementation.patch
patches.arch/s390-sles15-00-10-02-kernel-sthyi-add-cache-to-store-hypervisor-info.patch
patches.arch/s390-sles15-00-10-03-kernel-sthyi-add-s390_sthyi-system-call.patch
patches.drivers/s390-cpu-alternatives.patch
patches.drivers/s390-spinlock-alternative.patch
+ patches.arch/s390-sles15-02-02-te-ctl.patch
patches.arch/s390-sles15-01-11-s390-noexec-execute-kexec-datamover-without-DAT.patch
patches.suse/btrfs-change-how-we-decide-to-commit-transactions-du.patch
patches.suse/btrfs-Fix-bug-for-misused-dev_t-when-lookup-in-dev-s.patch
@@ -6045,6 +6047,7 @@
patches.drivers/cxgb4-add-tc-flower-support-for-ETH-SMAC-rewrite.patch
patches.drivers/cxgb4-introduce-fw_filter2_wr-to-prepare-for-L3-L4-r.patch
patches.drivers/cxgb4-add-tc-flower-support-for-L3-L4-rewrite.patch
+ patches.arch/s390-sles15-02-04-01-qeth-fix-early-exit-from-error-path.patch
patches.drivers/Bluetooth-hci_bcm-Add-support-for-BCM2E7E
patches.drivers/bnxt-Move-generic-devlink-code-to-new-file.patch
patches.drivers/cxgb4-fix-overflow-in-collecting-IBQ-and-OBQ-dump.patch
@@ -6290,6 +6293,7 @@
patches.fixes/dax-fix-general-protection-fault-in-dax_alloc_inode.patch
patches.drivers/nvmet_fc-fix-better-length-checking.patch
patches.suse/bio-ensure-__bio_clone_fast-copies-bi_partno.patch
+ patches.arch/s390-sles15-02-01-s390-disassembler-increase-show_code-buffer-size.patch
patches.drivers/nfp-fix-flower-offload-metadata-flag-usage.patch
patches.drivers/nfp-fix-vlan-receive-MAC-statistics-typo.patch
patches.drivers/nfp-inherit-the-max_mtu-from-the-PF-netdev.patch
@@ -6332,6 +6336,7 @@
patches.fixes/mm-fail-get_vaddr_frames-for-filesystem-dax-mappings.patch
patches.fixes/v4l2-disable-filesystem-dax-mapping-support.patch
patches.fixes/IB-core-disable-memory-registration-of-filesystem-da.patch
+ patches.arch/s390-disassembler-correct-disassembly-lines-alignmen.patch
patches.drivers/nvme-fabrics-introduce-init-command-check-for-a-queu.patch
patches.drivers/nvme-fc-check-if-queue-is-ready-in-queue_rq.patch
patches.drivers/nvme-loop-check-if-queue-is-ready-in-queue_rq.patch
@@ -6458,6 +6463,7 @@
patches.drivers/IB-mlx5-Fix-mlx5_ib_alloc_mr-error-flow.patch
patches.drivers/drm-i915-Apply-Display-WA-1183-on-skl-kbl-and-cfl
patches.drivers/crypto-chelsio-select-CRYPTO_GF128MUL.patch
+ patches.arch/s390-sles15-02-06-pci-handle-insufficient-resources-during-dma-tl.patch
patches.drivers/bnxt_en-Fix-population-of-flow_type-in-bnxt_hwrm_cfa.patch
patches.drivers/bnxt_en-Fix-the-Invalid-VF-id-check-in-bnxt_vf_ndo_p.patch
patches.drivers/nvme-mpath-fix-last-path-removal-during-traffic.patch