RE: [PATCH v11 3/5] x86/sgx: Define error codes for use by ENCLS[EUPDATESVN]

From: Reshetova, Elena
Date: Fri Aug 08 2025 - 06:49:47 EST


> -----Original Message-----
> From: Huang, Kai <kai.huang@xxxxxxxxx>
> Sent: Thursday, August 7, 2025 2:50 AM
> To: Reshetova, Elena <elena.reshetova@xxxxxxxxx>; Hansen, Dave
> <dave.hansen@xxxxxxxxx>
> Cc: seanjc@xxxxxxxxxx; mingo@xxxxxxxxxx; Scarlata, Vincent R
> <vincent.r.scarlata@xxxxxxxxx>; x86@xxxxxxxxxx; jarkko@xxxxxxxxxx;
> Annapurve, Vishal <vannapurve@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx;
> Mallick, Asit K <asit.k.mallick@xxxxxxxxx>; Aktas, Erdem
> <erdemaktas@xxxxxxxxxx>; Cai, Chong <chongc@xxxxxxxxxx>; Bondarevska,
> Nataliia <bondarn@xxxxxxxxxx>; linux-sgx@xxxxxxxxxxxxxxx; Raynor, Scott
> <scott.raynor@xxxxxxxxx>
> Subject: Re: [PATCH v11 3/5] x86/sgx: Define error codes for use by
> ENCLS[EUPDATESVN]
>
> On Wed, 2025-08-06 at 11:11 +0300, Elena Reshetova wrote:
> > Add error codes for ENCLS[EUPDATESVN], then SGX CPUSVN update
> > process can know the execution state of EUPDATESVN and notify
> > userspace.
>
> I would also add some text to explain why other error codes are not
> defined:
>
> EUPDATESVN will be called when no active SGX user is guaranteed. Only add
> the error codes that can legally happen. E.g., it could also fail due to
> "SGX not ready" when there's SGX users but it wouldn't happen in this
> implementation.

Sure, will add in the next iteration, thanks!