Skip to content

Commit 8f5f525

Browse files
oohalmpe
authored andcommitted
powerpc/64: Fix flush_(d|i)cache_range() called from modules
When the kernel is compiled to use 64bit ABIv2 the _GLOBAL() macro does not include a global entry point. A function's global entry point is used when the function is called from a different TOC context and in the kernel this typically means a call from a module into the vmlinux (or vice-versa). There are a few exported asm functions declared with _GLOBAL() and calling them from a module will likely crash the kernel since any TOC relative load will yield garbage. flush_icache_range() and flush_dcache_range() are both exported to modules, and use the TOC, so must use _GLOBAL_TOC(). Fixes: 721aeaa ("powerpc: Build little endian ppc64 kernel with ABIv2") Cc: [email protected] # v3.16+ Signed-off-by: Oliver O'Halloran <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 48fe9e9 commit 8f5f525

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/kernel/misc_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ PPC64_CACHES:
6767
* flush all bytes from start through stop-1 inclusive
6868
*/
6969

70-
_GLOBAL(flush_icache_range)
70+
_GLOBAL_TOC(flush_icache_range)
7171
BEGIN_FTR_SECTION
7272
PURGE_PREFETCHED_INS
7373
blr
@@ -120,7 +120,7 @@ EXPORT_SYMBOL(flush_icache_range)
120120
*
121121
* flush all bytes from start to stop-1 inclusive
122122
*/
123-
_GLOBAL(flush_dcache_range)
123+
_GLOBAL_TOC(flush_dcache_range)
124124

125125
/*
126126
* Flush the data cache to memory

0 commit comments

Comments
 (0)