mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Arnd Bergmann <arnd@kernel.org>, Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	"Ahmed S . Darwish" <darwi@linutronix.de>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ard Biesheuvel <ardb@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	John Ogness <john.ogness@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional
Date: Sun, 27 Apr 2025 14:26:24 -0700	[thread overview]
Message-ID: <B0D2F96E-F090-4D60-94B5-9FAD3536A4BD@zytor.com> (raw)
In-Reply-To: <b97650f6-b541-4496-b84d-862fc7fd711b@app.fastmail.com>

On April 27, 2025 10:32:14 AM PDT, Arnd Bergmann <arnd@kernel.org> wrote:
>On Sun, Apr 27, 2025, at 11:25, Ingo Molnar wrote:
>> * Arnd Bergmann <arnd@kernel.org> wrote:
>>> On Fri, Apr 25, 2025, at 17:15, H. Peter Anvin wrote:
>>> 
>>> I now found that both Debian 12 and gcc 11 changed their definition
>>> if 686 to actually require nopl for Indirect branch tracking 
>>> (-fcf-protection) in user space, as discussed in
>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104713
>>> 
>>> So even if it makes sense for GeodeLX specific kernel to use CMOV,
>>> any general-purpose i686 distro would still want to enable IBT
>>> in userspace to gain IBT on Tiger Lake and newer 64-bit CPUs.
>>
>> And the kernel Debian 12 uses is a "686" one:
>>
>>   ./pool/main/l/linux-signed-i386/linux-image-6.1.0-32-686_6.1.129-1_i386.deb
>>   ./pool/main/l/linux-signed-i386/linux-image-686_6.1.129-1_i386.deb
>>
>> and the kernel is set to CONFIG_MGEODE_LX=y:
>>
>>   $ grep CONFIG_MGEODE_LX ./boot/config-6.1.0-32-686
>>   CONFIG_MGEODE_LX=y
>>
>> ... which CPU has CMOV support:
>>
>>   config X86_CMOV
>>         def_bool y
>>         depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
>> MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || 
>> MATOM || MGEODE_LX || X86_64)                                           
>>                                                                         
>>                                                                         
>>                                                 ^^^^^^^^^
>> So I'd argue that the kernel's x86-32 CPU support cutoff should match 
>> the i386 CPU support cutoff of the Debian i386 installer.
>
>I think this misses a few other bits of information, some of which
>we already mentioned in this thread:
>
>- Debian 13 no longer has any 32-bit kernel, so debian-i686 is
>  primarily targeted at running on 64-bit kernels for memory
>  constrained environments.
>
>- Debian 12 started requiring NOPL in userspace, which is not
>  supported on GeodeLX (or Crusoe), the kernel option should have
>  been changed to M686 instead but was accidentally left at
>  MGEODE_LX, so the kernel still works, but userspace doesn't.
>
>- Anyone running Linux on an i586 machine likely already wants
>  a custom kernel, regardless what the distros provide. This
>  is especially true for the embedded targets.
>
>> Survey of other distros:
>>
>>  - Fedora dropped x86-32 with Fedora 31, almost 5 years ago.
>>
>>  - Ubuntu dropped x86-32 after 18 LTS, more than 5 years ago. The LTS 
>>    kernel is v5.6 based.
>>
>>  - Arch Linux dropped i686 support even earlier than that, the 
>>    spin-off-community project of archlinux32.org has 486 and 686 
>>    variants. 686 variant includes CMOV.
>>
>>  - Gentoo has an 'x86' variant with 486 and 686 stages. 686 stage 
>>    includes CMOV.
>>
>> Ie. I think we can also make CMOV a hard requirement, and keep support 
>> for all family 5 CPUs that have CMOV and have a chance to boot current 
>> 32-bit distros. Even distros that had 486 builds have 686 variants that 
>> should still work.
>>
>> I.e. remove support for M586MMX, M586TSC, MCYRIXIII, MGEODEGX1 and MK6 
>> as well, these don't have CMOV support and won't even boot i386 Debian 
>> 12.
>>
>> Summary, the plan would be to remove support for the following pre-CMOV 
>> CPUs (the ones not yet in this series are marked 'NEW'):
>>
>>   M486
>>   M486SX
>>   M586
>>   M586MMX         # NEW
>>   M586TSC         # NEW
>>   MCYRIXIII       # NEW
>>   MELAN
>>   MGEODEGX1       # NEW
>>   MK6             # NEW
>>   MWINCHIP3D
>>   MWINCHIPC6
>
>This would also mean dropping support for the pre-2015 Intel Quark
>and DM&P Vortex86DX/DX2/MX/EX that never had a custom CONFIG_Mxxxx
>option but are still relevant to some degree.
>I think that would be a mistake. 
>
>> And to keep these:
>>
>>   M686
>>   MATOM
>>   MCRUSOE
>>   MEFFICEON
>>   MGEODE_LX
>>   MK7
>>   MPENTIUM4
>>   MPENTIUMII
>>   MPENTIUMIII
>>   MPENTIUMM
>>   MVIAC3_2
>>   MVIAC7
>
>As Linus said, overall they are barely different from the
>first group, and they are just as obsolete, only Atom and
>Vortex86DX3/EmKore are less than 20 years old.
>
>Here are some alternatives I like better than dropping i586:
>
>a) keep my patch with an new bool option to pick between
>   i586 and i686 targets, by any name.
>
>b) always build with -march=i586 and leave only the -mtune
>   flags; see if anyone cares enough to even benchmark
>   and pick one of the other options if they can show
>   a meaningful regression over -march=i686 -mtune=
>
>c) keep the outcome of your v1 series, dropping only
>   pre-i586 support, and leave my patch out. No change here,
>   so at least no regression potential.
>
>d) use -march=i686 (plus -mtune=) for normal builds, but
>   keep support for the older cores guarded by
>   X86_EXTENDED_PLATFORM or CONFIG_EXPERT, use -march=i586
>   if at least one of those platforms is selected.
>
>      Arnd

Interesting. They really should be using x32 for that application...

  reply	other threads:[~2025-04-27 21:26 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25  8:41 [RFC PATCH 0/15] x86: Remove support for TSC-less and CX8-less CPUs Ingo Molnar
2025-04-25  8:41 ` [PATCH 01/15] x86/cpu: Remove M486/M486SX/ELAN support Ingo Molnar
2025-04-25  8:41 ` [PATCH 02/15] x86/cpu: Remove CONFIG_MWINCHIP3D/MWINCHIPC6 Ingo Molnar
2025-04-25  8:42 ` [PATCH 03/15] x86/cpu: Remove CPU_SUP_UMC_32 support Ingo Molnar
2025-04-25  8:42 ` [PATCH 04/15] x86/cpu: Remove TSC-less CONFIG_M586 support Ingo Molnar
2025-04-25 15:09   ` H. Peter Anvin
2025-04-25  8:42 ` [PATCH 05/15] x86/cpu, x86/platform, watchdog: Remove CONFIG_X86_RDC321X support Ingo Molnar
2025-04-25  8:42 ` [PATCH 06/15] x86/cpu: Remove the CONFIG_X86_INVD_BUG quirk Ingo Molnar
2025-04-25  8:42 ` [PATCH 07/15] x86/cpu, cpufreq: Remove AMD ELAN support Ingo Molnar
2025-04-25  8:42 ` [PATCH 08/15] x86/fpu: Remove MATH_EMULATION and related glue code Ingo Molnar
2025-04-25  8:42 ` [PATCH 09/15] x86/fpu: Remove the 'no387' boot option Ingo Molnar
2025-04-25  8:42 ` [PATCH 10/15] x86/fpu: Remove the math-emu/ FPU emulation library Ingo Molnar
2025-04-25  8:42 ` [PATCH 11/15] x86/cpu: Make CONFIG_X86_TSC unconditional Ingo Molnar
2025-04-25  8:42 ` [PATCH 12/15] x86: Remove !CONFIG_X86_TSC code Ingo Molnar
2025-04-25  8:42 ` [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional Ingo Molnar
2025-04-25 12:10   ` Arnd Bergmann
2025-04-25 15:15     ` H. Peter Anvin
2025-04-25 21:54       ` Arnd Bergmann
2025-04-27  9:25         ` Ingo Molnar
2025-04-27 17:32           ` Arnd Bergmann
2025-04-27 21:26             ` H. Peter Anvin [this message]
2025-04-28  9:16             ` Ingo Molnar
2025-04-28 11:21               ` Arnd Bergmann
2025-04-29 10:22                 ` Ingo Molnar
2025-04-29 12:10                   ` Arnd Bergmann
2025-04-27  8:15     ` Ingo Molnar
2025-04-25  8:42 ` [PATCH 14/15] x86/percpu: Remove !CONFIG_X86_CX8 methods Ingo Molnar
2025-04-25 14:05   ` Uros Bizjak
2025-04-27  7:46     ` [PATCH -v2 " Ingo Molnar
2025-04-25  8:42 ` [PATCH 15/15] x86/atomics: " Ingo Molnar
2025-04-25 13:55   ` Arnd Bergmann
2025-04-25 14:10   ` Uros Bizjak
2025-04-25 15:00     ` Brian Gerst
2025-04-27  8:23       ` Ingo Molnar
2025-04-27  8:26     ` Ingo Molnar
2025-04-27 10:31       ` Uros Bizjak
2025-05-15  8:49         ` Ingo Molnar
2025-04-25 11:13 ` [RFC PATCH 0/15] x86: Remove support for TSC-less and CX8-less CPUs Arnd Bergmann
2025-04-26  8:26 ` Pavel Machek
2025-05-05  8:53 ` Maciej W. Rozycki
2025-05-05 12:48   ` H. Peter Anvin
2025-05-05 13:04     ` Maciej W. Rozycki
2025-05-05 19:57       ` H. Peter Anvin
2025-05-05 20:54         ` Borislav Petkov
2025-05-06 13:51           ` Maciej W. Rozycki
2025-05-06 14:16             ` Borislav Petkov
2025-05-08 14:51               ` Maciej W. Rozycki
2025-05-08 20:11                 ` Borislav Petkov
2025-05-12 12:55                   ` Maciej W. Rozycki
2025-05-12 13:48                     ` Borislav Petkov
2025-05-12 17:29                       ` Maciej W. Rozycki
2025-05-13  2:00                         ` Linus Torvalds
2025-05-13  3:48                           ` H. Peter Anvin
2025-05-13  5:43                           ` John Paul Adrian Glaubitz
2025-05-13 21:55                             ` Maciej W. Rozycki
2025-05-13 22:02                               ` Linus Torvalds
2025-05-13 22:06                                 ` H. Peter Anvin
2025-05-15 16:32                                 ` Maciej W. Rozycki
2025-05-06 13:48         ` Maciej W. Rozycki
2025-05-06 13:54           ` John Paul Adrian Glaubitz
2025-05-05 15:59   ` Linus Torvalds
2025-05-06 13:53     ` Maciej W. Rozycki
2025-05-06 16:44       ` H. Peter Anvin
2025-05-06 17:11         ` Linus Torvalds
2025-05-06 17:51           ` H. Peter Anvin
2025-05-08 14:54             ` Maciej W. Rozycki
2025-05-08 14:53           ` Maciej W. Rozycki
2025-05-08 14:51         ` Maciej W. Rozycki
2025-05-15  8:56 [PATCH -v2 " Ingo Molnar
2025-05-15  8:57 ` [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional Ingo Molnar
2025-12-14  8:46 [PATCH -v3 0/15] x86: Remove support for TSC-less and CX8-less CPUs Ingo Molnar
2025-12-14  8:47 ` [PATCH 13/15] x86/cpu: Make CONFIG_X86_CX8 unconditional Ingo Molnar

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=B0D2F96E-F090-4D60-94B5-9FAD3536A4BD@zytor.com \
    --to=hpa@zytor.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ardb@kernel.org \
    --cc=arnd@kernel.org \
    --cc=bp@alien8.de \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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®