[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5cfb2e09-7ecb-4144-9122-c11152b18b5e@intel.com>
Date: Wed, 25 Jun 2025 10:58:37 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
pbonzini@...hat.com, seanjc@...gle.com, dave.hansen@...ux.intel.com
Cc: rick.p.edgecombe@...el.com, isaku.yamahata@...el.com,
kai.huang@...el.com, yan.y.zhao@...el.com, chao.gao@...el.com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, kvm@...r.kernel.org,
x86@...nel.org, linux-coco@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 01/12] x86/tdx: Consolidate TDX error handling
On 6/9/25 12:13, Kirill A. Shutemov wrote:
> Move all (host, kvm, guest) code related to TDX error handling into
> <asm/tdx_errno.h>.
>
> Add inline functions to check errors.
I really prefer that code moves and introduction of new things be done
_separately_.
It's a lot easier to check for errors in the move when it's the on
...
> ret = __tdcall(TDG_MR_REPORT, &args);
> if (ret) {
> - if (TDCALL_RETURN_CODE(ret) == TDCALL_INVALID_OPERAND)
> + if (tdx_operand_invalid(ret))
> return -EINVAL;
> return -EIO;
> }
That said, the resulting code here is a lot nicer that what you started
with.
...
> -/*
> - * TDX module SEAMCALL leaf function error codes
> - */
> -#define TDX_SUCCESS 0ULL
> -#define TDX_RND_NO_ENTROPY 0x8000020300000000ULL
Kai, you were responsible for this nugget. What do you think of this patch?
> --- a/arch/x86/kvm/vmx/tdx.c
> +++ b/arch/x86/kvm/vmx/tdx.c
> @@ -202,12 +202,6 @@ static DEFINE_MUTEX(tdx_lock);
>
> static atomic_t nr_configured_hkid;
>
> -static bool tdx_operand_busy(u64 err)
> -{
> - return (err & TDX_SEAMCALL_STATUS_MASK) == TDX_OPERAND_BUSY;
> -}
> -
> -
Isaku, this one was yours (along with the whitespace damage). What do
you think of this patch?
Powered by blists - more mailing lists