OSDN Git Service

powerpc/mem: flush_dcache_icache_phys() is for HIGHMEM pages only
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 8 Apr 2021 15:30:30 +0000 (15:30 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 14 Apr 2021 13:04:18 +0000 (23:04 +1000)
commit52d490437ffb1bab0a63ab7b1a64514d8c17dd4d
tree5d1032b2a055da1fe23afab79cb5e81a1e932bad
parentcd97d9e8b5aa45a7f867a10e99f1d6ce0a5deb8b
powerpc/mem: flush_dcache_icache_phys() is for HIGHMEM pages only

__flush_dcache_icache() is usable for non HIGHMEM pages on
every platform.

It is only for HIGHMEM pages that BOOKE needs kmap() and
BOOK3S needs flush_dcache_icache_phys().

So make flush_dcache_icache_phys() dependent on CONFIG_HIGHMEM and
call it only when it is a HIGHMEM page.

We could make flush_dcache_icache_phys() available at all time,
but as it is declared NOKPROBE_SYMBOL(), GCC doesn't optimise
it out when it is not used.

So define a stub for !CONFIG_HIGHMEM in order to remove the #ifdef in
flush_dcache_icache_page() and use IS_ENABLED() instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/79ed5d7914f497cd5fcd681ca2f4d50a91719455.1617895813.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/cacheflush.c