From: Thomas Huth <thuth@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>, Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
linux-s390@vger.kernel.org,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/uapi: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
Date: Mon, 10 Mar 2025 13:14:08 +0100 [thread overview]
Message-ID: <7eed4668-9352-45d6-8116-235c8be43bfa@redhat.com> (raw)
In-Reply-To: <ab1ab15a-89e1-4c26-b7a2-6147a10a2fca@app.fastmail.com>
On 10/03/2025 12.07, Arnd Bergmann wrote:
> On Mon, Mar 10, 2025, at 11:49, Heiko Carstens wrote:
>> On Mon, Mar 10, 2025 at 11:26:57AM +0100, Thomas Huth wrote:
>>
>> Did this cause any sorts of problems? I can see this pattern all over
>> the place, so why is this now a problem?
>>
>> Also, wouldn't it be better to fix this with an sed statement in
>> scripts/headers_install.sh instead? Otherwise this is going to be a
>> never ending story since those things will be re-introduced all the
>> time.
>
> It should certainly be done in a consistent way across all
> architectures and architecture-independent headers. I see that
> all uapi headers use __ASSEMBLY__ consistently, while a few non-uapi
> headers use __ASSEMBLER__.
>
> glibc obviously defines __ASSEMBLY__ whenever it includes one
> of the kernel headers that need this from a .S file. Unless
> there is a known problem with the current code, leaving this
> unchanged is probably the least risky way.
Well, this seems to be constant source of confusion. It got my attention by
Sean's recent patch for kvm-unit-tests here:
https://lore.kernel.org/kvm/20250222014526.2302653-1-seanjc@google.com/
Quoting: "This is essentially a "rage" patch after spending
way, way too much time trying to understand why I couldn't include some
__ASSEMBLY__ protected headers in x86 assembly files."
But also if you search the net for this, there are lots of other spots where
people get it wrong, e.g.:
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199
So I thought it would be a good idea to standardize on the #define that is
set by the compiler already. IMHO it would be great to get it replaced in
the whole kernel, but that's a little bit bold for one patch. So the obvious
first step towards that direction is to replace it in the uapi header files
first, where it hopefully will help to reduce the confusion in userspace.
So unless you really don't like this idea at all, I could continue with the
uapi headers for the other architectures, too?
Thomas
next prev parent reply other threads:[~2025-03-10 12:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 10:26 [PATCH] s390/uapi: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-10 10:49 ` Heiko Carstens
2025-03-10 11:07 ` Arnd Bergmann
2025-03-10 12:14 ` Thomas Huth [this message]
2025-03-10 12:50 ` Arnd Bergmann
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=7eed4668-9352-45d6-8116-235c8be43bfa@redhat.com \
--to=thuth@redhat.com \
--cc=agordeev@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.com \
/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