Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5929963ybi; Tue, 4 Jun 2019 15:03:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyESX35v1cPE8mPYITAOG7AOlKCvzxt9F41giociRIhdQZjs3jaFx8UcEXovP+z8158DDuu X-Received: by 2002:a17:90a:380d:: with SMTP id w13mr24671604pjb.138.1559685838631; Tue, 04 Jun 2019 15:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559685838; cv=none; d=google.com; s=arc-20160816; b=uzW3+HWBKDMHCKn33XM5itqEuVVofOazDNzkxy4Z/jwEFlX2197DB67XSJFJnY6Wt+ 3jjQWfJCibnSN89PHJaurr/o0N9l1d7Erw9AsoBiHZ6JoAbaVtGQJSCw3kGuE9loRFTp g9Bi17o5QSVVR/N/VPTm4HjMdXb5kVAue6Ni3jkCDl0apLqM9MmknYWVfQVmRRS1q9Qk 98lIxWUlnEmgmO+FASZ9mlVC6QBh0Ce2LSiMgur2f4hafRVn/OgrMYP7XbkSnNN582i0 xXveaWpNe4xF/SG/a0jqrhV/z0La35FODCNFSU5chBDtCe0GnIyaEWsHM/nc631noS0E /JVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=GwSl49SKO2REm8y5H5O/EjX/Six6dOCK7S9/D19g2jU=; b=tRWFBo3cnjuNc4vhnZvP8UC/VhUYfNg/nfp+9u36z00s0OfzIGP6ti7PtxOLIXd0iL t3oZQAgp+dAQfaUmVhLvkk5l5mbqZFZSNqQpdWQVY3Qdes41/Kk+F9P4UOt3QsMagYKJ jTlTU0OCuNbQFVT0dUy0T2vC2+eRcoaKkoa3a/p3umatHUjTq58XRwa/0rG4yjR3/ITY Ibf+4TrXH2fvFv8GgGbpnjyKmM3842kEboiyZwtAVX72cFjZEDVZ6I6gfGWiVrXRmVC3 V4msQwgkSLT/zRUlRDb8bu6egiGEWVvYV/eBwiTFuw4nBWGrHVflm884vCFn7QOv68/k SpdQ== 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 w19si22817368pgj.121.2019.06.04.15.03.42; Tue, 04 Jun 2019 15:03:58 -0700 (PDT) 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 S1726530AbfFDWCb (ORCPT + 99 others); Tue, 4 Jun 2019 18:02:31 -0400 Received: from mga11.intel.com ([192.55.52.93]:42213 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfFDWCa (ORCPT ); Tue, 4 Jun 2019 18:02:30 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2019 15:02:29 -0700 X-ExtLoop1: 1 Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga006.jf.intel.com with ESMTP; 04 Jun 2019 15:02:29 -0700 Received: from orsmsx111.amr.corp.intel.com (10.22.240.12) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 4 Jun 2019 15:02:28 -0700 Received: from orsmsx116.amr.corp.intel.com ([169.254.7.165]) by ORSMSX111.amr.corp.intel.com ([169.254.12.165]) with mapi id 14.03.0415.000; Tue, 4 Jun 2019 15:02:28 -0700 From: "Xing, Cedric" To: Andy Lutomirski , "Christopherson, Sean J" CC: Jarkko Sakkinen , Stephen Smalley , James Morris , "Serge E . Hallyn" , LSM List , "Paul Moore" , Eric Paris , "selinux@vger.kernel.org" , Jethro Beekman , "Hansen, Dave" , "Thomas Gleixner" , Linus Torvalds , LKML , X86 ML , "linux-sgx@vger.kernel.org" , Andrew Morton , "nhorman@redhat.com" , "npmccallum@redhat.com" , "Ayoun, Serge" , "Katz-zamir, Shay" , "Huang, Haitao" , "Andy Shevchenko" , "Svahn, Kai" , Borislav Petkov , Josh Triplett , "Huang, Kai" , David Rientjes , "Roberts, William C" , "Tricca, Philip B" Subject: RE: [RFC PATCH 3/9] x86/sgx: Allow userspace to add multiple pages in single ioctl() Thread-Topic: [RFC PATCH 3/9] x86/sgx: Allow userspace to add multiple pages in single ioctl() Thread-Index: AQHVGAki7TYpY4ZsUk+m4jTej+khLaaJYAJQgAF1XwCAAAjgAIABjEqA//+l+kA= Date: Tue, 4 Jun 2019 22:02:27 +0000 Message-ID: <960B34DE67B9E140824F1DCDEC400C0F654EDBC4@ORSMSX116.amr.corp.intel.com> References: <20190531233159.30992-1-sean.j.christopherson@intel.com> <20190531233159.30992-4-sean.j.christopherson@intel.com> <960B34DE67B9E140824F1DCDEC400C0F654ECBBD@ORSMSX116.amr.corp.intel.com> <20190603200804.GG13384@linux.intel.com> <20190603203950.GJ13384@linux.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmQ1ZDU4NmUtNjVkMC00OTNiLWIyODUtMWU3MDM5OTA4YTdiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiU21lRHFZM1orRk5UNzA0OEh4NU5ZS0syRk5oM0tvTlFJNSs4SlBrS3pEREdhRzhiaFpmYk5uSGlHTmVaRVJRMSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PiBGcm9tOiBBbmR5IEx1dG9taXJza2kgW21haWx0bzpsdXRvQGtlcm5lbC5vcmddDQo+IFNlbnQ6 IFR1ZXNkYXksIEp1bmUgMDQsIDIwMTkgMToxOCBQTQ0KPiANCj4gT24gTW9uLCBKdW4gMywgMjAx OSBhdCAxOjM5IFBNIFNlYW4gQ2hyaXN0b3BoZXJzb24NCj4gPHNlYW4uai5jaHJpc3RvcGhlcnNv bkBpbnRlbC5jb20+IHdyb3RlOg0KPiA+DQo+ID4gT24gTW9uLCBKdW4gMDMsIDIwMTkgYXQgMDE6 MDg6MDRQTSAtMDcwMCwgU2VhbiBDaHJpc3RvcGhlcnNvbiB3cm90ZToNCj4gPiA+IE9uIFN1biwg SnVuIDAyLCAyMDE5IGF0IDExOjI2OjA5UE0gLTA3MDAsIFhpbmcsIENlZHJpYyB3cm90ZToNCj4g PiA+ID4gPiBGcm9tOiBDaHJpc3RvcGhlcnNvbiwgU2VhbiBKDQo+ID4gPiA+ID4gU2VudDogR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