On Wed, Sep 30, 2020 at 02:45:54PM +0300, Jarkko Sakkinen wrote: > On Wed, Sep 30, 2020 at 09:12:06AM +0200, Jethro Beekman wrote: > > On 2020-09-30 03:16, Jarkko Sakkinen wrote: > > > On Tue, Sep 29, 2020 at 05:52:48PM +0200, Jethro Beekman wrote: > > >> Since the latest API changes, I'm unable to load a large enclave. The > > >> test program at > > >> https://github.com/fortanix/rust-sgx/blob/sgx-load-large-enclave-test/src/main.rs > > >> always fails with ENOMEM after loading 0xffd6 pages. > > >> > > >> I've tested this with v36, if there's reason to believe it has been > > >> fixed I'd be happy to try it out on a newer patch set. > > > > > > I recommend using v39-rc1 tag that I created for testing because API is > > > reverted back to be compatible with v36. > > > > Not sure what you're saying. I tested with v36. You're saying v39-rc1 > > will be the same? Or did you fix the issue since v36? > > v37 and v38 has an API change that is reverted in v39: > > https://lore.kernel.org/linux-sgx/20200921195822.GA58176@xxxxxxxxxxxxxxx/ > > I'm not sure of the root cause yet but you asked to try to out a newer > patch set and v39-rc1 is the best option. > > There was off-by-one error in enclave maximum size calculation fixed in > v37 (it was actually a bug in SDM inherited to the code) but that should > not result the situation you just described. Jethro, I'll try to set up your environment and start looking into this, but in the mean time can you provide a trivial ftrace dump? Here's what you shoud do: 1. Install trace-cmd. It's tool that works as frontend for ftrace among other things. ftrace is one of the many tracing frameworks in the Linux kernel. 2. Run trace-cmd start -p function -l 'sgx*'. This will start to trace exported sgx prefixed functions. 3. Run your test. 4. Dump trace-cmd show output to a text file and send that to me. 5. trace-cmd stop stops the tracing framework. Thank you. /Jarkko