Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3714816ybi; Mon, 10 Jun 2019 15:28:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgKLzc1TEyy+GiaZbiSNmh0XdmLQP1Gg3Yb/0o9rF1ehe8jSG1T9BTYEPD9WwMSlfYbzA3 X-Received: by 2002:a17:902:7591:: with SMTP id j17mr73094146pll.200.1560205739276; Mon, 10 Jun 2019 15:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560205739; cv=none; d=google.com; s=arc-20160816; b=b0NFYi5ix/MaWz+wWhlY15ECvS+hEK03AZC87R11E8FziEXRcEXH3EFzb99fbUYVXa bRUNXpMGb7h3KB3YItO8wDLwQJNFDsMq0q0tu7B0aFiNXs2Ssv99drZa/k6BjI2Uxw5W W2LX2Wbhaom9O0DK9/6X88cKaoKnLgf8MYqWnIpq5LyyLwYh8juLlzT0cpWNex2pcC3P ivrgxwiqsxscTaBq8SaI3T+cpbT9vAfRtLSaVtW5Jm7ADU3GKEtZG4+bl4X5BGjgZ4B4 LenfuG0KaGB0oL8MLsPtl1pFkOzcPnfrImWapxoL4bwwbk3lX+wDc6cfv49E9/EmVIj8 CqQA== 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=jWzyiXE10cvzDEd66ReRL/A12WrhYrwVBulo+0WMp4o=; b=fwfARtQq9R0dlHhaXwsuJHKDxRadIzh2IYX6hhUZgfkLoaZ7r1nu3QUu4Ivdpz1epw xiXF/ok9iOHFUngozK8jOksWR7WO7Vitd7sAxa7bR4gg/oVzQUXSrzxLr1qv+3gjOy8h BhW3j0CVSLuaovT61sTwdU6eW0nKbQJIkWUQGEv6ui795d5eOMHcjqT0ldP4KVjQDAVC upXpAPyVlx1890v+C/z8EMm7VL68N1gjs0vwpPd5jnHuCDw/6p566o0XRkLCryS/QlDj ajxXCt3TNDudRHBmbOlhORogMg542jsiogvXx2VbpgaphCxwI5Fh963dKMI4SouzX9GY gDkA== 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 p61si1611516plb.17.2019.06.10.15.28.43; Mon, 10 Jun 2019 15:28:59 -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 S2390255AbfFJW2j (ORCPT + 99 others); Mon, 10 Jun 2019 18:28:39 -0400 Received: from mga05.intel.com ([192.55.52.43]:8878 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388328AbfFJW2i (ORCPT ); Mon, 10 Jun 2019 18:28:38 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 15:28:36 -0700 X-ExtLoop1: 1 Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga005.jf.intel.com with ESMTP; 10 Jun 2019 15:28:36 -0700 Received: from orsmsx123.amr.corp.intel.com (10.22.240.116) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Jun 2019 15:28:35 -0700 Received: from orsmsx116.amr.corp.intel.com ([169.254.7.166]) by ORSMSX123.amr.corp.intel.com ([169.254.1.28]) with mapi id 14.03.0415.000; Mon, 10 Jun 2019 15:28:35 -0700 From: "Xing, Cedric" To: Andy Lutomirski CC: "Christopherson, Sean J" , "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 v2 2/5] x86/sgx: Require userspace to define enclave pages' protection bits Thread-Topic: [RFC PATCH v2 2/5] x86/sgx: Require userspace to define enclave pages' protection bits Thread-Index: AQHVHA02SpPQp25T6UKJfs0Hq6ptA6aVOU0QgACFp4D//7q0cA== Date: Mon, 10 Jun 2019 22:28:34 +0000 Message-ID: <960B34DE67B9E140824F1DCDEC400C0F655010EF@ORSMSX116.amr.corp.intel.com> References: <20190606021145.12604-1-sean.j.christopherson@intel.com> <20190606021145.12604-3-sean.j.christopherson@intel.com> <960B34DE67B9E140824F1DCDEC400C0F65500E13@ORSMSX116.amr.corp.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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2M1NzlmODctMzY3NS00MDEyLTg2OTAtYmUxYTViMjIwM2VjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVkd3WUUxSllibVRVcXMzUDYwcXVQZnNrK01uOHNQdWljU1pvTGo3bzhIeGxZSTFkZVZnTjJEWjVza0Jkdk5jQiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.138] 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 IE1vbmRheSwgSnVuZSAxMCwgMjAxOSAxMjoxNSBQTQ0KPiANCj4gT24gTW9uLCBKdW4gMTAsIDIw MTkgYXQgMTE6MjkgQU0gWGluZywgQ2VkcmljIDxjZWRyaWMueGluZ0BpbnRlbC5jb20+DQo+IHdy b3RlOg0KPiA+DQo+ID4gPiBGcm9tOiBDaHJpc3RvcGhlcnNvbiwgU2VhbiBKDQo+ID4gPiBTZW50 OiBXZWRuZXNkYXksIEp1bmUgMDUsIDIwMTkgNzoxMiBQTQ0KPiA+ID4NCj4gPiA+ICsvKioNCj4g PiA+ICsgKiBzZ3hfbWFwX2FsbG93ZWQgLSBjaGVjayB2bWEgcHJvdGVjdGlvbnMgYWdhaW5zdCB0 aGUgYXNzb2NpYXRlZA0KPiA+ID4gZW5jbGF2ZSBwYWdlDQo+ID4gPiArICogQGVuY2w6ICAgIGFu IGVuY2xhdmUNCj4gPiA+ICsgKiBAc3RhcnQ6ICAgc3RhcnQgYWR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