[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19f8e93e-62c4-485c-a7c3-f29740fc3eca@linux.intel.com>
Date: Wed, 18 Oct 2023 07:17:12 -0700
From: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>
To: Kai Huang <kai.huang@...el.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: x86@...nel.org, dave.hansen@...el.com,
kirill.shutemov@...ux.intel.com, peterz@...radead.org,
tony.luck@...el.com, tglx@...utronix.de, bp@...en8.de,
mingo@...hat.com, hpa@...or.com, seanjc@...gle.com,
pbonzini@...hat.com, rafael@...nel.org, david@...hat.com,
dan.j.williams@...el.com, len.brown@...el.com, ak@...ux.intel.com,
isaku.yamahata@...el.com, ying.huang@...el.com, chao.gao@...el.com,
nik.borisov@...e.com, bagasdotme@...il.com, sagis@...gle.com,
imammedo@...hat.com
Subject: Re: [PATCH v14 06/23] x86/virt/tdx: Add SEAMCALL error printing for
module initialization
On 10/17/2023 3:14 AM, Kai Huang wrote:
> The SEAMCALLs involved during the TDX module initialization are not
> expected to fail. In fact, they are not expected to return any non-zero
> code (except the "running out of entropy error", which can be handled
> internally already).
>
> Add yet another set of SEAMCALL wrappers, which treats all non-zero
> return code as error, to support printing SEAMCALL error upon failure
> for module initialization. Note the TDX module initialization doesn't
> use the _saved_ret() variant thus no wrapper is added for it.
>
> SEAMCALL assembly can also return kernel-defined error codes for three
> special cases: 1) TDX isn't enabled by the BIOS; 2) TDX module isn't
> loaded; 3) CPU isn't in VMX operation. Whether they can legally happen
> depends on the caller, so leave to the caller to print error message
> when desired.
>
> Also convert the SEAMCALL error codes to the kernel error codes in the
> new wrappers so that each SEAMCALL caller doesn't have to repeat the
> conversion.
>
> Signed-off-by: Kai Huang <kai.huang@...el.com>
> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> ---
>
> v13 -> v14:
> - Use real functions to replace macros. (Dave)
> - Moved printing error message for special error code to the caller
> (internal)
> - Added Kirill's tag
>
> v12 -> v13:
> - New implementation due to TDCALL assembly series.
>
> ---
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
Powered by blists - more mailing lists