On Tue, Mar 14, 2023 at 09:54:30AM -0500, Haitao Huang wrote: > On Thu, 09 Mar 2023 05:31:29 -0600, Huang, Kai <kai.huang@xxxxxxxxx> wrote: > > > > > > Then in v29, PROT_NONE mapping was disallowed for encl_fd before pages > > > EADDed so user space has to mmap anonymously to reserve the range.The > > > intent was still not to allow mmap before pages EADDed (the !page check > > > was still there up to v38) > > > > Do you know the reason of disallowing PROT_NONE mapping against encl_fd? > > > > I think it was to allow user space to do anonymous mapping to reserve > address space for enclave. > Before this point, you have to use PROT_NONE to reserve with encl_fd. There > might be an issue with how #PF and EPC swapping was handled or the elegance > of those flows that motivated the move but I can't remember. ABI was not > fixed at that time so it was OK to change. Yes, this was done because enclave naturally aligned base address. BR, Jarkko