lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 29 Jan 2018 15:06:16 +0100
From:   Willy Tarreau <w@....eu>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Alexei Starovoitov <ast@...nel.org>,
        netdev <netdev@...r.kernel.org>,
        "David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH stable 4.9 1/8] x86: bpf_jit: small optimization in
 emit_bpf_tail_call()

Hi Eric,

On Mon, Jan 29, 2018 at 06:04:30AM -0800, Eric Dumazet wrote:
> > If these 4 bytes matter, why not use
> > cmpq with an immediate value instead, which saves 2 extra bytes ? :
> >
> >   - the mov above is 11 bytes total :
> >
> >    0:   48 8b 84 d6 78 56 34    mov    0x12345678(%rsi,%rdx,8),%rax
> >    7:   12
> >    8:   48 85 c0                test   %rax,%rax
> >
> >   - the equivalent cmp is only 9 bytes :
> >
> >    0:   48 83 bc d6 78 56 34    cmpq   $0x0,0x12345678(%rsi,%rdx,8)
> >    7:   12 00
> >
> > And as a bonus, it doesn't even clobber rax.
> >
> > Just my two cents,
> 
> 
> Hi Willy
> 
> Please look more closely at following instructions.
> 
> We need the value later, not only testing it being zero :)

Ah OK that makes total sense then ;-)

Thanks,
willy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ