Re: x86/sgx: uapi change proposal

From: Arnd Bergmann
Date: Thu Dec 20 2018 - 07:09:06 EST


On Wed, Dec 19, 2018 at 10:26 AM Jethro Beekman <jethro@xxxxxxxxxxxx> wrote:
>
> On 2018-12-19 13:28, Jarkko Sakkinen wrote:
> > /**
> > * struct sgx_enclave_add_page - parameter structure for the
> > * %SGX_IOC_ENCLAVE_ADD_PAGE ioctl
> > * @eclave_fd: file handle to the enclave address space
> > * @src: address for the page data
> > * @secinfo: address for the SECINFO data
> > * @mrmask: bitmask for the measured 256 byte chunks
> > */
> > struct sgx_enclave_add_page {
> > __u64 enclave_fd;
> > __u64 src;
> > __u64 secinfo;
> > __u16 mrmask;
> > } __attribute__((__packed__));
>
> Wouldn't you just pass enclave_fd as the ioctl fd parameter?
>
> How to specify the address of the page that is being added?

One more comment about the structure: I would generally recommend
against packing structures like this. Instead just extend the mrmask
member to 64 bits as well.

Arnd