From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Subject: Re: [PATCH v16 18/22] platform/x86: Intel SGX driver Date: Thu, 15 Nov 2018 22:00:02 +0200 Message-ID: <20181115200002.GA24006@linux.intel.com> References: <20181106134758.10572-1-jarkko.sakkinen@linux.intel.com> <20181106134758.10572-19-jarkko.sakkinen@linux.intel.com> <1541522400.7839.48.camel@intel.com> <20181107163757.GB11509@linux.intel.com> <20181107180057.GB24807@linux.intel.com> <20181108144603.GA14072@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20181108144603.GA14072@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Sean Christopherson Cc: x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-sgx@vger.kernel.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, Suresh Siddha , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Darren Hart , Andy Shevchenko , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" List-Id: platform-driver-x86.vger.kernel.org On Thu, Nov 08, 2018 at 04:46:03PM +0200, Jarkko Sakkinen wrote: > On Wed, Nov 07, 2018 at 10:00:57AM -0800, Sean Christopherson wrote: > > What do we gain by a single buffer vs. separate buffers? The ioctl() > > would be slightly smaller but it seems like the actual code would be > > more complex. > > I'm fine with either. It was just a suggestion. > > > The enclave build process also utilizes the backing as temp storage > > to avoid having to alloc kernel memory when queueing pages to be added > > by the worker thread (which reminds me that I wanted to document why a > > worker thread is used). Keeping this behavior would effectively make > > providing backing mandatory. > > Would it be a problem just allocate those pages with alloc_page() and > free them in the worker thread? > > > Are there any potential complications with ENCLS consuming userspace > > pointers? We'd have to wrap them with user_access_{begin,end}() and > > probably tweak the fixup, but I assume having the fixup handler means > > we're generally ok? > > Last time I did it I used get_user_pages() for pinning. I'm not sure > why I should do anything but just re-use that. What about VA page swapping? Not saying that it'd have to be done right now but we need to answer whether it is enclave local or a global asset. If it is local it would also require an argument. I will most likely won't fix this for v17 because this detail needs careful consideration. /Jarkko