]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/pseries: move hcall_tracepoint_refcount out of .toc
authorNicholas Piggin <npiggin@gmail.com>
Mon, 26 Sep 2022 05:38:23 +0000 (15:38 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 26 Sep 2022 10:57:42 +0000 (20:57 +1000)
The .toc section is not really intended for arbitrary data. Writable
data in particular prevents making the TOC read-only after relocation.
Move hcall_tracepoint_refcount into the .data section.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220926053823.2668799-1-npiggin@gmail.com
arch/powerpc/platforms/pseries/hvCall.S

index ab9fc65068617b570d881bd85ed5880e76aae13a..762eb15d3bd42645d3a13287986eb7fef3c558a4 100644 (file)
@@ -16,7 +16,7 @@
 #ifdef CONFIG_TRACEPOINTS
 
 #ifndef CONFIG_JUMP_LABEL
-       .section        ".toc","aw"
+       .data
 
        .globl hcall_tracepoint_refcount
 hcall_tracepoint_refcount:
@@ -88,7 +88,7 @@ hcall_tracepoint_refcount:
 BEGIN_FTR_SECTION;                                             \
        b       1f;                                             \
 END_FTR_SECTION(0, 1);                                         \
-       ld      r12,hcall_tracepoint_refcount@toc(r2);          \
+       LOAD_REG_ADDR(r12, hcall_tracepoint_refcount) ;         \
        std     r12,32(r1);                                     \
        cmpdi   r12,0;                                          \
        bne-    LABEL;                                          \