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: <ea07afe0-c6c7-4641-9121-2dd591797852@app.fastmail.com>
Date: Tue, 10 Dec 2024 21:56:28 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: irecca.kun@...il.com, "Arnd Bergmann" <arnd@...nel.org>,
 linux-kernel@...r.kernel.org, x86@...nel.org
Cc: "Thomas Gleixner" <tglx@...utronix.de>, "Ingo Molnar" <mingo@...hat.com>,
 "Borislav Petkov" <bp@...en8.de>,
 "Dave Hansen" <dave.hansen@...ux.intel.com>,
 "H. Peter Anvin" <hpa@...or.com>,
 "Linus Torvalds" <torvalds@...ux-foundation.org>,
 "Andy Shevchenko" <andy@...nel.org>, "Matthew Wilcox" <willy@...radead.org>
Subject: Re: [PATCH v2 05/11] x86: add CONFIG_X86_64_NATIVE option

On Tue, Dec 10, 2024, at 20:05, irecca.kun@...il.com wrote:
> Hello.
>
> On 12/10/24 14:49, Arnd Bergmann wrote:
>> As a replacement for the obsole MK8/MPSC/MCORE2 configuration options,
>> allow building a specialized kernel for the local CPU, which is useful
>> for users building their own kernels, and does not require maintaining
>> a list of possible CPU options.
>
> That potentially introduces problems. Namely compilers could apply 
> auto-vectorization, which currently breaks the kernel.
> We probably need an additional patch like this: 
> https://github.com/zen-kernel/zen-kernel/commit/95b7981ba2e5c86529de0e895c2d9e428aa3f7dc

I don't see how either  -mno-avx2 or -fno-tree-vectorize would be
needed here: avx2 is already turned off because of -mno-avx,
and -ftree-vectorize is only enabled by default at -O3 level,
which we don't use (and which doesn't add any instructions).
There may be other flags that need to be disabled though.

With the flags we currently pass to the kernel, this is the
difference in the gcc-14 -Q --help=target output between the
x86-64 baseline and the -march=emeraldrapids, which is currently
the most featureful:

--- b	2024-12-10 21:37:27.182448452 +0100
+++ a	2024-12-10 21:41:14.118310513 +0100
@@ -12,24 +12,24 @@
   -mabm                       		[disabled]
   -maccumulate-outgoing-args  		[disabled]
   -maddress-mode=             		long
-  -madx                       		[disabled]
-  -maes                       		[disabled]
+  -madx                       		[enabled]
+  -maes                       		[enabled]
   -malign-data=               		compat
   -malign-double              		[disabled]
   -malign-functions=          		0
   -malign-jumps=              		0
   -malign-loops=              		0
   -malign-stringops           		[enabled]
-  -mamx-bf16                  		[disabled]
+  -mamx-bf16                  		[enabled]
   -mamx-complex               		[disabled]
   -mamx-fp16                  		[disabled]
-  -mamx-int8                  		[disabled]
-  -mamx-tile                  		[disabled]
+  -mamx-int8                  		[enabled]
+  -mamx-tile                  		[enabled]
   -mandroid                   		[disabled]
   -mapx-features=             		none
   -mapx-inline-asm-use-gpr32  		[disabled]
   -mapxf                      		[disabled]
-  -march=                     		x86-64
+  -march=                     		emeraldrapids
   -masm=                      		att
   -mavx                       		[disabled]
   -mavx10.1                   		-mavx10.1-256
@@ -62,27 +62,27 @@
   -mavxvnniint16              		[disabled]
   -mavxvnniint8               		[disabled]
   -mbionic                    		[disabled]
-  -mbmi                       		[disabled]
-  -mbmi2                      		[disabled]
+  -mbmi                       		[enabled]
+  -mbmi2                      		[enabled]
   -mbranch-cost=<0,5>         		3
   -mcall-ms2sysv-xlogues      		[disabled]
   -mcet-switch                		[disabled]
   -mcld                       		[disabled]
-  -mcldemote                  		[disabled]
-  -mclflushopt                		[disabled]
-  -mclwb                      		[disabled]
+  -mcldemote                  		[enabled]
+  -mclflushopt                		[enabled]
+  -mclwb                      		[enabled]
   -mclzero                    		[disabled]
   -mcmodel=                   		kernel
   -mcmpccxadd                 		[disabled]
   -mcpu=                      		
   -mcrc32                     		[disabled]
-  -mcx16                      		[disabled]
+  -mcx16                      		[enabled]
   -mdaz-ftz                   		[disabled]
   -mdirect-extern-access      		[enabled]
   -mdispatch-scheduler        		[disabled]
   -mdump-tune-features        		[disabled]
-  -menqcmd                    		[disabled]
-  -mevex512                   		[disabled]
+  -menqcmd                    		[enabled]
+  -mevex512                   		[enabled]
   -mf16c                      		[disabled]
   -mfancy-math-387            		[disabled]
   -mfentry                    		[disabled]
@@ -94,17 +94,17 @@
   -mforce-indirect-call       		[disabled]
   -mfp-ret-in-387             		[disabled]
   -mfpmath=                   		387
-  -mfsgsbase                  		[disabled]
+  -mfsgsbase                  		[enabled]
   -mfunction-return=          		keep
   -mfused-madd                		-ffp-contract=fast
   -mfxsr                      		[enabled]
   -mgather                    		-mtune-ctrl=use_gather
   -mgeneral-regs-only         		[disabled]
-  -mgfni                      		[disabled]
+  -mgfni                      		[enabled]
   -mglibc                     		[enabled]
   -mhard-float                		[disabled]
   -mharden-sls=               		none
-  -mhle                       		[disabled]
+  -mhle                       		[enabled]
   -mhreset                    		[disabled]
   -miamcu                     		[disabled]
   -mieee-fp                   		[enabled]
@@ -123,15 +123,15 @@
   -mlong-double-64            		[disabled]
   -mlong-double-80            		[enabled]
   -mlwp                       		[disabled]
-  -mlzcnt                     		[disabled]
+  -mlzcnt                     		[enabled]
   -mmanual-endbr              		[disabled]
   -mmemcpy-strategy=          		
   -mmemset-strategy=          		
   -mmitigate-rop              		[disabled]
   -mmmx                       		[disabled]
-  -mmovbe                     		[disabled]
-  -mmovdir64b                 		[disabled]
-  -mmovdiri                   		[disabled]
+  -mmovbe                     		[enabled]
+  -mmovdir64b                 		[enabled]
+  -mmovdiri                   		[enabled]
   -mmove-max=                 		128
   -mmpx                       		[disabled]
   -mms-bitfields              		[disabled]
@@ -152,23 +152,23 @@
   -mpc32                      		[disabled]
   -mpc64                      		[disabled]
   -mpc80                      		[disabled]
-  -mpclmul                    		[disabled]
+  -mpclmul                    		[enabled]
   -mpcommit                   		[disabled]
-  -mpconfig                   		[disabled]
-  -mpku                       		[disabled]
-  -mpopcnt                    		[disabled]
+  -mpconfig                   		[enabled]
+  -mpku                       		[enabled]
+  -mpopcnt                    		[enabled]
   -mprefer-avx128             		-mprefer-vector-width=128
   -mprefer-vector-width=      		none
   -mpreferred-stack-boundary= 		3
   -mprefetchi                 		[disabled]
   -mprefetchwt1               		[disabled]
-  -mprfchw                    		[disabled]
-  -mptwrite                   		[disabled]
+  -mprfchw                    		[enabled]
+  -mptwrite                   		[enabled]
   -mpush-args                 		[enabled]
   -mraoint                    		[disabled]
-  -mrdpid                     		[disabled]
-  -mrdrnd                     		[disabled]
-  -mrdseed                    		[disabled]
+  -mrdpid                     		[enabled]
+  -mrdrnd                     		[enabled]
+  -mrdseed                    		[enabled]
   -mrecip                     		[disabled]
   -mrecip=                    		
   -mrecord-mcount             		[disabled]
@@ -178,11 +178,11 @@
   -mrelax-cmpxchg-loop        		[disabled]
   -mrtd                       		[disabled]
   -mrtm                       		[disabled]
-  -msahf                      		[disabled]
+  -msahf                      		[enabled]
   -mscatter                   		-mtune-ctrl=use_scatter
-  -mserialize                 		[disabled]
-  -msgx                       		[disabled]
-  -msha                       		[disabled]
+  -mserialize                 		[enabled]
+  -msgx                       		[enabled]
+  -msha                       		[enabled]
   -msha512                    		[disabled]
   -mshstk                     		[disabled]
   -mskip-rax-setup            		[enabled]
@@ -212,11 +212,11 @@
   -mtbm                       		[disabled]
   -mtls-dialect=              		gnu
   -mtls-direct-seg-refs       		[enabled]
-  -mtsxldtrk                  		[disabled]
+  -mtsxldtrk                  		[enabled]
   -mtune-ctrl=                		
   -mtune=                     		generic
   -muclibc                    		[disabled]
-  -muintr                     		[disabled]
+  -muintr                     		[enabled]
   -munroll-only-small-loops   		[enabled]
   -musermsr                   		[disabled]
   -mvaes                      		[disabled]
@@ -224,15 +224,15 @@
   -mvect8-ret-in-mem          		[disabled]
   -mvpclmulqdq                		[disabled]
   -mvzeroupper                		[enabled]
-  -mwaitpkg                   		[disabled]
-  -mwbnoinvd                  		[disabled]
+  -mwaitpkg                   		[enabled]
+  -mwbnoinvd                  		[enabled]
   -mwidekl                    		[disabled]
   -mx32                       		[disabled]
   -mxop                       		[disabled]
-  -mxsave                     		[disabled]
-  -mxsavec                    		[disabled]
-  -mxsaveopt                  		[disabled]
-  -mxsaves                    		[disabled]
+  -mxsave                     		[enabled]
+  -mxsavec                    		[enabled]
+  -mxsaveopt                  		[enabled]
+  -mxsaves                    		[enabled]
 
I don't know what most of them do, but the ones I looked
up seem to be mainly integer operations.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ