Re: [PATCH] x86/acrn: Improve ACRN hypercalls

From: Dave Hansen
Date: Thu Aug 04 2022 - 14:41:40 EST


On 8/4/22 11:03, Uros Bizjak wrote:
> As explained in section 6.47.5.2, "Specifying Registers for Local Variables"
> of the GCC info documentation, the correct way to specify register for
> input operands when calling Extended 'asm' is to define a local register
> variable and associate it with a specified register:
>
> register unsigned long r8 asm ("r8") = hcall_id;

IIRC, that's what the ACRN folks proposed first. But, it's more fragile
because you can't, for instance, put a printk() in that function between
the variable definition and assebly.