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]
Date:   Wed, 17 Mar 2021 16:35:36 +0100 (CET)
From:   "Maciej W. Rozycki" <macro@...am.me.uk>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
cc:     David Laight <David.Laight@...LAB.COM>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Xuefeng Li <lixuefeng@...ngson.cn>
Subject: Re: [PATCH v2] MIPS: Check __clang__ to avoid performance influence
 with GCC in csum_tcpudp_nofold()

On Wed, 17 Mar 2021, Tiezhu Yang wrote:

> > > The code produced by GCC remains the same between (1), (3) and (4),
> > > the last changes looks like better (with less changes based on commit
> > > 198688edbf77), so I will send v3 later.
> > Aren't those all the same - apart from register selection.

 I did a quick size check with my MIPS64 config between (1) and (2):

       text       data        bss      total filename
-   6129704    2997475     215280    9342459 vmlinux
+   6129752    2997475     215280    9342507 vmlinux

so obviously there's more to that and the code snippets quoted did not 
show the full picture.  The size difference is in `tcp_v4_send_reset' 
AFAICT, maybe elsewhere as well.

 FAOD the former binary is as at 198688edbf77^ and the latter is as at 
198688edbf77, and the command used was `size --format=gnu' to prevent 
`.rodata' from interfering with the text size.

> > Not that I grok the mips opcodes.
> > But that code has horridness on its side.

 It's a 32-bit one's-complement addition.  The use of 64-bit operations 
reduces the number of calculations as any 32-bit carries accumulate in the 
high 32-bit word allowing one instruction to be saved total compared to 
the 32-bit variant.  Nothing particularly unusual for me here; I've seen 
worse stuff with x86.

> Is this patch necessary? If no, we can ignore it.
> If yes, I will send v3 with the above (4) changes.

 I have also verified this patch directly on top of 198688edbf77 and it 
does not bring the old `vmlinux' size back (there's no difference in code 
produced at all here actually), so you need to investigate this further.  
This is with an older checkout of GCC 11.

 I've attached a stripped version of my .config that you can use for 
reference.

  Maciej

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ