> diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
> index 054e043ffcd2..68c5f9f94e5e 100644
> --- a/arch/x86/net/bpf_jit_comp.c
> +++ b/arch/x86/net/bpf_jit_comp.c

[ ... ]

> @@ -1110,6 +1121,90 @@ static void maybe_emit_1mod(u8 **pprog, u32 reg, bool 
> is64)

[ ... ]

> +     /* Save rax */
> +     EMIT1(0x50);
> +     /* Save rcx */
> +     EMIT1(0x51);
> +     /* Save rdx */
> +     EMIT1(0x52);
> +     /* Save rsi */
> +     EMIT1(0x56);
> +     /* Save rdi */
> +     EMIT1(0x57);
> +     /* Save r8 */
> +     EMIT2(0x41, 0x50);
> +     /* Save r9 */
> +     EMIT2(0x41, 0x51);

[ ... ]

> +     EMIT2(0x41, 0x59);
> +     EMIT2(0x41, 0x58);
> +     EMIT1(0x5F);
> +     EMIT1(0x5E);
> +     EMIT1(0x5A);
> +     EMIT1(0x59);
> +     EMIT1(0x58);

This isn't a bug, but the save block annotates each push with its target
register (/* Save rax */, /* Save rcx */, ... /* Save r9 */), while the
matching restore block emits the seven pops with no comments at all.
Would adding the mirrored comments here (/* Restore r9 */, /* Restore r8 */,
... /* Restore rax */) make the push/pop symmetry easier to check at a
glance?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/28510424881

Reply via email to