> -----Original Message-----
> From: Hansen, Dave <dave.han...@intel.com>
> Sent: Monday, July 21, 2025 7:48 PM
> To: Reshetova, Elena <elena.reshet...@intel.com>
> Cc: jar...@kernel.org; sea...@google.com; Huang, Kai
> <kai.hu...@intel.com>; mi...@kernel.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; x...@kernel.org; Mallick, Asit K
> <asit.k.mall...@intel.com>; Scarlata, Vincent R 
> <vincent.r.scarl...@intel.com>;
> Cai, Chong <cho...@google.com>; Aktas, Erdem <erdemak...@google.com>;
> Annapurve, Vishal <vannapu...@google.com>; Bondarevska, Nataliia
> <bond...@google.com>; Raynor, Scott <scott.ray...@intel.com>
> Subject: Re: [PATCH v8 1/5] x86/sgx: Introduce a counter to count the
> sgx_(vepc_)open()
> 
> On 7/15/25 05:40, Elena Reshetova wrote:
> > +int sgx_inc_usage_count(void)
> > +{
> > +   sgx_usage_count++;
> > +   return 0;
> > +}
> > +
> > +void sgx_dec_usage_count(void)
> > +{
> > +   sgx_usage_count--;
> > +}
> 
> Gah.
> 
> I know this gets fixed up later in the series with the mutex, but this
> code is broken and racy until that point.
> 
> I'd rather this do _nothing_:
> 
>       int sgx_inc_usage_count(void)
>       {
>               return 0;
>       }
> 
> than a foo++ which just plain doesn't work.

Sure, I can fix it also in v9. 

Best Regards,
Elena.

Reply via email to