Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp966209imu; Thu, 20 Dec 2018 08:04:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/WkcD+yyQZgVR8OZ6mDQwesc4+S3fAa/TIreYNgoERXJMWmzQnHqznXOC8qiwxrbMrWtuMV X-Received: by 2002:a17:902:4624:: with SMTP id o33mr24167698pld.289.1545321871079; Thu, 20 Dec 2018 08:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545321871; cv=none; d=google.com; s=arc-20160816; b=IhvJ1cy8TnBsnJbZVWBAYxbMFnb8RF/Pf1AKneEpC4+r2m5qAHdNZyT9KbzwGW0QXN 9HVYayGxJWWveFr3v0yzhc4ZiVOFQAHkE93hELpaet5EDEU0oxfpUrr33sGan4lU0ye2 YGsbV1GK9FH/6IzCrMdC8IjRgF35gV0ky2gBZG22DlEVHU/ge1ujZf0uU5BnfOBrc8lN ilM0CcbXP9NqL15wjVIHkKkQqdkIiU11YkpcTUr3N52xkEVH6NrWXwEVPv/Fe4FZCZ92 LA3bZ2ps/msRn0KqAvr9YEjfgOM2Oko5nndKlsBuaW+SSpQROb2N1QmAfLgDQFKuEh31 dvNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3jUFOlhiOEysYpQdaOljQkPqht8EvzZMyTVuPgsbFJo=; b=Ni4wgEzgyyfFrrNm0irH2jwCvhqr8QKr/SeWkjI42jrH1QxzGgV3NpR5QYD258H/OO Aknk0I2a6fxw4FMW9BG5U/WDfwtL38y4cMQe3kG8T7afmerCT+ErxzuQrjIJlAeolq40 JjNA7YWM8hGQ0zljRU6QQQvMZSFlctblB7wjgH1A98Su0gGRhcZ7E2HbQPNnsHWUB67v sP6jllVm6fcXGxC37SAmav4s8539818gQkxMdE0/a9WYFXjRo0Kh8Z+4nHowkvbDgFx+ WTfoAAHaRvhFuovdcCSSjMga1kLyR3neBBkwH3fA3g/+mOQKVmLFidfhuv0iKrbZoZJa D9tQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si19126756pgc.232.2018.12.20.08.04.12; Thu, 20 Dec 2018 08:04:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732597AbeLTMtq (ORCPT + 99 others); Thu, 20 Dec 2018 07:49:46 -0500 Received: from mga06.intel.com ([134.134.136.31]:29133 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728966AbeLTMtq (ORCPT ); Thu, 20 Dec 2018 07:49:46 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2018 04:49:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,377,1539673200"; d="scan'208";a="129450342" Received: from unknown (HELO localhost) ([10.249.254.232]) by fmsmga004.fm.intel.com with ESMTP; 20 Dec 2018 04:49:38 -0800 Date: Thu, 20 Dec 2018 14:49:37 +0200 From: Jarkko Sakkinen To: Arnd Bergmann Cc: jethro@fortanix.com, Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , Dave Hansen , Peter Zijlstra , sean.j.christopherson@intel.com, "H. Peter Anvin" , Linux Kernel Mailing List , linux-sgx@vger.kernel.org, Andy Lutomirski , Josh Triplett , haitao.huang@linux.intel.com, greg@enjellic.com Subject: Re: x86/sgx: uapi change proposal Message-ID: <20181220124937.GA3753@linux.intel.com> References: <20181214215729.4221-1-sean.j.christopherson@intel.com> <7706b2aa71312e1f0009958bcab24e1e9d8d1237.camel@linux.intel.com> <598cd050-f0b5-d18c-96a0-915f02525e3e@fortanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 01:08:46PM +0100, Arnd Bergmann wrote: > On Wed, Dec 19, 2018 at 10:26 AM Jethro Beekman 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. Can do. Thanks for the remark. /Jarkko