Re: [PATCH 2/4] x86/sgx: Change counter sgx_nr_free_pages -> sgx_nr_used_pages

From: Jarkko Sakkinen
Date: Sat Mar 22 2025 - 18:11:07 EST


On Fri, Mar 21, 2025 at 02:34:41PM +0200, Elena Reshetova wrote:
> sgx_nr_free_pages is an atomic that is used to keep track of
> free EPC pages and detect whenever page reclaiming should start.
> Since successful execution of ENCLS[EUPDATESVN] requires empty
> EPC and a fast way of checking for this, change this variable
> around to indicate number of used pages instead. The subsequent
> patch that introduces ENCLS[EUPDATESVN] will take use of this change.

s/subsequent patch//

You should rather express how EUPDATESVN trigger will depend on the
state of sgx_nr_used_pages and sgx_nr_free_pages.

>
> No functional changes intended.

Not really understanding how I should interpret this sentence.

The commit message does not mention sgx_nr_used_pages, and neiher it
makes a case why implementing the feature based on sgx_nr_free_pages is
not possible.

BR, Jarkko