Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752945AbcD0GuB (ORCPT ); Wed, 27 Apr 2016 02:50:01 -0400 Received: from jbeekman.nl ([149.210.172.151]:47614 "EHLO daxilon.jbeekman.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752384AbcD0GuA (ORCPT ); Wed, 27 Apr 2016 02:50:00 -0400 X-Greylist: delayed 688 seconds by postgrey-1.27 at vger.kernel.org; Wed, 27 Apr 2016 02:50:00 EDT To: Jarkko Sakkinen , gregkh@linuxfoundation.org References: <1461605698-12385-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1461605698-12385-4-git-send-email-jarkko.sakkinen@linux.intel.com> Cc: "open list:STAGING SUBSYSTEM" , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , "open list:X86 ARCHITECTURE 32-BIT AND 64-BIT" , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner From: Jethro Beekman X-Enigmail-Draft-Status: N1110 Message-ID: <57206102.3050507@jbeekman.nl> Date: Tue, 26 Apr 2016 23:49:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1461605698-12385-4-git-send-email-jarkko.sakkinen@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 24.130.121.155 X-SA-Exim-Mail-From: kernel@jbeekman.nl X-Spam-Report: Content analysis details: (-1.0 points, 5.0 required) pts rule name description --- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Subject: Re: [PATCH 3/6] intel_sgx: driver for Intel Secure Guard eXtensions Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1100 Lines: 37 On 25-04-16 10:34, Jarkko Sakkinen wrote: > diff --git a/drivers/staging/intel_sgx/isgx_ioctl.c b/drivers/staging/intel_sgx/isgx_ioctl.c > new file mode 100644 > index 0000000..9d8b36b > --- /dev/null > +++ b/drivers/staging/intel_sgx/isgx_ioctl.c > > +static long isgx_ioctl_enclave_create(struct file *filep, unsigned int cmd, > + unsigned long arg) > > + secs->base = vm_mmap(filep, 0, secs->size, > + PROT_READ | PROT_WRITE | PROT_EXEC, > + MAP_SHARED, 0); Why does the ioctl interface map userspace memory for an open device? There's already a perfectly good syscall for that: mmap. > diff --git a/drivers/staging/intel_sgx/isgx_user.h b/drivers/staging/intel_sgx/isgx_user.h > new file mode 100644 > index 0000000..672d19c > --- /dev/null > +++ b/drivers/staging/intel_sgx/isgx_user.h > > +#define SGX_ADD_SKIP_EEXTEND 0x1 > + > +struct sgx_add_param { > + unsigned long addr; > + unsigned long user_addr; > + struct isgx_secinfo *secinfo; > + unsigned int flags; > +}; The hardware supports calling EEXTEND on only a part of a page, I think the driver should also support that. Jethro