[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4baa3bd4-cbc3-49b3-b8e6-09a2079c8363@intel.com>
Date: Thu, 14 Aug 2025 09:50:58 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Elena Reshetova <elena.reshetova@...el.com>
Cc: jarkko@...nel.org, seanjc@...gle.com, kai.huang@...el.com,
mingo@...nel.org, linux-sgx@...r.kernel.org, linux-kernel@...r.kernel.org,
x86@...nel.org, asit.k.mallick@...el.com, vincent.r.scarlata@...el.com,
chongc@...gle.com, erdemaktas@...gle.com, vannapurve@...gle.com,
bondarn@...gle.com, scott.raynor@...el.com
Subject: Re: [PATCH v14 5/5] x86/sgx: Enable automatic SVN updates for SGX
enclaves
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?
Powered by blists - more mailing lists