Dynamic Resizing

63 views
Skip to first unread message

Philipp Giersfeld

unread,
Aug 2, 2023, 8:19:42 AM8/2/23
to Keystone Enclave Forum
Hello, 

I am trying to understand how dynamic resizing in latest Keystone works. Having read the paper and looked at the code, my flaky understanding is that `__spa_get` can be used to obtain a new page from *freemem*, however, I do not understand where *freemem* is allocated. Furthermore, I believe once *freemem* is exhausted, on a page fault, a page is protected and moved to untrusted main memory. Does this mean, that once *freemem* has been allocated, it is not possible to increase the physical memory available to an enclave?

Thanks and regards,
Philipp

Dayeol Lee

unread,
Aug 3, 2023, 3:46:22 PM8/3/23
to Philipp Giersfeld, Keystone Enclave Forum
Hi Philipp,

A few things to clarify:
- We have shown dynamic resizing as a prototype in a branch of our old SM, and has never been merged to upstream. Now this branch is too stale, so merging it would be non-trivial. It means that the upstream Keystone doesn't support dynamic resizing
- The dynamic resizing of Keystone only supports increasing memory, not decreasing. So when freemem runs out, the enclave is supposed to call "extend_enclave" SBI to request for more memory
- Freemem is any memory that sits at the end of the initial enclave binary. When enclave initializes, any unused memories are claimed as freemem, and used by the runtime.

Hope that helps,
Please let me know if there's anything you need.

Thanks,
Dayeol


--
You received this message because you are subscribed to the Google Groups "Keystone Enclave Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keystone-enclave-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keystone-enclave-forum/9c9f2b07-df82-4433-bfce-9bc43f5f5080n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages