Re: [RFC PATCH v4 2/4] x86/sgx: Implement support for MADV_WILLNEED

Huang, Kai
2023-06-30T00:56:32Z

On Thu, 2023-06-29 at 17:14 -0700, Sean Christopherson wrote:
> On Thu, Jun 29, 2023, Kai Huang wrote:
> > But SGX usrespace needs a *exact* address. MAP_FIXED is the only ABI can
> > guarantee this.
>
> Yes, but you're assuming that userspace is sane and robust. It's *very* possible
> that there exists userspace that doesn't specify MAP_FIXED, but works anyways
> because their setup doesn't cause conflicts and so the hint is sufficient.

I must have missed something. ELRANGE is the first VMA that userspace needs to
do, and given enclave address must be within ELRANGE, the subsequent mmap()s
will always conflict with the ELRANGE VMA? No?