[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31d0ac3b0b25efde64d502755e7c5f4717fb7f38.camel@intel.com>
Date: Thu, 14 Aug 2025 21:40:33 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "Reshetova, Elena" <elena.reshetova@...el.com>, "Hansen, Dave"
<dave.hansen@...el.com>
CC: "seanjc@...gle.com" <seanjc@...gle.com>, "mingo@...nel.org"
<mingo@...nel.org>, "Scarlata, Vincent R" <vincent.r.scarlata@...el.com>,
"x86@...nel.org" <x86@...nel.org>, "jarkko@...nel.org" <jarkko@...nel.org>,
"Annapurve, Vishal" <vannapurve@...gle.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "Mallick, Asit K" <asit.k.mallick@...el.com>,
"Aktas, Erdem" <erdemaktas@...gle.com>, "Cai, Chong" <chongc@...gle.com>,
"Bondarevska, Nataliia" <bondarn@...gle.com>, "linux-sgx@...r.kernel.org"
<linux-sgx@...r.kernel.org>, "Raynor, Scott" <scott.raynor@...el.com>
Subject: Re: [PATCH v14 5/5] x86/sgx: Enable automatic SVN updates for SGX
enclaves
On Thu, 2025-08-14 at 09:50 -0700, Dave Hansen wrote:
> On 8/14/25 00:34, Elena Reshetova wrote:
> > +/* Mutex to ensure no concurrent EPC accesses during EUPDATESVN */
> > +static DEFINE_MUTEX(sgx_svn_lock);
> > +
> > int sgx_inc_usage_count(void)
> > {
> > + int ret;
> > +
> > + guard(mutex)(&sgx_svn_lock);
> > +
> > + if (!sgx_usage_count) {
> > + ret = sgx_update_svn();
> > + if (ret)
> > + return ret;
> > + }
> > +
> > + sgx_usage_count++;
> > +
> > return 0;
> > }
> >
> > void sgx_dec_usage_count(void)
> > {
> > - return;
> > + sgx_usage_count--;
> > }
>
> How is a plain int-- safe?
>
> Where's the locking?
Sorry I missed this during review too.
Powered by blists - more mailing lists