lkml.org 
[lkml]   [2019]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC PATCH 3/9] x86/sgx: Allow userspace to add multiple pages in single ioctl()
Date


> -----Original Message-----
> From: Christopherson, Sean J
> Sent: Monday, June 03, 2019 1:37 PM
> To: Hansen, Dave <dave.hansen@intel.com>
> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>; Andy Lutomirski
> <luto@kernel.org>; Xing, Cedric <cedric.xing@intel.com>; Stephen Smalley
> <sds@tycho.nsa.gov>; James Morris <jmorris@namei.org>; Serge E . Hallyn
> <serge@hallyn.com>; LSM List <linux-security-module@vger.kernel.org>;
> Paul Moore <paul@paul-moore.com>; Eric Paris <eparis@parisplace.org>;
> selinux@vger.kernel.org; Jethro Beekman <jethro@fortanix.com>; Thomas
> Gleixner <tglx@linutronix.de>; Linus Torvalds <torvalds@linux-
> foundation.org>; LKML <linux-kernel@vger.kernel.org>; X86 ML
> <x86@kernel.org>; linux-sgx@vger.kernel.org; Andrew Morton <akpm@linux-
> foundation.org>; nhorman@redhat.com; npmccallum@redhat.com; Ayoun, Serge
> <serge.ayoun@intel.com>; Katz-zamir, Shay <shay.katz-zamir@intel.com>;
> Huang, Haitao <haitao.huang@intel.com>; Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>; Svahn, Kai <kai.svahn@intel.com>;
> Borislav Petkov <bp@alien8.de>; Josh Triplett <josh@joshtriplett.org>;
> Huang, Kai <kai.huang@intel.com>; David Rientjes <rientjes@google.com>;
> Roberts, William C <william.c.roberts@intel.com>; Tricca, Philip B
> <philip.b.tricca@intel.com>
> Subject: Re: [RFC PATCH 3/9] x86/sgx: Allow userspace to add multiple
> pages in single ioctl()
>
> On Mon, Jun 03, 2019 at 01:14:45PM -0700, Dave Hansen wrote:
> > 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.
>
> I briefly considered taking size in bytes, but I took a shortcut because
> EPC pages are architecturally defined to be 4k sized and aligned. That
> being said, I don't necessarily disagree, especially if nr_pages isn't
> squeezed into a u32.
>
> > 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? ;)
>
> Heh, fair enough. IIRC, a while back someone posted about having
> problems building a 512gb enclave in a 92mb EPC...
>
> How about this for the intermediate patch:
>
> struct sgx_enclave_add_region {
> __u64 addr;
> __u64 src;
> __u64 size;
> __u64 secinfo;
> __u16 mrmask;
> __u16 reserved16;
> __u32 reserved;
> }
>
> and with the flags field:
>
> struct sgx_enclave_add_region {
> __u64 addr;
> __u64 src;
> __u64 size;
> __u64 secinfo;
> __u16 mrmask;
> __u16 flags;

What is "flags" here?

> __u32 reserved;
> }

\
 
 \ /
  Last update: 2019-06-04 01:49    [W:0.067 / U:2.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site