bpf powerpc: Remove extra_pass from bpf_jit_build_body()
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>
Tue, 12 Oct 2021 12:30:50 +0000 (18:00 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 25 Nov 2021 00:25:31 +0000 (11:25 +1100)
In case of extra_pass, usual JIT passes are always skipped. So,
extra_pass is always false while calling bpf_jit_build_body() and
can be removed.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211012123056.485795-3-hbathini@linux.ibm.com
arch/powerpc/net/bpf_jit.h
arch/powerpc/net/bpf_jit_comp.c
arch/powerpc/net/bpf_jit_comp32.c
arch/powerpc/net/bpf_jit_comp64.c

index 89bd744c2bffd42b60670ed9f03c2801be44f110..7145b651fc2a7ed42dc9376ef954e62c184693dc 100644 (file)
@@ -175,7 +175,7 @@ static inline void bpf_clear_seen_register(struct codegen_context *ctx, int i)
 
 void bpf_jit_emit_func_call_rel(u32 *image, struct codegen_context *ctx, u64 func);
 int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *ctx,
-                      u32 *addrs, bool extra_pass);
+                      u32 *addrs);
 void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx);
 void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx);
 void bpf_jit_realloc_regs(struct codegen_context *ctx);
index 90ce75f0f1e2aeb531655cdbd9c75d03d688b10b..f39ad8d123ddda7390c33ddaa6bb80b579750a43 100644 (file)
@@ -149,7 +149,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
        cgctx.stack_size = round_up(fp->aux->stack_depth, 16);
 
        /* Scouting faux-generate pass 0 */
-       if (bpf_jit_build_body(fp, 0, &cgctx, addrs, false)) {
+       if (bpf_jit_build_body(fp, 0, &cgctx, addrs)) {
                /* We hit something illegal or unsupported. */
                fp = org_fp;
                goto out_addrs;
@@ -162,7 +162,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
         */
        if (cgctx.seen & SEEN_TAILCALL) {
                cgctx.idx = 0;
-               if (bpf_jit_build_body(fp, 0, &cgctx, addrs, false)) {
+               if (bpf_jit_build_body(fp, 0, &cgctx, addrs)) {
                        fp = org_fp;
                        goto out_addrs;
                }
@@ -210,7 +210,7 @@ skip_init_ctx:
                /* Now build the prologue, body code & epilogue for real. */
                cgctx.idx = 0;
                bpf_jit_build_prologue(code_base, &cgctx);
-               if (bpf_jit_build_body(fp, code_base, &cgctx, addrs, extra_pass)) {
+               if (bpf_jit_build_body(fp, code_base, &cgctx, addrs)) {
                        bpf_jit_binary_free(bpf_hdr);
                        fp = org_fp;
                        goto out_addrs;
index 0da31d41d4131068fa5543cbe0dbdd30051f13fb..903f945601c0b2aa08c9bebb4feaf40499eac09b 100644 (file)
@@ -268,7 +268,7 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o
 
 /* Assemble the body code between the prologue & epilogue */
 int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *ctx,
-                      u32 *addrs, bool extra_pass)
+                      u32 *addrs)
 {
        const struct bpf_insn *insn = fp->insnsi;
        int flen = fp->len;
@@ -862,7 +862,7 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *
                case BPF_JMP | BPF_CALL:
                        ctx->seen |= SEEN_FUNC;
 
-                       ret = bpf_jit_get_func_addr(fp, &insn[i], extra_pass,
+                       ret = bpf_jit_get_func_addr(fp, &insn[i], false,
                                                    &func_addr, &func_addr_fixed);
                        if (ret < 0)
                                return ret;
index 8b5157ccfebae55e9a6e0e2e42a05497d661be38..b25bf9b11b9db21fbd05b4111ac70f292c0d4543 100644 (file)
@@ -297,7 +297,7 @@ asm (
 
 /* Assemble the body code between the prologue & epilogue */
 int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *ctx,
-                      u32 *addrs, bool extra_pass)
+                      u32 *addrs)
 {
        enum stf_barrier_type stf_barrier = stf_barrier_type_get();
        const struct bpf_insn *insn = fp->insnsi;
@@ -831,7 +831,7 @@ emit_clear:
                case BPF_JMP | BPF_CALL:
                        ctx->seen |= SEEN_FUNC;
 
-                       ret = bpf_jit_get_func_addr(fp, &insn[i], extra_pass,
+                       ret = bpf_jit_get_func_addr(fp, &insn[i], false,
                                                    &func_addr, &func_addr_fixed);
                        if (ret < 0)
                                return ret;