aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/powerpc/include/asm/nohash/32/pgtable.h
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2020-02-17 09:41:35 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2020-03-04 22:44:27 +1100
commit6453f9ed9d4e4b4cdf201bf34bf460c436bf50ea (patch)
tree32e12fddda6e9dcaf3da8900ec572bd9780a13d0 /arch/powerpc/include/asm/nohash/32/pgtable.h
parentpowerpc/book3s64: Fix error handling in mm_iommu_do_alloc() (diff)
downloadwireguard-linux-6453f9ed9d4e4b4cdf201bf34bf460c436bf50ea.tar.xz
wireguard-linux-6453f9ed9d4e4b4cdf201bf34bf460c436bf50ea.zip
powerpc/mm: Don't kmap_atomic() in pte_offset_map() on PPC32
On PPC32, pte_offset_map() does a kmap_atomic() in order to support page tables allocated in high memory, just like ARM and x86/32. But since at least 2008 and commit 8054a3428fbe ("powerpc: Remove dead CONFIG_HIGHPTE"), page tables are never allocated in high memory. When the page is in low mem, kmap_atomic() just returns the page address but still disable preemption and pagefault. And it is not an inlined function, so we suffer function call for no reason. Make pte_offset_map() the same as pte_offset_kernel() and make pte_unmap() void, in the same way as PPC64 which doesn't have HIGHMEM. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/03c97f0f6b3790d164822563be80f2fd4713a955.1581932480.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc/include/asm/nohash/32/pgtable.h')
-rw-r--r--arch/powerpc/include/asm/nohash/32/pgtable.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h
index 60c4d829152e..b04ba257fddb 100644
--- a/arch/powerpc/include/asm/nohash/32/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/32/pgtable.h
@@ -372,10 +372,8 @@ static inline int pte_young(pte_t pte)
#define pte_offset_kernel(dir, addr) \
(pmd_bad(*(dir)) ? NULL : (pte_t *)pmd_page_vaddr(*(dir)) + \
pte_index(addr))
-#define pte_offset_map(dir, addr) \
- ((pte_t *)(kmap_atomic(pmd_page(*(dir))) + \
- (pmd_page_vaddr(*(dir)) & ~PAGE_MASK)) + pte_index(addr))
-#define pte_unmap(pte) kunmap_atomic(pte)
+#define pte_offset_map(dir, addr) pte_offset_kernel((dir), (addr))
+static inline void pte_unmap(pte_t *pte) { }
/*
* Encode and decode a swap entry.