Thread (15 messages) 15 messages, 5 authors, 2024-02-19

Re: [PATCH] arm: Silence gcc warnings about arch ABI drift

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2024-02-19 09:58:08
Also in: linux-bcachefs, lkml

On Mon, Feb 19, 2024, at 10:40, Kent Overstreet wrote:
On Mon, Feb 19, 2024 at 09:26:51AM +0000, Russell King (Oracle) wrote:
quoted
On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote:

+1 - bcachefs definitely needs fixing. Passing all that as an argument
not only means that it has to be read into registers, but also when
accessing members, it has to be extracted from those registers as well.

Passing that by argument is utterly insane.
If the compiler people can't figure out a vaguely efficient way to pass
a small struct by value, that's their problem - from the way you
describe it, I have to wonder at what insanity is going on there.
On most ABIs, there are only six argument registers (24 bytes)
for function calls. The compiler has very little choice here if
it tries to pass 32 bytes worth of data.

On both x86_64 and arm64, there are theoretically enough
registers to pass the data, but kernel disallows using the
vector and floating point registers for passing large
compounds arguments.

The integer registers on x86 apparently allow passing compounds
up to 16 bytes, but only if all members are naturally aligned.
Since you have both __packed members and bitfields, the compiler
would not even be allowed to pass the structure efficiently
even if it was small enough.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help