> -----Original Message-----
> From: Hansen, Dave <[email protected]>
> Sent: Monday, July 21, 2025 7:48 PM
> To: Reshetova, Elena <[email protected]>
> Cc: [email protected]; [email protected]; Huang, Kai
> <[email protected]>; [email protected]; [email protected]; linux-
> [email protected]; [email protected]; Mallick, Asit K
> <[email protected]>; Scarlata, Vincent R 
> <[email protected]>;
> Cai, Chong <[email protected]>; Aktas, Erdem <[email protected]>;
> Annapurve, Vishal <[email protected]>; Bondarevska, Nataliia
> <[email protected]>; Raynor, Scott <[email protected]>
> 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