On Wed, Aug 07, 2019 at 05:12:44PM -0700, Sean Christopherson wrote: > Detect the SECS in paging related flows by explicitly checking the page > against the enclave's SECS page. Assuming a page with VA=0 is the SECS > will break enclaves that actually use VA=0, which is extremely unlikely > but theoretically possible. > > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> I would define a macro to the same place where SGX_ENCL_PAGE_ADDR() is defined and also SGX_ENCL_PAGE_IS_SECS() would definitely more self-describing name. Can't you BTW just use the backpointer in struct sgx_encl_page to the enclave since we have it there? It is even set for SECS in sgx_encl_create(). Also, lets try to avoid VA acronym in SGX context for other than version array. I had a brief moment of confusion when reading the commit message :-) /Jarkko