Re: [PATCH 03/20] x86/tdx: Convert port I/O handling to use new TDVMCALL macros

Dave Hansen
2024-05-17T15:28:30Z

On 5/17/24 07:19, Kirill A. Shutemov wrote:
> static inline void tdx_io_out(int size, u16 port, u32 value)
> {
> - struct tdx_module_args args = {
> - .r10 = TDX_HYPERCALL_STANDARD,
> - .r11 = hcall_func(EXIT_REASON_IO_INSTRUCTION),
> - .r12 = size,
> - .r13 = 1,
> - .r14 = port,
> - .r15 = value,
> - };
> -
> - __tdx_hypercall(&args);
> + TDVMCALL_0(hcall_func(EXIT_REASON_IO_INSTRUCTION),
> + size, TDX_PORT_WRITE, port, value);
> }

I actually really like the self-documenting nature of the structures. I
don't think it's a win if this is where the lines-of-code savings comes
from.