Re: [PATCHv2 11/29] x86/boot: Allow to hook up alternative port I/O helpers

From: Thomas Gleixner
Date: Tue Feb 01 2022 - 17:39:15 EST


On Mon, Jan 24 2022 at 18:01, Kirill A. Shutemov wrote:

> Port I/O instructions trigger #VE in the TDX environment. In response to
> the exception, kernel emulates these instructions using hypercalls.
>
> But during early boot, on the decompression stage, it is cumbersome to
> deal with #VE. It is cleaner to go to hypercalls directly, bypassing #VE
> handling.
>
> Add a way to hook up alternative port I/O helpers in the boot stub.
> All port I/O operations are routed via 'pio_ops'. By default 'pio_ops'
> initialized with native port I/O implementations.
>
> This is a preparation patch. The next patch will override 'pio_ops' if
> the kernel booted in the TDX environment.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>

Aside of Borislav's comments:

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>