Re: [PATCH v2 6/9] arm64: cfi: Use CONFIG_ARM64_FUNCTION_PREFIX_NOPS for the type hash offset
From: Alexei Starovoitov
Date: Thu Sep 24 2026 - 19:40:26 EST
On Thu, Sep 24, 2026 at 10:35 PM Jose Fernandez (Anthropic) <jose.fernandez@xxxxxxxxx> wrote:
> static inline void emit_kcfi(u32 hash, struct jit_ctx *ctx)
> {
> - if (IS_ENABLED(CONFIG_CFI))
> - emit_u32_data(hash, ctx);
> + if (!IS_ENABLED(CONFIG_CFI))
> + return;
> +
> + emit_u32_data(hash, ctx);
> + for (int i = 0; i < CONFIG_ARM64_FUNCTION_PREFIX_NOPS; i++)
> + emit(A64_NOP, ctx);
> }
For the series:
Acked-by: Alexei Starovoitov <ast@xxxxxxxxxx>
unrelated minor issue:
ctx.offset[] is counted from ro_image, but bpf_prog_fill_jited_linfo()
adds it to prog->bpf_func which is ro_image + cfi_get_offset().
So with CFI jited_line_info is already off by one insn.
After this patch it will be off by 4 or 6.
s390 does
jit.addrs[i] -= cfi_get_offset();
before the call.
Would be great to send a follow up eventually.