Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e33de12 authored by Sasha Levin's avatar Sasha Levin
Browse files

s390/mm: fix gmap tlb flush issues



[ Upstream commit f045402984404ddc11016358411e445192919047 ]

__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: 1b948d6c ("s390/mm,tlb: optimize TLB flushing for zEC12")
Cc: stable@vger.kernel.org # 3.15+
Reported-by: default avatarSascha Silbe <silbe@linux.vnet.ibm.com>
Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent b2637b76
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -207,7 +207,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();
}
@@ -246,7 +246,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();