Merge tag 'powerpc-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Fix oops in 32-bit BPF tail call tests

- Add missing declaration for machine_check_early_boot()

Thanks to Christophe Leroy and Naveen N. Rao.

* tag 'powerpc-6.1-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/64s: Add missing declaration for machine_check_early_boot()
powerpc/bpf/32: Fix Oops on tail call tests

Changed files
+24 -33
arch
powerpc
include
net
+1
arch/powerpc/include/asm/interrupt.h
··· 602 602 /* kernel/traps.c */ 603 603 DECLARE_INTERRUPT_HANDLER_NMI(system_reset_exception); 604 604 #ifdef CONFIG_PPC_BOOK3S_64 605 + DECLARE_INTERRUPT_HANDLER_RAW(machine_check_early_boot); 605 606 DECLARE_INTERRUPT_HANDLER_ASYNC(machine_check_exception_async); 606 607 #endif 607 608 DECLARE_INTERRUPT_HANDLER_NMI(machine_check_exception);
+23 -33
arch/powerpc/net/bpf_jit_comp32.c
··· 113 113 { 114 114 int i; 115 115 116 + /* Initialize tail_call_cnt, to be skipped if we do tail calls. */ 117 + EMIT(PPC_RAW_LI(_R4, 0)); 118 + 119 + #define BPF_TAILCALL_PROLOGUE_SIZE 4 120 + 121 + EMIT(PPC_RAW_STWU(_R1, _R1, -BPF_PPC_STACKFRAME(ctx))); 122 + 123 + if (ctx->seen & SEEN_TAILCALL) 124 + EMIT(PPC_RAW_STW(_R4, _R1, bpf_jit_stack_offsetof(ctx, BPF_PPC_TC))); 125 + 116 126 /* First arg comes in as a 32 bits pointer. */ 117 127 EMIT(PPC_RAW_MR(bpf_to_ppc(BPF_REG_1), _R3)); 118 128 EMIT(PPC_RAW_LI(bpf_to_ppc(BPF_REG_1) - 1, 0)); 119 - EMIT(PPC_RAW_STWU(_R1, _R1, -BPF_PPC_STACKFRAME(ctx))); 120 - 121 - /* 122 - * Initialize tail_call_cnt in stack frame if we do tail calls. 123 - * Otherwise, put in NOPs so that it can be skipped when we are 124 - * invoked through a tail call. 125 - */ 126 - if (ctx->seen & SEEN_TAILCALL) 127 - EMIT(PPC_RAW_STW(bpf_to_ppc(BPF_REG_1) - 1, _R1, 128 - bpf_jit_stack_offsetof(ctx, BPF_PPC_TC))); 129 - else 130 - EMIT(PPC_RAW_NOP()); 131 - 132 - #define BPF_TAILCALL_PROLOGUE_SIZE 16 133 129 134 130 /* 135 131 * We need a stack frame, but we don't necessarily need to ··· 166 170 for (i = BPF_PPC_NVR_MIN; i <= 31; i++) 167 171 if (bpf_is_seen_register(ctx, i)) 168 172 EMIT(PPC_RAW_LWZ(i, _R1, bpf_jit_stack_offsetof(ctx, i))); 173 + 174 + if (ctx->seen & SEEN_FUNC) 175 + EMIT(PPC_RAW_LWZ(_R0, _R1, BPF_PPC_STACKFRAME(ctx) + PPC_LR_STKOFF)); 176 + 177 + /* Tear down our stack frame */ 178 + EMIT(PPC_RAW_ADDI(_R1, _R1, BPF_PPC_STACKFRAME(ctx))); 179 + 180 + if (ctx->seen & SEEN_FUNC) 181 + EMIT(PPC_RAW_MTLR(_R0)); 182 + 169 183 } 170 184 171 185 void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx) ··· 183 177 EMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_0))); 184 178 185 179 bpf_jit_emit_common_epilogue(image, ctx); 186 - 187 - /* Tear down our stack frame */ 188 - 189 - if (ctx->seen & SEEN_FUNC) 190 - EMIT(PPC_RAW_LWZ(_R0, _R1, BPF_PPC_STACKFRAME(ctx) + PPC_LR_STKOFF)); 191 - 192 - EMIT(PPC_RAW_ADDI(_R1, _R1, BPF_PPC_STACKFRAME(ctx))); 193 - 194 - if (ctx->seen & SEEN_FUNC) 195 - EMIT(PPC_RAW_MTLR(_R0)); 196 180 197 181 EMIT(PPC_RAW_BLR()); 198 182 } ··· 240 244 EMIT(PPC_RAW_RLWINM(_R3, b2p_index, 2, 0, 29)); 241 245 EMIT(PPC_RAW_ADD(_R3, _R3, b2p_bpf_array)); 242 246 EMIT(PPC_RAW_LWZ(_R3, _R3, offsetof(struct bpf_array, ptrs))); 243 - EMIT(PPC_RAW_STW(_R0, _R1, bpf_jit_stack_offsetof(ctx, BPF_PPC_TC))); 244 247 245 248 /* 246 249 * if (prog == NULL) ··· 250 255 251 256 /* goto *(prog->bpf_func + prologue_size); */ 252 257 EMIT(PPC_RAW_LWZ(_R3, _R3, offsetof(struct bpf_prog, bpf_func))); 253 - 254 - if (ctx->seen & SEEN_FUNC) 255 - EMIT(PPC_RAW_LWZ(_R0, _R1, BPF_PPC_STACKFRAME(ctx) + PPC_LR_STKOFF)); 256 - 257 258 EMIT(PPC_RAW_ADDIC(_R3, _R3, BPF_TAILCALL_PROLOGUE_SIZE)); 258 - 259 - if (ctx->seen & SEEN_FUNC) 260 - EMIT(PPC_RAW_MTLR(_R0)); 261 - 262 259 EMIT(PPC_RAW_MTCTR(_R3)); 263 260 264 261 EMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_1))); 262 + 263 + /* Put tail_call_cnt in r4 */ 264 + EMIT(PPC_RAW_MR(_R4, _R0)); 265 265 266 266 /* tear restore NVRs, ... */ 267 267 bpf_jit_emit_common_epilogue(image, ctx);