powerpc/bpf: Rename PPC_BL_ABS() to PPC_BL()
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Mon, 14 Feb 2022 10:41:44 +0000 (16:11 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 7 Mar 2022 13:04:58 +0000 (00:04 +1100)
PPC_BL_ABS() is just doing a relative branch with link. The name
suggests that it is for branching to an absolute address, which is
incorrect. Rename the macro to a more appropriate PPC_BL().

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/f0e57b6c7a6ee40dba645535b70da46f46e8af5e.1644834730.git.naveen.n.rao@linux.vnet.ibm.com
arch/powerpc/net/bpf_jit.h
arch/powerpc/net/bpf_jit_comp32.c

index ea384ae836cc9c89c3a32befb6fa9ab1e834903e..dd1b338ba0644618f17d5b7e5b24386fc7a4365a 100644 (file)
@@ -34,9 +34,9 @@
                EMIT(PPC_RAW_BRANCH(offset));                                 \
        } while (0)
 
-/* blr; (unconditional 'branch' with link) to absolute address */
-#define PPC_BL_ABS(dest)       EMIT(PPC_INST_BL |                            \
-                                    (((dest) - (unsigned long)(image + ctx->idx)) & 0x03fffffc))
+/* bl (unconditional 'branch' with link) */
+#define PPC_BL(dest)   EMIT(PPC_INST_BL | (((dest) - (unsigned long)(image + ctx->idx)) & 0x03fffffc))
+
 /* "cond" here covers BO:BI fields. */
 #define PPC_BCC_SHORT(cond, dest)                                            \
        do {                                                                  \
index 511d2a203e7d62bbc7e1ac2979fdf9a36f1b71c5..b72fac52c3ca1ae7c9b6cf98d2b43f5869ac41e6 100644 (file)
@@ -198,7 +198,7 @@ int bpf_jit_emit_func_call_rel(u32 *image, struct codegen_context *ctx, u64 func
        s32 rel = (s32)func - (s32)(image + ctx->idx);
 
        if (image && rel < 0x2000000 && rel >= -0x2000000) {
-               PPC_BL_ABS(func);
+               PPC_BL(func);
                EMIT(PPC_RAW_NOP());
                EMIT(PPC_RAW_NOP());
                EMIT(PPC_RAW_NOP());