[lkml]   [2022]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCHv5 15/30] x86/boot: Port I/O: allow to hook up alternative helpers
On Wed, Mar 02, 2022 at 05:27:51PM +0300, 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 with
> a new pio_ops structure. For now, set the ops structure to just call
> the normal I/O operation functions.
> The approach has down sides: TDX boot will fail if any code bypass
> pio_ops and go for direct port I/O helper. The failure will only be
> visible on TDX boot (or other user of alternative pio_ops).
> Signed-off-by: Kirill A. Shutemov <>
> Acked-by: Dave Hansen <>

Sorry, but this is still not convincing.

As you said earlier, it's a judgement call. So, detail all the
considerations which were used when making that call.

Why is this the best approach compared to other alternatives? It needs
to convince the reader.

Supporting #VE -- by building on the existing #VC support -- seems more
robust than this hack. Convince me (and other patch reviewers)

At the very least, please remove the ability for future code to
accidentally bypass 'pio_ops'. Going forward, are we really expected to
just remember to always use pio_ops for i/o? Or else TDX will just
silently break? That's just not acceptable.


 \ /
  Last update: 2022-03-02 18:43    [W:0.406 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site