Re: [PATCH 08/26] x86/tdx: Handle in-kernel MMIO

From: Kirill A. Shutemov
Date: Thu Jan 06 2022 - 10:08:01 EST


On Wed, Dec 15, 2021 at 03:31:16PM -0800, Josh Poimboeuf wrote:
> > +static int tdx_handle_mmio(struct pt_regs *regs, struct ve_info *ve)
>
> Similarly, tdx_handle_mmio() returns (int) 0 for success, while other
> tdx_handle_*() functions return (bool) true for success. Also
> confusing.

Looked at this again, you read it wrong. tdx_handle_mmio() return size of
instruction it handled so we can advance RIP and <= 0 on error. It is
consistent with other #VE handlers that positive (true) on success.

--
Kirill A. Shutemov