Re: [PATCH v5 2/9] x86/sgx: Save enclave pointer for VA page

Jarkko Sakkinen
2022-05-20T19:08:50Z

On Fri, May 20, 2022 at 06:38:57PM +0800, Cathy Zhang wrote:
> Tearing down all enclaves is required by SGX SVN update, which
> involves running the ENCLS[EREMOVE] instruction on every EPC
> page. This (tearing down all enclaves) should be coordinated
> with any enclaves that may be in the process of existing and thus
> already be running ENCLS[EREMOVE] as part of enclave release.
>
> In support of this coordination, it is required to know which enclave
> owns each in-use EPC page. It is already possible to locate the
> owning enclave of SECS and regular pages but not for VA pages.
>
> Make the following changes for VA pages' location:
> 1) Make epc->owner type-agnostic by changing its type to 'void *'. So,
> besides "struct sgx_encl_page", it can have other types, like
> "struct sgx_va_page".
> 2) Save the enclave pointer for each VA page to support locating its
> owning enclave.

Enumeration lists imply that you would better to split this into
two patches.

BR, Jarkko