Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Replace PPC64_ELF_ABI_v{1/2} by CONFIG_PPC64_ELF_ABI_V{1/2}

Replace all uses of PPC64_ELF_ABI_v1 and PPC64_ELF_ABI_v2 by
resp CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ba13d59e8c50bc9aa6328f1c7f0c0d0278e0a3a7.1652074503.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
7d40aff8 661aa880

+31 -31
+6 -6
arch/powerpc/include/asm/code-patching.h
··· 132 132 133 133 static inline unsigned long ppc_function_entry(void *func) 134 134 { 135 - #ifdef PPC64_ELF_ABI_v2 135 + #ifdef CONFIG_PPC64_ELF_ABI_V2 136 136 u32 *insn = func; 137 137 138 138 /* ··· 157 157 return (unsigned long)(insn + 2); 158 158 else 159 159 return (unsigned long)func; 160 - #elif defined(PPC64_ELF_ABI_v1) 160 + #elif defined(CONFIG_PPC64_ELF_ABI_V1) 161 161 /* 162 162 * On PPC64 ABIv1 the function pointer actually points to the 163 163 * function's descriptor. The first entry in the descriptor is the ··· 171 171 172 172 static inline unsigned long ppc_global_function_entry(void *func) 173 173 { 174 - #ifdef PPC64_ELF_ABI_v2 174 + #ifdef CONFIG_PPC64_ELF_ABI_V2 175 175 /* PPC64 ABIv2 the global entry point is at the address */ 176 176 return (unsigned long)func; 177 177 #else ··· 188 188 static inline unsigned long ppc_kallsyms_lookup_name(const char *name) 189 189 { 190 190 unsigned long addr; 191 - #ifdef PPC64_ELF_ABI_v1 191 + #ifdef CONFIG_PPC64_ELF_ABI_V1 192 192 /* check for dot variant */ 193 193 char dot_name[1 + KSYM_NAME_LEN]; 194 194 bool dot_appended = false; ··· 209 209 if (!addr && dot_appended) 210 210 /* Let's try the original non-dot symbol lookup */ 211 211 addr = kallsyms_lookup_name(name); 212 - #elif defined(PPC64_ELF_ABI_v2) 212 + #elif defined(CONFIG_PPC64_ELF_ABI_V2) 213 213 addr = kallsyms_lookup_name(name); 214 214 if (addr) 215 215 addr = ppc_function_entry((void *)addr); ··· 226 226 */ 227 227 228 228 /* This must match the definition of STK_GOT in <asm/ppc_asm.h> */ 229 - #ifdef PPC64_ELF_ABI_v2 229 + #ifdef CONFIG_PPC64_ELF_ABI_V2 230 230 #define R2_STACK_OFFSET 24 231 231 #else 232 232 #define R2_STACK_OFFSET 40
+2 -2
arch/powerpc/include/asm/ftrace.h
··· 64 64 * those. 65 65 */ 66 66 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 67 - #ifdef PPC64_ELF_ABI_v1 67 + #ifdef CONFIG_PPC64_ELF_ABI_V1 68 68 static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) 69 69 { 70 70 /* We need to skip past the initial dot, and the __se_sys alias */ ··· 83 83 (!strncmp(sym, "ppc32_", 6) && !strcmp(sym + 6, name + 4)) || 84 84 (!strncmp(sym, "ppc64_", 6) && !strcmp(sym + 6, name + 4)); 85 85 } 86 - #endif /* PPC64_ELF_ABI_v1 */ 86 + #endif /* CONFIG_PPC64_ELF_ABI_V1 */ 87 87 #endif /* CONFIG_FTRACE_SYSCALLS */ 88 88 89 89 #ifdef CONFIG_PPC64
+1 -1
arch/powerpc/include/asm/linkage.h
··· 4 4 5 5 #include <asm/types.h> 6 6 7 - #ifdef PPC64_ELF_ABI_v1 7 + #ifdef CONFIG_PPC64_ELF_ABI_V1 8 8 #define cond_syscall(x) \ 9 9 asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n" \ 10 10 "\t.weak ." #x "\n\t.set ." #x ", .sys_ni_syscall\n")
+2 -2
arch/powerpc/include/asm/ppc_asm.h
··· 149 149 #define __STK_REG(i) (112 + ((i)-14)*8) 150 150 #define STK_REG(i) __STK_REG(__REG_##i) 151 151 152 - #ifdef PPC64_ELF_ABI_v2 152 + #ifdef CONFIG_PPC64_ELF_ABI_V2 153 153 #define STK_GOT 24 154 154 #define __STK_PARAM(i) (32 + ((i)-3)*8) 155 155 #else ··· 158 158 #endif 159 159 #define STK_PARAM(i) __STK_PARAM(__REG_##i) 160 160 161 - #ifdef PPC64_ELF_ABI_v2 161 + #ifdef CONFIG_PPC64_ELF_ABI_V2 162 162 163 163 #define _GLOBAL(name) \ 164 164 .align 2 ; \
+1 -1
arch/powerpc/include/asm/ptrace.h
··· 120 120 STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE) 121 121 #define STACK_FRAME_MARKER 12 122 122 123 - #ifdef PPC64_ELF_ABI_v2 123 + #ifdef CONFIG_PPC64_ELF_ABI_V2 124 124 #define STACK_FRAME_MIN_SIZE 32 125 125 #else 126 126 #define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD
+1 -1
arch/powerpc/kernel/head_64.S
··· 435 435 ld r12,CPU_SPEC_RESTORE(r23) 436 436 cmpdi 0,r12,0 437 437 beq 3f 438 - #ifdef PPC64_ELF_ABI_v1 438 + #ifdef CONFIG_PPC64_ELF_ABI_V1 439 439 ld r12,0(r12) 440 440 #endif 441 441 mtctr r12
+1 -1
arch/powerpc/kernel/interrupt_64.S
··· 711 711 REST_NVGPRS(r1) 712 712 mtctr r14 713 713 mr r3,r15 714 - #ifdef PPC64_ELF_ABI_v2 714 + #ifdef CONFIG_PPC64_ELF_ABI_V2 715 715 mr r12,r14 716 716 #endif 717 717 bctrl
+3 -3
arch/powerpc/kernel/kprobes.c
··· 45 45 { 46 46 kprobe_opcode_t *addr = NULL; 47 47 48 - #ifdef PPC64_ELF_ABI_v2 48 + #ifdef CONFIG_PPC64_ELF_ABI_V2 49 49 /* PPC64 ABIv2 needs local entry point */ 50 50 addr = (kprobe_opcode_t *)kallsyms_lookup_name(name); 51 51 if (addr && !offset) { ··· 63 63 #endif 64 64 addr = (kprobe_opcode_t *)ppc_function_entry(addr); 65 65 } 66 - #elif defined(PPC64_ELF_ABI_v1) 66 + #elif defined(CONFIG_PPC64_ELF_ABI_V1) 67 67 /* 68 68 * 64bit powerpc ABIv1 uses function descriptors: 69 69 * - Check for the dot variant of the symbol first. ··· 107 107 108 108 static bool arch_kprobe_on_func_entry(unsigned long offset) 109 109 { 110 - #ifdef PPC64_ELF_ABI_v2 110 + #ifdef CONFIG_PPC64_ELF_ABI_V2 111 111 #ifdef CONFIG_KPROBES_ON_FTRACE 112 112 return offset <= 16; 113 113 #else
+1 -1
arch/powerpc/kernel/misc_64.S
··· 454 454 beq 1f 455 455 456 456 /* clear out hardware hash page table and tlb */ 457 - #ifdef PPC64_ELF_ABI_v1 457 + #ifdef CONFIG_PPC64_ELF_ABI_V1 458 458 ld r12,0(r27) /* deref function descriptor */ 459 459 #else 460 460 mr r12,r27
+2 -2
arch/powerpc/kernel/module.c
··· 64 64 (void *)sect->sh_addr + sect->sh_size); 65 65 #endif /* CONFIG_PPC64 */ 66 66 67 - #ifdef PPC64_ELF_ABI_v1 67 + #ifdef CONFIG_PPC64_ELF_ABI_V1 68 68 sect = find_section(hdr, sechdrs, ".opd"); 69 69 if (sect != NULL) { 70 70 me->arch.start_opd = sect->sh_addr; 71 71 me->arch.end_opd = sect->sh_addr + sect->sh_size; 72 72 } 73 - #endif /* PPC64_ELF_ABI_v1 */ 73 + #endif /* CONFIG_PPC64_ELF_ABI_V1 */ 74 74 75 75 #ifdef CONFIG_PPC_BARRIER_NOSPEC 76 76 sect = find_section(hdr, sechdrs, "__spec_barrier_fixup");
+2 -2
arch/powerpc/kernel/module_64.c
··· 31 31 this, and makes other things simpler. Anton? 32 32 --RR. */ 33 33 34 - #ifdef PPC64_ELF_ABI_v2 34 + #ifdef CONFIG_PPC64_ELF_ABI_V2 35 35 36 36 static func_desc_t func_desc(unsigned long addr) 37 37 { ··· 122 122 /* Save current r2 value in magic place on the stack. */ 123 123 PPC_RAW_STD(_R2, _R1, R2_STACK_OFFSET), 124 124 PPC_RAW_LD(_R12, _R11, 32), 125 - #ifdef PPC64_ELF_ABI_v1 125 + #ifdef CONFIG_PPC64_ELF_ABI_V1 126 126 /* Set up new r2 from function descriptor */ 127 127 PPC_RAW_LD(_R2, _R11, 40), 128 128 #endif
+1 -1
arch/powerpc/kernel/ptrace/ptrace.c
··· 445 445 */ 446 446 BUILD_BUG_ON(PT_DSCR < sizeof(struct user_pt_regs) / sizeof(unsigned long)); 447 447 448 - #ifdef PPC64_ELF_ABI_v1 448 + #ifdef CONFIG_PPC64_ELF_ABI_V1 449 449 BUILD_BUG_ON(!IS_ENABLED(CONFIG_HAVE_FUNCTION_DESCRIPTORS)); 450 450 #else 451 451 BUILD_BUG_ON(IS_ENABLED(CONFIG_HAVE_FUNCTION_DESCRIPTORS));
+2 -2
arch/powerpc/kernel/trace/ftrace.c
··· 953 953 #endif 954 954 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 955 955 956 - #ifdef PPC64_ELF_ABI_v1 956 + #ifdef CONFIG_PPC64_ELF_ABI_V1 957 957 char *arch_ftrace_match_adjust(char *str, const char *search) 958 958 { 959 959 if (str[0] == '.' && search[0] != '.') ··· 961 961 else 962 962 return str; 963 963 } 964 - #endif /* PPC64_ELF_ABI_v1 */ 964 + #endif /* CONFIG_PPC64_ELF_ABI_V1 */
+1 -1
arch/powerpc/kvm/book3s_interrupts.S
··· 15 15 #include <asm/asm-compat.h> 16 16 17 17 #if defined(CONFIG_PPC_BOOK3S_64) 18 - #ifdef PPC64_ELF_ABI_v2 18 + #ifdef CONFIG_PPC64_ELF_ABI_V2 19 19 #define FUNC(name) name 20 20 #else 21 21 #define FUNC(name) GLUE(.,name)
+1 -1
arch/powerpc/kvm/book3s_rmhandlers.S
··· 26 26 27 27 #if defined(CONFIG_PPC_BOOK3S_64) 28 28 29 - #ifdef PPC64_ELF_ABI_v2 29 + #ifdef CONFIG_PPC64_ELF_ABI_V2 30 30 #define FUNC(name) name 31 31 #else 32 32 #define FUNC(name) GLUE(.,name)
+1 -1
arch/powerpc/net/bpf_jit.h
··· 13 13 #include <asm/types.h> 14 14 #include <asm/ppc-opcode.h> 15 15 16 - #ifdef PPC64_ELF_ABI_v1 16 + #ifdef CONFIG_PPC64_ELF_ABI_V1 17 17 #define FUNCTION_DESCR_SIZE 24 18 18 #else 19 19 #define FUNCTION_DESCR_SIZE 0
+1 -1
arch/powerpc/net/bpf_jit_comp.c
··· 276 276 */ 277 277 bpf_jit_dump(flen, proglen, pass, code_base); 278 278 279 - #ifdef PPC64_ELF_ABI_v1 279 + #ifdef CONFIG_PPC64_ELF_ABI_V1 280 280 /* Function descriptor nastiness: Address + TOC */ 281 281 ((u64 *)image)[0] = (u64)code_base; 282 282 ((u64 *)image)[1] = local_paca->kernel_toc;
+2 -2
arch/powerpc/net/bpf_jit_comp64.c
··· 126 126 { 127 127 int i; 128 128 129 - if (__is_defined(PPC64_ELF_ABI_v2)) 129 + if (__is_defined(CONFIG_PPC64_ELF_ABI_V2)) 130 130 EMIT(PPC_RAW_LD(_R2, _R13, offsetof(struct paca_struct, kernel_toc))); 131 131 132 132 /* ··· 266 266 int b2p_index = bpf_to_ppc(BPF_REG_3); 267 267 int bpf_tailcall_prologue_size = 8; 268 268 269 - if (__is_defined(PPC64_ELF_ABI_v2)) 269 + if (__is_defined(CONFIG_PPC64_ELF_ABI_V2)) 270 270 bpf_tailcall_prologue_size += 4; /* skip past the toc load */ 271 271 272 272 /*