Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc/mm/highmem: flush cache and TLB

Patch series "mm/highmem: Fix fallout from generic kmap_local
conversions".

The kmap_local conversion wreckaged sparc, mips and powerpc as it missed
some of the details in the original implementation.

This patch (of 4):

The recent conversion to the generic kmap_local infrastructure failed to
assign the proper pre/post map/unmap flush operations for sparc.

Sparc requires cache flush before map/unmap and tlb flush afterwards.

Link: https://lkml.kernel.org/r/20210112170136.078559026@linutronix.de
Link: https://lkml.kernel.org/r/20210112170410.905976187@linutronix.de
Fixes: 3293efa97807 ("sparc/mm/highmem: Switch to generic kmap atomic")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Andreas Larsson <andreas@gaisler.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Thomas Gleixner and committed by
Linus Torvalds
f99e0237 dad4e5b3

+5 -4
+5 -4
arch/sparc/include/asm/highmem.h
··· 50 50 51 51 #define flush_cache_kmaps() flush_cache_all() 52 52 53 - /* FIXME: Use __flush_tlb_one(vaddr) instead of flush_cache_all() -- Anton */ 54 - #define arch_kmap_local_post_map(vaddr, pteval) flush_cache_all() 55 - #define arch_kmap_local_post_unmap(vaddr) flush_cache_all() 56 - 53 + /* FIXME: Use __flush_*_one(vaddr) instead of flush_*_all() -- Anton */ 54 + #define arch_kmap_local_pre_map(vaddr, pteval) flush_cache_all() 55 + #define arch_kmap_local_pre_unmap(vaddr) flush_cache_all() 56 + #define arch_kmap_local_post_map(vaddr, pteval) flush_tlb_all() 57 + #define arch_kmap_local_post_unmap(vaddr) flush_tlb_all() 57 58 58 59 #endif /* __KERNEL__ */ 59 60