Re: [RFC PATCH 3/9] x86/sgx: Allow userspace to add multiple pages in single ioctl()

From: Dave Hansen
Date: Mon Jun 03 2019 - 16:18:38 EST


On 5/31/19 4:31 PM, Sean Christopherson wrote:
> -struct sgx_enclave_add_page {
> +struct sgx_enclave_add_pages {
> __u64 addr;
> __u64 src;
> __u64 secinfo;
> + __u32 nr_pages;
> __u16 mrmask;
> } __attribute__((__packed__));

IMNHO this follows a user interface anti-pattern: exposing page sizes
where not strictly required.

Think of how this would look to an application if page size was
variable. With this interface, they always need to scale their
operations by page size instead of just aligning it.

BTW, why is nr_pages a u32? Do we never envision a case where you can
add more than 4TB of memory to an enclave? ;)