On Fri, May 29, 2020 at 1:46 PM Al Viro <v...@zeniv.linux.org.uk> wrote:
>
> Umm...  I'd been concerned about code generation, but it actually gets
> split into a pair of scalars just fine...

We actually have depended on that for a long time: our 'pte_t' etc on
32-bit kernels were very much about "structs of two words are handled
fairly well by gcc".

IIrc, we (for a while) had a config option to switch between "long
long" and the struct, but passing and returning two-word structs ends
up working fine even when it's a function call, and when it's all
inlined it ends up generating pretty good code on just two registers
instead.

> Al, trying to resist the temptation to call those struct bad_idea and
> struct bad_idea_32...

I'm sure you can contain yourself.

> All jokes aside, when had we (or anybody else, really) _not_ gotten
> into trouble when passing structs across the kernel boundary?  Sure,
> sometimes you have to (stat, for example), but just look at the amount
> of PITA stat() has spawned...

I'd rather see the struct than some ugly manual address calculations
and casts...

Because that's fundamentally what a struct _is_, after all.

               Linus

Reply via email to