OSDN Git Service

powerpc/mm: Don't kmap_atomic() in pte_offset_map() on PPC32
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 17 Feb 2020 09:41:35 +0000 (09:41 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 Mar 2020 11:44:27 +0000 (22:44 +1100)
commit6453f9ed9d4e4b4cdf201bf34bf460c436bf50ea
tree32e12fddda6e9dcaf3da8900ec572bd9780a13d0
parentc4b78169e3667413184c9a20e11b5832288a109f
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
arch/powerpc/include/asm/book3s/32/pgtable.h
arch/powerpc/include/asm/nohash/32/pgtable.h