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]
Message-Id: <106aacc5-e863-4e74-b223-34b7a0be60a0@app.fastmail.com>
Date: Mon, 24 Mar 2025 09:45:14 +0100
From: "Arnd Bergmann" <arnd@...nel.org>
To: "Tor Vic" <torvic9@...lbox.org>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Cc: "Borislav Petkov" <bp@...en8.de>, "Thomas Gleixner" <tglx@...utronix.de>,
 "Ingo Molnar" <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] arch/x86: Add an option to build the kernel with '-march=native'
 on x86-64

On Sun, Mar 23, 2025, at 16:14, Tor Vic wrote:
> On 3/22/25 12:40, Arnd Bergmann wrote:
>> On Fri, Mar 21, 2025, at 15:28, Tor Vic wrote:
>>
>> Are you able to quickly run the same tests again using
>> just one of the two?
>> 
>> a) -march=x86-64 -mtune=skylake
>> b) -march=skylake -mtune=generic
>> 
>
> I ran the tests on Zen2 (znver2), but this time the kernel was built 
> with clang-20+lto (the skylake tests were with gcc-14).
>
> It turned out that with '-march=native', there is almost no difference 
> compared to '-march=x86-64'.
> All results are within +0.8% and -0.6%, most of which are probably 
> noise. Hackbench, stress-ng fork and xz compression seem to profit the 
> most from 'native'.
>
> The vmlinux image is 0.03% bigger with 'native'.
>
> I guess that 'native' can be somewhat useful on some architectures, but 
> not on all...

It certainly depends on configuration, toolchain and target machine,
so it's very hard to say anything general about -march=native.
znver2 and skylake are quite similar in the supported instructions,
so my guess would be that the clang-20+lto doesn't behave that differently
between march=x86-64 and march=znver2.

Of course if you don't have the same kernel version and configuration
that you are testing, the results between the two machines, the
results would be fairly random as well.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ