Re: [PATCHv4 18/30] x86/tdx: Handle early boot port I/O

Dave Hansen
2022-02-24T22:58:38Z

I wish this was telling more of a story. There *is* a story to be told
and this series is really missing an opportunity to tell it. The last
three patches do the same logical thing: add support for I/O
instructions when running as a TDX guest. But, the three subjects call
it: "Support", "Add" and "Handle". All three talk about "port I/O", but
in different ways.

Imagine you had the subjects be:

x86/boot: Port I/O: add decompression-time support for TDX
x86/tdx: Port I/O: add runtime hypercalls
x86/tdx: Port I/O: add early boot support

That makes it be visually *obvious* what's going on. All three are
covering the same ground: "Port I/O". They're all adding something. In
succession they add the same basic thing for
{decompression,runtime,early} code.

I mentioned this exact thing to *somebody* about this exact part of the
series, who knows when. But, it still bugs me...

On 2/24/22 07:56, Kirill A. Shutemov wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> TDX guests cannot do port I/O directly. The TDX module triggers a #VE
> exception to let the guest kernel emulate port I/O by converting them
> into TDCALLs to call the host.

As part of telling the story, it would be best to refer to the code that
you introduced in the last few patches. "At runtime..." could hearken
back to the subject from two patches ago.

Anyway, the code is fine.

Acked-by: Dave Hansen <dave.hansen@linux.intel.com>