[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YgGcyGYDHf2KywD9@google.com>
Date: Mon, 7 Feb 2022 22:27:20 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
mingo@...hat.com, bp@...en8.de, 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, tony.luck@...el.com,
vkuznets@...hat.com, wanpengli@...cent.com, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 20/29] x86/tdx: Get page shared bit info from the TDX
module
On Wed, Feb 02, 2022, Thomas Gleixner wrote:
> On Mon, Jan 24 2022 at 18:02, Kirill A. Shutemov wrote:
> > +static void tdx_get_info(void)
> > +{
> > + struct tdx_module_output out;
> > + u64 ret;
> > +
> > + /*
> > + * TDINFO TDX module call is used to get the TD execution environment
> > + * information like GPA width, number of available vcpus, debug mode
> > + * information, etc. More details about the ABI can be found in TDX
> > + * Guest-Host-Communication Interface (GHCI), sec 2.4.2 TDCALL
> > + * [TDG.VP.INFO].
> > + */
> > + ret = __tdx_module_call(TDX_GET_INFO, 0, 0, 0, 0, &out);
> > +
> > + /* Non zero return value indicates buggy TDX module, so panic */
>
> Can you please get rid of these useless comments all over the place. The
> panic() message tells the same story. Please document the non-obvious
> things.
And why isn't there a tdx_module_call() wrapper to panic() on failure? IIRC,
that's why the asm routines had the double underscore, but that detail appears
to have been lost. E.g. __tdx_module_call(TDX_GET_VEINFO, ...) in patch 04 should
also panic, but it currently morphs the #VE into a #GP if it can't retrieve the
info, which will lead to weird "#GPs" on things like vanilla MOV instructions if
something does go wrong. TDX_ACCEPT_PAGE is the only call into the TDX Module
for which failure is not fatal.
Powered by blists - more mailing lists