lkml.org 
[lkml]   [2022]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCHv6 17/30] x86/tdx: Port I/O: add runtime hypercalls
Date
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>

\
 
 \ /
  Last update: 2022-03-17 13:25    [W:0.351 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site