[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220115010155.ss2hnyotw4a3nljf@black.fi.intel.com>
Date: Sat, 15 Jan 2022 04:01:55 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Borislav Petkov <bp@...en8.de>
Cc: tglx@...utronix.de, mingo@...hat.com, dave.hansen@...el.com,
luto@...nel.org, peterz@...radead.org,
sathyanarayanan.kuppuswamy@...ux.intel.com, aarcange@...hat.com,
ak@...ux.intel.com, dan.j.williams@...el.com, david@...hat.com,
hpa@...or.com, jgross@...e.com, jmattson@...gle.com,
joro@...tes.org, jpoimboe@...hat.com, knsathya@...nel.org,
pbonzini@...hat.com, sdeep@...are.com, seanjc@...gle.com,
tony.luck@...el.com, vkuznets@...hat.com, wanpengli@...cent.com,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/26] x86/tdx: Support TDX guest port I/O at
decompression time
On Thu, Jan 13, 2022 at 02:51:54PM +0100, Borislav Petkov wrote:
> On Tue, Dec 14, 2021 at 06:02:48PM +0300, Kirill A. Shutemov wrote:
> > From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
> >
> > Port IO triggers a #VE exception in TDX guests. During normal runtime,
> > the kernel will handle those exceptions for any port IO.
> >
> > But for the early code in the decompressor, #VE cannot be used because
> > the IDT needed for handling the exception is not set up.
> ... yet.
>
> Well, we're setting up and IDT twice in
>
> arch/x86/boot/compressed/idt_64.c
>
> as early as startup_64 for SEV. And the second stage one
> do_boot_stage2_vc() handles port IO too.
>
> Can't you hook in your VE handler there too?
We certainly can. But do we want to?
IIUC, SEV has to handle #VC very early to deal with CPUID and covering
port I/O in addition via the exception is a logical step.
We had some back and forth on #VE vs direct hypercalls for port I/O in
decompresser and we settled on direct hypercalls.
Adding all the plumbing for #VE just to deal with port I/O was considered
overkill. And I expect debugging exception infrastructure is harder than
direct hypercalls.
Do you see it differently? Do you want to switch to #VE here?
> > Replace IN/OUT instructions with TDX IO hypercalls by defining helper
> > macros __in/__out and by re-defining them in the decompressor code.
> > Also, since TDX IO hypercall requires an IO size parameter, allow
> > __in/__out macros to accept size as an input parameter.
>
> Please end function/macro names with parentheses. I think in this
> particular case you wanna say
>
> "__in*()/__out*() macros"
>
> When a function is mentioned in the changelog, either the text body or the
> subject line, please use the format 'function_name()'. Omitting the
> brackets after the function name can be ambiguous::
>
> Subject: subsys/component: Make reservation_count static
>
> reservation_count is only used in reservation_stats. Make it static.
>
> The variant with brackets is more precise::
>
> Subject: subsys/component: Make reservation_count() static
>
> reservation_count() is only called from reservation_stats(). Make it
> static.
Okay, got it.
--
Kirill A. Shutemov
Powered by blists - more mailing lists