Skip to contentSkip to conversation

FAILED: patch "[PATCH] s390/mm: fix gmap tlb flush issues" failed to apply to 4.4-stable tree

PATCH [email protected] 1 participant 1 message Aug 18, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From f045402984404ddc11016358411e445192919047 Mon Sep 17 00:00:00 2001

From: David Hildenbrand <[email protected]>
Date: Thu, 7 Jul 2016 10:44:10 +0200
Subject: [PATCH] s390/mm: fix gmap tlb flush issues

__tlb_flush_asce() should never be used if multiple asce belong to a mm.

As this function changes mm logic determining if local or global tlb flushes will be neded, we might end up flushing only the gmap asce on all CPUs and a follow up mm asce flushes will only flush on the local CPU, although that asce ran on multiple CPUs.

The missing tlb flushes will provoke strange faults in user space and even low address protections in user space, crashing the kernel.

Fixes 1b948d6caec4 ("s390/mm,tlb: optimize TLB flushing for zEC12")
arch/s390/include/asm/tlbflush.h +2 -1
index e72cea7a4bfe..1a691ef740cf 100644
@@ -74,7 +74,8 @@ static inline void __tlb_flush_full(struct mm_struct *mm)
 }
 
 /*
- * Flush TLB entries for a specific ASCE on all CPUs.
+ * Flush TLB entries for a specific ASCE on all CPUs. Should never be used
+ * when more than one asce (e.g. gmap) ran on this mm.
  */
 static inline void __tlb_flush_asce(struct mm_struct *mm, unsigned long asce)
 {
arch/s390/mm/gmap.c +2 -2
index 69466f6055c2..063c721ec0dc 100644
@@ -85,7 +85,7 @@ EXPORT_SYMBOL_GPL(gmap_alloc);
 static void gmap_flush_tlb(struct gmap *gmap)
 {
 	if (MACHINE_HAS_IDTE)
-		__tlb_flush_asce(gmap->mm, gmap->asce);
+		__tlb_flush_idte(gmap->asce);
 	else
 		__tlb_flush_global();
 }
@@ -124,7 +124,7 @@ void gmap_free(struct gmap *gmap)
 
 	/* Flush tlb. */
 	if (MACHINE_HAS_IDTE)
-		__tlb_flush_asce(gmap->mm, gmap->asce);
+		__tlb_flush_idte(gmap->asce);
 	else
 		__tlb_flush_global();