[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <052d7b15-1b3f-490e-fb30-538334b67a0a@intel.com>
Date:   Thu, 24 Feb 2022 09:01:42 -0800
From:   Dave Hansen <dave.hansen@...el.com>
To:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        luto@...nel.org, peterz@...radead.org
Cc:     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,
        thomas.lendacky@....com, brijesh.singh@....com, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCHv4 04/30] x86/tdx: Add __tdx_module_call() and
 __tdx_hypercall() helper functions
On 2/24/22 07:56, Kirill A. Shutemov wrote:
> +	tdcall
> +
> +	/*
> +	 * TDVMCALL leaf does not suppose to fail. If it fails something
> +	 * is horribly wrong with TDX module. Stop the world.
> +	 */
> +	testq %rax, %rax
> +	jne .Lpanic
This should be:
	"A TDVMCALL is not supposed to fail."
I also wish this was mentioning something about the difference between a
failure and return code.
	/*
	 * %rax==0 indicates a failure of the TDVMCALL mechanism itself
	 * and that something has gone horribly wrong with the TDX
	 * module.
	 *
	 * The return status of the hypercall operation is separate
	 * (in %r10).  Hypercall errors are a part of normal operation
	 * and are handled by callers.
	 */
I've been confused by this exact thing multiple times over the months
that I've been looking at this code.  I think it deserves a good comment.
Powered by blists - more mailing lists
 
