Re: [RFC PATCH 02/23] x86/sgx: Add enum for SGX_CHILD_PRESENT error code

Jarkko Sakkinen
2021-01-12T00:33:44Z

On Wed, Jan 06, 2021 at 02:55:19PM +1300, Kai Huang wrote:
> From: Sean Christopherson <sean.j.christopherson@intel.com>
>
> SGX virtualization requires to allocate "raw" EPC and use it as "virtual
> EPC" for SGX guest. Unlike EPC used by SGX driver, virtual EPC doesn't
> track how EPC pages are used in VM, e.g. (de)construction of enclaves,
> so it cannot guarantee EREMOVE success, e.g. it doesn't have a priori
> knowledge of which pages are SECS with non-zero child counts.
>
> Add SGX_CHILD_PRESENT for use by SGX virtualization to assert EREMOVE
> failures are expected, but only due to SGX_CHILD_PRESENT.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> Signed-off-by: Kai Huang <kai.huang@intel.com>

Acked-by: Jarkko Sakkinen <jarkko@kernel.org>

/Jarkko