Re: [PATCH 2/3] net: bpf jit: x86: optimize choose_load_func error path

Vladimir Murzin
2013-10-13T14:31:54Z

On Sun, Oct 13, 2013 at 06:25:34PM +0400, malc wrote:
> On Sun, 13 Oct 2013, Vladimir Murzin wrote:
>
> > On Fri, Oct 11, 2013 at 02:56:13PM -0400, David Miller wrote:
> > > From: Vladimir Murzin <murzin.v@gmail.com>
> > > Date: Tue, 8 Oct 2013 20:31:49 +0400
> > >
>
> [..snip..]
>
> > -common_load: seen |= SEEN_DATAREF;
> > +common_load:
> > + if (!func) {
> > + CLEAR_A();
> > + EIT_JMP(cleanup_addr - addrs[i]);
>
> EMIT? (likewise elsewhere)
Oops... Thanks for quick response!

I'd better send the patch as a separate message.

>
> > + break;
> > + }
> > +
> > + seen |= SEEN_DATAREF;
> > t_offset = func - (image + addrs[i]);
> > EMIT1_off32(0xbe, K); /* mov imm32,%esi */
> > EMIT1_off32(0xe8, t_offset); /* call */
> > @@ -624,6 +631,13 @@ common_load: seen |= SEEN_DATAREF;
> > goto common_load;
> > case BPF_S_LDX_B_MSH:
> > func = CHOOSE_LOAD_FUNC(K, sk_load_byte_msh);
> > +
> > + if (!func) {
> > + CLEAR_A();
> > + EIT_JMP(cleanup_addr - addrs[i]);
> > + break;
> > + }
> > +
> > seen |= SEEN_DATAREF | SEEN_XREG;
> > t_offset = func - (image + addrs[i]);
> > EMIT1_off32(0xbe, K); /* mov imm32,%esi */
> >
>
> --
> mailto:av1474@comtv.ru