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] [thread-next>] [day] [month] [year] [list]
Message-ID: <476B65F8.10201@cosmosbay.com>
Date:	Fri, 21 Dec 2007 08:06:32 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	YOSHIFUJI Hideaki / 吉藤英明 
	<yoshfuji@...ux-ipv6.org>
CC:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

YOSHIFUJI Hideaki / 吉藤英明 a écrit :
> In article <476B574E.80601@...mosbay.com> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <dada1@...mosbay.com> says:
> 
>> Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 forces compiler
>> to emit an integer divide, while we can help it to use a right shift,
>> less expensive.
> 
> Are you really sure?
> At least, gcc-4.1.2-20061115 (debian) does not make any difference.
> 
> And, IMHO, because shift for signed variable is fragile, so we should
> avoid using it.
> 

Yes I am sure, but maybe you are on x86_64 ?

gcc-4.2.2 on x86

# objdump --disassemble net/ipv6/tcp_ipv6.o|grep -6 idiv
       b2:       66 8b 42 02             mov    0x2(%edx),%ax
       b6:       ba 04 00 00 00          mov    $0x4,%edx
       bb:       89 d7                   mov    %edx,%edi
       bd:       66 89 45 00             mov    %ax,0x0(%ebp)
       c1:       89 d8                   mov    %ebx,%eax
       c3:       99                      cltd
       c4:       f7 ff                   idiv   %edi
       c6:       88 c2                   mov    %al,%dl
       c8:       8a 45 0c                mov    0xc(%ebp),%al
       cb:       c1 e2 04                shl    $0x4,%edx
       ce:       83 e0 0f                and    $0xf,%eax
       d1:       09 d0                   or     %edx,%eax
       d3:       88 45 0c                mov    %al,0xc(%ebp)


If you think tot_len can be negative, I understand you can be against this 
patch. But I am sure it's allways > 0, even if I am a total ipv6 newbie :)

Thank you
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ