Re: [PATCH] x86/altcall: use an union as register type for function parameters

2024-02-22 Thread Jan Beulich
On 22.02.2024 11:50, Roger Pau Monné wrote: > On Thu, Feb 22, 2024 at 11:32:14AM +0100, Jan Beulich wrote: >> On 21.02.2024 18:03, Roger Pau Monne wrote: >>> The above can be worked around by using an union when defining the register >>> variables, so that `di` becomes: >>> >>> register union { >>>

Re: [PATCH] x86/altcall: use an union as register type for function parameters

2024-02-22 Thread Roger Pau Monné
On Thu, Feb 22, 2024 at 11:32:14AM +0100, Jan Beulich wrote: > On 21.02.2024 18:03, Roger Pau Monne wrote: > > The current code for alternative calls uses the caller parameter types as > > the > > types for the register variables that serve as function parameters: > > > > uint8_t foo; > > [...] >

Re: [PATCH] x86/altcall: use an union as register type for function parameters

2024-02-22 Thread Jan Beulich
On 21.02.2024 18:03, Roger Pau Monne wrote: > The current code for alternative calls uses the caller parameter types as the > types for the register variables that serve as function parameters: > > uint8_t foo; > [...] > alternative_call(myfunc, foo); > > Would expand roughly into: > > register

Re: [PATCH] x86/altcall: use an union as register type for function parameters

2024-02-22 Thread Roger Pau Monné
On Wed, Feb 21, 2024 at 06:03:31PM +0100, Roger Pau Monne wrote: > The current code for alternative calls uses the caller parameter types as the > types for the register variables that serve as function parameters: > > uint8_t foo; > [...] > alternative_call(myfunc, foo); > > Would expand roughly

[PATCH] x86/altcall: use an union as register type for function parameters

2024-02-21 Thread Roger Pau Monne
The current code for alternative calls uses the caller parameter types as the types for the register variables that serve as function parameters: uint8_t foo; [...] alternative_call(myfunc, foo); Would expand roughly into: register unint8_t a1_ asm("rdi") = foo; register unsigned long a2_ asm("r