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

From: Dave Hansen
Date: Tue Mar 08 2022 - 16:30:55 EST


On 3/2/22 06:27, Kirill A. Shutemov wrote:
> This series has no special handling for ioperm(). Users will be able
> to successfully request I/O permissions but will induce a #VE on
> their> first I/O instruction.

How will this be visible to users or user applications?

> +static bool handle_io(struct pt_regs *regs, u32 exit_qual)
> +{
> + bool in;
> + int size, port;
> +
> + if (VE_IS_IO_STRING(exit_qual))
> + return false;
> +
> + in = VE_IS_IO_IN(exit_qual);
> + size = VE_GET_IO_SIZE(exit_qual);
> + port = VE_GET_PORT_NUM(exit_qual);
> +
> +
> + if (in)
> + return handle_in(regs, size, port);
> + else
> + return handle_out(regs, size, port);
> +}

Some extra whitespace snuck in there.

With the question answered and whitespace fixed:

Reviewed-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>