mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: irecca.kun@gmail.com, "Arnd Bergmann" <arnd@kernel.org>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Matthew Wilcox" <willy@infradead.org>
Subject: Re: [PATCH v2 05/11] x86: add CONFIG_X86_64_NATIVE option
Date: Tue, 10 Dec 2024 21:56:28 +0100	[thread overview]
Message-ID: <ea07afe0-c6c7-4641-9121-2dd591797852@app.fastmail.com> (raw)
In-Reply-To: <fdf8b753-f4ff-47ea-aec7-508ad72ce5b9@gmail.com>

On Tue, Dec 10, 2024, at 20:05, irecca.kun@gmail.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

  reply	other threads:[~2024-12-10 20:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 14:49 [PATCH v2 00/11] x86: 32-bit cleanups Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 01/11] x86/Kconfig: Geode CPU has cmpxchg8b Arnd Bergmann
2024-12-10 16:00   ` Brian Gerst
2024-12-10 14:49 ` [PATCH v2 02/11] x86: drop 32-bit "bigsmp" machine support Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 03/11] x86: rework CONFIG_GENERIC_CPU compiler flags Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 04/11] x86: drop configuration options for early 64-bit CPUs Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 05/11] x86: add CONFIG_X86_64_NATIVE option Arnd Bergmann
2024-12-10 19:05   ` irecca.kun
2024-12-10 20:56     ` Arnd Bergmann [this message]
2024-12-10 21:08       ` irecca.kun
2024-12-10 21:02   ` Josh Triplett
2024-12-10 14:49 ` [PATCH v2 06/11] x86: remove HIGHMEM64G support Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 07/11] x86: drop SWIOTLB and PHYS_ADDR_T_64BIT for PAE Arnd Bergmann
2024-12-20  2:52   ` kernel test robot
2024-12-22 21:19     ` Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 08/11] x86: drop support for CONFIG_HIGHPTE Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 09/11] x86: document X86_INTEL_MID as 64-bit-only Arnd Bergmann
2024-12-10 14:49 ` [PATCH v2 10/11] x86: remove old STA2x11 support Arnd Bergmann
2024-12-10 15:39   ` Andy Shevchenko
2024-12-10 14:49 ` [PATCH v2 11/11] x86: Move platforms to Kconfig.platforms Arnd Bergmann
2024-12-10 15:43 ` [PATCH v2 00/11] x86: 32-bit cleanups Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea07afe0-c6c7-4641-9121-2dd591797852@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andy@kernel.org \
    --cc=arnd@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=irecca.kun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®