[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4838ad3b-af1c-481b-acb9-9c33943a018b@intel.com>
Date: Mon, 21 Jul 2025 09:47:49 -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 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.
Powered by blists - more mailing lists