[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3414aedf5a8f2a854aae82a8ab7b2a6742801e3.camel@intel.com>
Date: Mon, 12 Jun 2023 11:04:49 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"n.borisov.lkml@...il.com" <n.borisov.lkml@...il.com>
CC: "Hansen, Dave" <dave.hansen@...el.com>,
"david@...hat.com" <david@...hat.com>,
"bagasdotme@...il.com" <bagasdotme@...il.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"Luck, Tony" <tony.luck@...el.com>,
"peterz@...radead.org" <peterz@...radead.org>,
"Shahar, Sagi" <sagis@...gle.com>,
"imammedo@...hat.com" <imammedo@...hat.com>,
"Gao, Chao" <chao.gao@...el.com>,
"Brown, Len" <len.brown@...el.com>,
"sathyanarayanan.kuppuswamy@...ux.intel.com"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
"Huang, Ying" <ying.huang@...el.com>,
"Williams, Dan J" <dan.j.williams@...el.com>
Subject: Re: [PATCH v11 06/20] x86/virt/tdx: Handle SEAMCALL running out of
entropy error
On Fri, 2023-06-09 at 17:42 +0300, Nikolay Borisov wrote:
>
> On 4.06.23 г. 17:27 ч., Kai Huang wrote:
> > Certain SEAMCALL leaf functions may return error due to running out of
> > entropy, in which case the SEAMCALL should be retried as suggested by
> > the TDX spec.
> >
> > Handle this case in SEAMCALL common function. Mimic the existing
> > rdrand_long() to retry RDRAND_RETRY_LOOPS times.
> >
> > Signed-off-by: Kai Huang <kai.huang@...el.com>
> > ---
> >
> > v10 -> v11:
> > - New patch
> >
> > ---
> > arch/x86/virt/vmx/tdx/tdx.c | 15 ++++++++++++++-
> > arch/x86/virt/vmx/tdx/tdx.h | 17 +++++++++++++++++
> > 2 files changed, 31 insertions(+), 1 deletion(-)
> >
>
> <snip>
>
> > diff --git a/arch/x86/virt/vmx/tdx/tdx.h b/arch/x86/virt/vmx/tdx/tdx.h
> > index 48ad1a1ba737..55dbb1b8c971 100644
> > --- a/arch/x86/virt/vmx/tdx/tdx.h
> > +++ b/arch/x86/virt/vmx/tdx/tdx.h
> > @@ -4,6 +4,23 @@
> >
> > #include <linux/types.h>
> >
> > +/*
> > + * This file contains both macros and data structures defined by the TDX
> > + * architecture and Linux defined software data structures and functions.
> > + * The two should not be mixed together for better readability. The
> > + * architectural definitions come first.
> > + */
> > +
> > +/*
> > + * TDX SEAMCALL error codes
> > + */
> > +#define TDX_RND_NO_ENTROPY 0x8000020300000000ULL
>
> Where is this return value documented, in TDX module 1.0 spec there are
> only: 8000020[123]00000000 specified and there's 80000800
> (TDX_KEY_GENERATION_FAILED) and its description mentions the possible
> failure due to lack of entropy?
>
It's documented in TDX module V1.5 ABI Specification:
https://cdrdv2.intel.com/v1/dl/getContent/733579
The later versions of TDX module try to use TDX_RND_NO_ENTROPY to cover all
errors due to running out of entropy, but TDX module 1.0 for now doesn't.
This patch aims to resolve this error code in the common code.
Powered by blists - more mailing lists