Re: [PATCHv6 17/30] x86/tdx: Port I/O: add runtime hypercalls

Thomas Gleixner
2022-03-17T12:25:21Z

On Wed, Mar 16 2022 at 05:08, Kirill A. Shutemov wrote:
> +static bool handle_in(struct pt_regs *regs, int size, int port)
> +{
> + struct tdx_hypercall_args args = {
> + .r10 = TDX_HYPERCALL_STANDARD,
> + .r11 = hcall_func(EXIT_REASON_IO_INSTRUCTION),
> + .r12 = size,
> + .r13 = PORT_READ,
> + .r14 = port,
> + };
> + bool success;
> + u64 mask = GENMASK(BITS_PER_BYTE * size, 0);

Reverse fir tree ordering please:

u64 mask = GENMASK(BITS_PER_BYTE * size, 0);
bool success;

> +/*
> + * Emulate I/O using hypercall.
> + *
> + * Assumes the IO instruction was using ax, which is enforced
> + * by the standard io.h macros.
> + *
> + * Return True on success or False on failure.
> + */
> +static bool handle_io(struct pt_regs *regs, u32 exit_qual)
> +{
> + bool in;
> + int size, port;

Ditto.

Other than that:

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>