[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-RY8-bL2snpRKTB@kernel.org>
Date: Wed, 26 Mar 2025 21:43:47 +0200
From: Jarkko Sakkinen <jarkko@...nel.org>
To: "Reshetova, Elena" <elena.reshetova@...el.com>
Cc: "Hansen, Dave" <dave.hansen@...el.com>,
"linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"Mallick, Asit K" <asit.k.mallick@...el.com>,
"Scarlata, Vincent R" <vincent.r.scarlata@...el.com>,
"Cai, Chong" <chongc@...gle.com>,
"Aktas, Erdem" <erdemaktas@...gle.com>,
"Annapurve, Vishal" <vannapurve@...gle.com>,
"dionnaglaze@...gle.com" <dionnaglaze@...gle.com>,
"bondarn@...gle.com" <bondarn@...gle.com>,
"Raynor, Scott" <scott.raynor@...el.com>,
"Shutemov, Kirill" <kirill.shutemov@...el.com>
Subject: Re: [PATCH 1/4] x86/sgx: Add total number of EPC pages
On Mon, Mar 24, 2025 at 12:12:41PM +0000, Reshetova, Elena wrote:
> > On Fri, Mar 21, 2025 at 02:34:40PM +0200, Elena Reshetova wrote:
> > > In order to successfully execute ENCLS[EUPDATESVN], EPC must be empty.
> > > SGX already has a variable sgx_nr_free_pages that tracks free
> > > EPC pages. Add a new variable, sgx_nr_total_pages, that will keep
> > > track of total number of EPC pages. It will be used in subsequent
> > > patch to change the sgx_nr_free_pages into sgx_nr_used_pages and
> > > allow an easy check for an empty EPC.
> >
> > First off, remove "in subsequent patch".
>
> Ok
>
> >
> > What does "change sgx_nr_free_pages into sgx_nr_used_pages" mean?
>
> As you can see from patch 2/4, I had to turn around the meaning of the
> existing sgx_nr_free_pages atomic counter not to count the # of free pages
> in EPC, but to count the # of used EPC pages (hence the change of name
> to sgx_nr_used_pages). The reason for doing this is only apparent in patch
Why you *absolutely* need to invert the meaning and cannot make
this work by any means otherwise?
I doubt highly doubt this could not be done other way around.
BR, Jarkko
Powered by blists - more mailing lists