[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AE09C3E1-60F9-4FE0-A7C8-A37FB7C96BF3@zytor.com>
Date: Sat, 20 Dec 2025 12:53:31 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Uros Bizjak <ubizjak@...il.com>
CC: Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
"x86@...nel.org" <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: Do we still care about compilers without __seg_fs and __seg_gs support??
On December 19, 2025 11:47:50 PM PST, Uros Bizjak <ubizjak@...il.com> wrote:
>On Sat, Dec 20, 2025 at 12:24 AM H. Peter Anvin <hpa@...or.com> wrote:
>>
>> As of Linux 6.16, we require:
>>
>> gcc 8.1 or higher
>> clang 15.0.0 or higher
>>
>> If my reading of the release notes is correct, then both versions *should*
>> supported __seg_fs and __seg_gs, but we have:
>>
>> config CC_HAS_NAMED_AS
>> def_bool $(success,echo 'int __seg_fs fs; int __seg_gs gs;' | $(CC) -x
>> c - -S -o /dev/null)
>> depends on CC_IS_GCC
>>
>> We don't even try on clang.
>>
>> Being able to actually rely on the compiler for this would make a lot of
>> things cleaner. For one thing, I'm trying to untangle a bunch of ugliness in
>> the code sharing between realmode and proper flat mode code...
>>
>> Uros, you seem to have touched this code as recently as earlier this year; any
>> thoughts?
>
>To enable __seg_gs support with clang, you will first need the patch at [1].
>
>Second, clang does not emit %gs: prefix by itself when the address
>from __seg_gs named address space is used in asm(). This can be worked
>around by leaving __percpu_arg(x) defined to __percpu_prefix "%" #x
>for clang.
>
>Finally, you will hit issue #93449.
>
>[1] https://lore.kernel.org/lkml/20240526175655.227798-1-ubizjak@gmail.com/
>
>Uros.
>
Yeah. It's sad that compatibility functionality seems to be as low on the priority list as it is. However, it looks like it might still be possible to do the boot code cleanups even within the limitations of the current clang, bugs and all...
Powered by blists - more mailing lists