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:   Fri, 9 Sep 2022 05:01:56 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Segher Boessenkool <segher@...nel.crashing.org>
CC:     Michael Ellerman <mpe@...erman.id.au>,
        Mathieu Malaterre <malat@...ian.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Paul Mackerras <paulus@...ba.org>,
        Joel Stanley <joel@....id.au>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH] powerpc/lib/xor_vmx: Relax frame size for clang



Le 08/09/2022 à 15:48, Segher Boessenkool a écrit :
> On Thu, Sep 08, 2022 at 06:00:24AM +0000, Christophe Leroy wrote:
>> Looking at it more deeply, I see strange things.
> 
> I'll have to see full generated machine code to be able to see strange
> things, there isn't enough information at all here yet.  Sorry.

Well, what I call strange is the fact that with GCC the number of bytes 
reported by -Wframe-larger-than doesn't match the value the offset used 
for the stwu at the start of the function, while it does with clang.

> 
> Use private mail if it is too big or uninteresting for the list :-)
> 
>> What is that frame size ? I thought it was the number of bytes r1 is
>> decremented at the begining of the function, but it seems not, at least
>> on GCC. It seems GCC substrats 112 bytes while clang doesn't.
> 
> That is the vars size + the fixed size + the size of the parameter
> save area + the size of the regs save area, rounded up to a multiple
> of 16.  Fixed size is 8 on 32-bit PowerPC ELF.  Frame size used by GCC
> here is just the vars size.

Ok, so it means that the stack utilisation is underestimated when using 
GCC ? Or is it clang that overestimates it ?

> 
>> So it seems that GCC and CLANG don't warn on the same thing, is that
>> expected ? GCC substrats 112 bytes, which is the minimum frame size on a
>> ppc64, but here I'm building a ppc32 kernel, min frame size is 16.
> 
> I need to see the generated code to make sense of what is happening
> here.  It sounds like it is doing varargs calls or similar expensive
> stack juggling.  Or just saving a boatload of registers on the stack.
> 

Ok, I'll send it to you. But once again, I don't mind what the code 
really look like, I'm just worried that GCC doesn't report the entire 
stack usage.


Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ