Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4210977img; Tue, 26 Mar 2019 05:20:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4G2waRkd/Vz6EuYz+TrSbr/gIlU8oHdKFq2tQ6jkTZ+Zm+O2qsTB82OArpfJqOsp8JFds X-Received: by 2002:a63:2045:: with SMTP id r5mr28134267pgm.394.1553602818414; Tue, 26 Mar 2019 05:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553602818; cv=none; d=google.com; s=arc-20160816; b=NlNwguvNWT0Ug5ArvUwbefTB4zZAbQ6Svwv1YM/nfb/OfBqsPstklf4eR0NZGIVYUK 071kaNI3qtE/BcfEqzcWanDjc3afPsG/aKclSYg4rJhDM43dTH7LGLrdFX2szmVtm74Q RtAucftM+dmhiow8FPZshvtQSeV3R4/7E0Tt9heoc1KnPb6mp9Vdn+rzy6NMoQzvDalo XqgZ125ur+R/B84mFASpHGAHcbNadu1b8/NTtO9jHi6lB9KjKMF5rzzSt9Q8dNngyZwV keMnv+k6OaYgE7JXm9GTnIgpqDpbZmmCoHX86QJ3m5wYKu1eOkGBVYvLpzeDISGRNs9P bVpQ== 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 :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from; bh=9/uE6f5EmQ+vhgQDikd0dVbRV7l1Pg4el1PNUGiiaCg=; b=wbmI9PngJWKxdLeRiIVr3UedFTt1tk4hgRjovHPSHeR0HCyvmdhI7VBq2hrniAoEPC SJaYj2vhXzK+vFr+bzcLXopltV/ayu+PL0pPl5Nihhnsg3EokCdRCeGGaw8J0Esw0dlN zW75Z+RJm36L9MlxU0x8Ek11w/Sn1JggMk4zMOMQOTX+dutD16gIp8Pp1Gwy9AxzWaHX +ElH40peCja9B5uYuZT21cFtcdIue2CrG9ZmTck0/kF2HD2vQGHs81Q78ptitr7wUe7P ImpjUDv2EdIqFg6+q9dP9CM9onFsQt+sP8HEcSx3xdFLIbtqhkePoOfcYjE7sUGDCk/7 3a0A== 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 w65si15741148pfb.86.2019.03.26.05.20.02; Tue, 26 Mar 2019 05:20:18 -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 S1731499AbfCZMR6 (ORCPT + 99 others); Tue, 26 Mar 2019 08:17:58 -0400 Received: from mga04.intel.com ([192.55.52.120]:19910 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfCZMR5 (ORCPT ); Tue, 26 Mar 2019 08:17:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 05:17:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="144002255" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by FMSMGA003.fm.intel.com with ESMTP; 26 Mar 2019 05:17:54 -0700 Received: from pgsmsx112.gar.corp.intel.com ([169.254.3.114]) by KMSMSX153.gar.corp.intel.com ([169.254.5.176]) with mapi id 14.03.0415.000; Tue, 26 Mar 2019 20:17:40 +0800 From: "Huang, Kai" To: "jarkko.sakkinen@linux.intel.com" , "linux-kernel@vger.kernel.org" , "linux-sgx@vger.kernel.org" , "x86@kernel.org" CC: "Svahn, Kai" , "nhorman@redhat.com" , "Christopherson, Sean J" , "josh@joshtriplett.org" , "tglx@linutronix.de" , "Ayoun, Serge" , "Huang, Haitao" , "akpm@linux-foundation.org" , "npmccallum@redhat.com" , "rientjes@google.com" , "luto@kernel.org" , "Katz-zamir, Shay" , "Hansen, Dave" , "bp@alien8.de" , "andriy.shevchenko@linux.intel.com" Subject: Re: [PATCH v19,RESEND 08/27] x86/cpu/intel: Detect SGX support and update caps appropriately Thread-Topic: [PATCH v19,RESEND 08/27] x86/cpu/intel: Detect SGX support and update caps appropriately Thread-Index: AQHU3zky6JmIjy9D9kKUr6BC7GDLPqYdVzoA Date: Tue, 26 Mar 2019 12:17:40 +0000 Message-ID: <1553602654.17255.15.camel@intel.com> References: <20190320162119.4469-1-jarkko.sakkinen@linux.intel.com> <20190320162119.4469-9-jarkko.sakkinen@linux.intel.com> In-Reply-To: <20190320162119.4469-9-jarkko.sakkinen@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.24.201] Content-Type: text/plain; charset="utf-8" Content-ID: <30A81F9D69E31C419085BBE1A5E2F10F@intel.com> 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 T24gV2VkLCAyMDE5LTAzLTIwIGF0IDE4OjIxICswMjAwLCBKYXJra28gU2Fra2luZW4gd3JvdGU6 DQo+IEZyb206IFNlYW4gQ2hyaXN0b3BoZXJzb24gPHNlYW4uai5jaHJpc3RvcGhlcnNvbkBpbnRl bC5jb20+DQo+IA0KPiBT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