RE: [PATCH v3 6/6] KVM: x86: allow defining return-0 static calls

From: David Laight
Date: Thu Mar 17 2022 - 18:30:49 EST


> I guess something with returning u64 made 32 compiler unhappy.
>
> I suspect that __static_call_return0 returns long, which means it returns
> 32 bit value on 32 bit system.
>
> Maybe we can make it return u64. I don't know if that will break something else though.

32 bit system will return a 64bit value in %edx:%eax.
Since %rdx is a scratch register (caller saved) it is fine.

Is __statc_call_return0() ever used to return a NULL pointer?
ISTR some ABI (maybe m68k ones) that returned pointers and
integers in different registers.
Plausibly that was only 35 years ago.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)