]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2017 08:29:32 +0000 (10:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2017 08:29:32 +0000 (10:29 +0200)
added patches:
s390-mm-make-pmdp_invalidate-do-invalidation-only.patch

queue-4.9/s390-mm-make-pmdp_invalidate-do-invalidation-only.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/s390-mm-make-pmdp_invalidate-do-invalidation-only.patch b/queue-4.9/s390-mm-make-pmdp_invalidate-do-invalidation-only.patch
new file mode 100644 (file)
index 0000000..7a8b25e
--- /dev/null
@@ -0,0 +1,40 @@
+From 91c575b335766effa6103eba42a82aea560c365f Mon Sep 17 00:00:00 2001
+From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+Date: Mon, 18 Sep 2017 16:10:35 +0200
+Subject: s390/mm: make pmdp_invalidate() do invalidation only
+
+From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+
+commit 91c575b335766effa6103eba42a82aea560c365f upstream.
+
+Commit 227be799c39a ("s390/mm: uninline pmdp_xxx functions from pgtable.h")
+inadvertently changed the behavior of pmdp_invalidate(), so that it now
+clears the pmd instead of just marking it as invalid. Fix this by restoring
+the original behavior.
+
+A possible impact of the misbehaving pmdp_invalidate() would be the
+MADV_DONTNEED races (see commits ced10803 and 58ceeb6b), although we
+should not have any negative impact on the related dirty/young flags,
+since those flags are not set by the hardware on s390.
+
+Fixes: 227be799c39a ("s390/mm: uninline pmdp_xxx functions from pgtable.h")
+Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/s390/include/asm/pgtable.h |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/s390/include/asm/pgtable.h
++++ b/arch/s390/include/asm/pgtable.h
+@@ -1359,7 +1359,9 @@ static inline pmd_t pmdp_huge_clear_flus
+ static inline void pmdp_invalidate(struct vm_area_struct *vma,
+                                  unsigned long addr, pmd_t *pmdp)
+ {
+-      pmdp_xchg_direct(vma->vm_mm, addr, pmdp, __pmd(_SEGMENT_ENTRY_INVALID));
++      pmd_t pmd = __pmd(pmd_val(*pmdp) | _SEGMENT_ENTRY_INVALID);
++
++      pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd);
+ }
+ #define __HAVE_ARCH_PMDP_SET_WRPROTECT
index 4b12688ed84fbc46fe62eae4728976bce93b4af0..44a27a0a8c5ea281d9b3528e07dfae01a2e42885 100644 (file)
@@ -101,3 +101,4 @@ asoc-rt5659-drop-double-const.patch
 asoc-rt5660-remove-double-const.patch
 alsa-au88x0-avoid-theoretical-uninitialized-access.patch
 ttpci-address-stringop-overflow-warning.patch
+s390-mm-make-pmdp_invalidate-do-invalidation-only.patch