BPF List
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: bot+bpf-ci@kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	bpf@vger.kernel.org, martin.lau@linux.dev, eddyz87@gmail.com,
	song@kernel.org, yonghong.song@linux.dev, rppt@kernel.org,
	martin.lau@kernel.org, mason@kernel.org, ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next 2/3] bpf, x86: Introduce JIT emission context
Date: Tue, 1 Sep 2026 10:11:39 +0200	[thread overview]
Message-ID: <apaIuxCD3HyZeiDN@krava> (raw)
In-Reply-To: <d3b30565c015a75c09b1b79b4684bf3399f8db42f0aad1d5faaf3267ba817f0d@mail.kernel.org>

On Mon, Aug 31, 2026 at 12:54:35PM +0000, bot+bpf-ci@kernel.org wrote:
> > diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
> > index 5922bb4728aad..eff0523161c3e 100644
> > --- a/arch/x86/net/bpf_jit_comp.c
> > +++ b/arch/x86/net/bpf_jit_comp.c
> 
> [ ... ]
> 
> > @@ -947,10 +898,9 @@ static void bpf_tail_call_direct_fixup(struct bpf_prog *prog)
> >  	}
> >  }
> >
> > -static void emit_mov_imm32(u8 **pprog, bool sign_propagate,
> > +static void emit_mov_imm32(struct jit_emit_context *jit, bool sign_propagate,
> >  			   u32 dst_reg, const u32 imm32)
> >  {
> > -	u8 *prog = *pprog;
> >  	u8 b1, b2, b3;
> >
> >  	/*
> > @@ -984,14 +934,12 @@ static void emit_mov_imm32(u8 **pprog, bool sign_propagate,
> >  		EMIT1(add_1mod(0x40, dst_reg));
> >  	EMIT1_off32(add_1reg(0xB8, dst_reg), imm32);
> >  done:
> > -	*pprog = prog;
> >  }
> 
> Does this break the build? Removing the trailing '*pprog = prog;' leaves
> the 'done:' label as the last thing in the function body, with no statement
> after it. C11 and C17 require a labeled-statement to be 'identifier ':'
> statement', where a closing brace is not a statement. Labels at the end of
> a compound statement were only legalized in C23 (N2508). The kernel builds
> with '-std=gnu11' (per the top-level Makefile), so GCC will reject this with
> 'error: label at end of compound statement' and Clang with 'error: expected
> statement' when using any currently supported minimum toolchain. Only GCC
> >= 11 silently accepts it (downgrading to a pedwarn that's off without
> -Wpedantic), which is why the breakage can hide on a modern build host.
> 
> The function has two 'goto done;' statements earlier (the sign-propagate
> path and the imm32 == 0 path), so the label cannot simply be dropped. Could
> the label be given a statement, such as 'done:\n\treturn;' or 'done:\n\t;',
> or could the two gotos be replaced with 'return;' and the label removed?

yea, I overlooked that, we can simple replace goto with return

jirka

  reply	other threads:[~2026-09-01  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 11:46 [PATCH bpf-next 0/3] bpf, x86: Add jit dry run mode Jiri Olsa
2026-08-31 11:46 ` [PATCH bpf-next 1/3] bpf, x86: Split x86_call_depth_emit_accounting in two functions Jiri Olsa
2026-08-31 11:46 ` [PATCH bpf-next 2/3] bpf, x86: Introduce JIT emission context Jiri Olsa
2026-08-31 12:54   ` bot+bpf-ci
2026-09-01  8:11     ` Jiri Olsa [this message]
2026-08-31 11:46 ` [PATCH bpf-next 3/3] bpf, x86: Add support for jit dry run Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=apaIuxCD3HyZeiDN@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mason@kernel.org \
    --cc=rppt@kernel.org \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox