lkml.org 
[lkml]   [2022]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 16/32] x86/boot: Allow to hook up alternative port I/O helpers
On Tue, Feb 22, 2022 at 01:02:33AM +0300, Kirill A. Shutemov wrote:
> On Mon, Feb 21, 2022 at 02:04:33PM -0600, Tom Lendacky wrote:
> > On 2/18/22 10:17, 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.
> >
> > This seems like a lot of churn in order to get this all working without
> > taking a #VE.
>
> Well, it evolved from more concise (but also more hacky) implementation:
>
> https://lore.kernel.org/all/20211214150304.62613-11-kirill.shutemov@linux.intel.com
>
> > How cumbersome is it to get #VE handling working in the decompression
> > stage? Can you build on any of the support that was added to handle #VC?
>
> We definitely can.
>
> But I still think exception-based implementation is inherently more
> fragile. I would rather stick with this.

At least from reading the commit message it's not self-evident why #VE
handling would be worse, especially since there's already #VC support in
boot. It would help to give more info about that in the commit message.

The current approach also seems fragile, doesn't it require all future
code to remember to not do i/o directly? How do we make sure that
doesn't happen going forward?

How does it fail if some code accidentally does i/o directly? Or
triggers #VE some other way? Is the error understandable and
actionable?

--
Josh

\
 
 \ /
  Last update: 2022-02-22 02:27    [W:0.145 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site