From: Thomas Gleixner <hidden> Date: 2021-01-12 17:05:53
The kmap_local conversion wreckaged sparc, mips and powerpc as it missed
some of the details in the original implementation.
The following series addresses that.
Thanks,
tglx
---
arch/mips/include/asm/highmem.h | 1 +
arch/sparc/include/asm/highmem.h | 9 +++++----
b/arch/powerpc/include/asm/highmem.h | 2 ++
mm/highmem.c | 7 ++++++-
4 files changed, 14 insertions(+), 5 deletions(-)
From: Thomas Gleixner <hidden> Date: 2021-01-12 17:05:53
set_pte_at() on MIPS invokes update_cache() which might recurse into
kmap_local(). Use set_pte() like the original MIPS highmem implementation
did.
Fixes: a4c33e83bca1 ("mips/mm/highmem: Switch to generic kmap atomic")
Reported-by: Paul Cercueil <paul@crapouillou.net>
Reported-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Thomas Gleixner <redacted>
---
arch/mips/include/asm/highmem.h | 1 +
1 file changed, 1 insertion(+)
From: Thomas Gleixner <hidden> Date: 2021-01-12 17:05:53
The generic kmap_local() map function uses set_pte_at(), but MIPS requires
set_pte() and PowerPC wants __set_pte_at().
Provide arch_kmap_local_set_pte() and default it to set_pte_at().
Signed-off-by: Thomas Gleixner <redacted>
---
mm/highmem.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/mm/highmem.c+++ b/mm/highmem.c
@@ -473,6 +473,11 @@ static inline void *arch_kmap_local_high}#endif+#ifndef arch_kmap_local_set_pte+#define arch_kmap_local_set_pte(mm, vaddr, ptep, ptev) \+set_pte_at(mm,vaddr,ptep,ptev)+#endif+/* Unmap a local mapping which was obtained by kmap_high_get() */staticinlineboolkmap_high_unmap_local(unsignedlongvaddr){
From: Thomas Gleixner <hidden> Date: 2021-01-12 17:06:15
The original PowerPC highmem mapping function used __set_pte_at() to denote
that the mapping is per CPU. This got lost with the conversion to the
generic implementation.
Override the default map function.
Fixes: 47da42b27a56 ("powerpc/mm/highmem: Switch to generic kmap atomic")
Signed-off-by: Thomas Gleixner <redacted>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/include/asm/highmem.h | 2 ++
1 file changed, 2 insertions(+)
@@ -50,10 +50,11 @@ extern pte_t *pkmap_page_table;#define flush_cache_kmaps() flush_cache_all()-/* FIXME: Use __flush_tlb_one(vaddr) instead of flush_cache_all() -- Anton */-#define arch_kmap_local_post_map(vaddr, pteval) flush_cache_all()-#define arch_kmap_local_post_unmap(vaddr) flush_cache_all()-+/* FIXME: Use __flush_*_one(vaddr) instead of flush_*_all() -- Anton */+#define arch_kmap_local_pre_map(vaddr, pteval) flush_cache_all()+#define arch_kmap_local_pre_unmap(vaddr) flush_cache_all()+#define arch_kmap_local_post_map(vaddr, pteval) flush_tlb_all()+#define arch_kmap_local_post_unmap(vaddr) flush_tlb_all()#endif /* __KERNEL__ */
Yes! I found, just an hour before your patched was posted, that an
equivalent fix helped back where the switch-to-generic patch first
occurred. This patch was successfully tested on master.
Tested-by: Andreas Larsson <andreas@gaisler.com>
--
Andreas Larsson
Cobham Gaisler
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Date: 2021-01-13 11:00:52
On Tue, Jan 12, 2021 at 06:01:39PM +0100, Thomas Gleixner wrote:
set_pte_at() on MIPS invokes update_cache() which might recurse into
kmap_local(). Use set_pte() like the original MIPS highmem implementation
did.
Fixes: a4c33e83bca1 ("mips/mm/highmem: Switch to generic kmap atomic")
Reported-by: Paul Cercueil <paul@crapouillou.net>
Reported-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Thomas Gleixner <redacted>
---
arch/mips/include/asm/highmem.h | 1 +
1 file changed, 1 insertion(+)
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]