lkml.org 
[lkml]   [2021]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/sgx: Add SGX_PAGE_REPEAT flag for SGX_IOC_ENCLAVE_ADD_PAGES
On Thu, Jun 10, 2021 at 10:21:17AM +0300, Jarkko Sakkinen wrote:
> For uninitialized data, there's a need to add the same page multiple times,
> e.g. a zero page, instead of traversing the source memory forward. With the
> current API, this requires to call SGX_IOC_ENCLAVE_ADD_PAGES multiple
> times, once per page, which is not very efficient.
>
> Add a new SGX_PAGE_REPEAT flag to resolve the issue. When this flag is set
> to the 'flags' field of struct sgx_enclave_pages, the ioctl will apply the
> page at 'src' multiple times, instead of moving forward in the address
> space.
>
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

After sending this, I started to think that maybe it would actually better
to just add SGX_PAGE_ZERO flag, i.e. add zero pages and ignore src. That's
the main use case right now, and saves the user space from extra trouble of
having to do such page by hand.

That neither does prevent adding SGX_PAGE_REPEAT later on. I just see no
point of that generic functionality right now. It only makes simple use
case more complex.

/Jarkko

\
 
 \ /
  Last update: 2021-06-10 11:02    [W:0.049 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site