Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4751045img; Tue, 26 Mar 2019 16:22:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQoi3BpZb9PcKKE8mi+okVvJbNbmxhGmfcjf5L+TmyOBpMcZSEkXjst8ful+Gvp77rykm3 X-Received: by 2002:a17:902:b217:: with SMTP id t23mr34326309plr.184.1553642548172; Tue, 26 Mar 2019 16:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553642548; cv=none; d=google.com; s=arc-20160816; b=RCveecFKYs82WjkuvC47CD7hWObnCxi8WMCkUriAe8Aut9vzv4FVNTSZoy4mE+cJIc DGC//iAUQAwmYQMTfiABTwE7i6hPnpb4EmRM/hQ4N3kBBIrf1HHpSbsh+vQ5UWyGUtU8 q04iy0KOi9mHf2JdaA4NHrwSEyVRq5cLbCI2qRPROBBoHOB7l5yn9+zuZVhCwdn9IB1T mHIDzICXng8grZbZ2Qzv5n8qPRolpbK/fQqWGRBfrR0YaGknwgfFe6ssWnLH+Ka7DLa2 71F+Rvi0FtiXzpMfu1RDsyRlez/MNvR0PmZdAVhNhfe9R7MPg5QleVKJX8q9jZ8GC1NQ IBZg== 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=0v2cffBN1kMKybvDGxMTn5LI1YjvPVTnOTW/7KVLNjI=; b=Ac0JKXI+IuvfbSuf29uGk3Sp3ovbP3U9VZV8KYsQd92ymEPG4SZGHNKTQK8qjGgRs1 L9KerJ1627THomYAL6VPZQIcYtMSccPBVPEhJ6iXLj+wp6tbXoKw2fLJYrVKP4CsFKuM nkxnxG3hCaQAGYUb1HmQFComtQNLh9WLxBDAqhB4qGlL9FCLQpZuZApneiOU+w3s6jXL XaQ0FnZbuNBO9Ai8oiFH3Q18Y/hR+ZlCjfSKjjt/ug4BuOvQEhI82CZk1oc5OVyH7viq Id3CnaoZMXEGUFCzTV8u6fzmfUegX1bqyPF9Ym3Pgjku5hz86+j16jS9yL5CEQRot50v VIPg== 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 b24si16911519pgl.23.2019.03.26.16.22.11; Tue, 26 Mar 2019 16:22:28 -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 S1732730AbfCZXUU convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Mar 2019 19:20:20 -0400 Received: from mga11.intel.com ([192.55.52.93]:5842 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726922AbfCZXUU (ORCPT ); Tue, 26 Mar 2019 19:20:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 16:20:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,274,1549958400"; d="scan'208";a="158669207" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga001.fm.intel.com with ESMTP; 26 Mar 2019 16:20:16 -0700 Received: from pgsmsx112.gar.corp.intel.com ([169.254.3.114]) by KMSMSX152.gar.corp.intel.com ([169.254.11.213]) with mapi id 14.03.0415.000; Wed, 27 Mar 2019 07:20:01 +0800 From: "Huang, Kai" To: "Christopherson, Sean J" CC: "jarkko.sakkinen@linux.intel.com" , "linux-kernel@vger.kernel.org" , "linux-sgx@vger.kernel.org" , "x86@kernel.org" , "Svahn, Kai" , "nhorman@redhat.com" , "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: AQHU3zky6JmIjy9D9kKUr6BC7GDLPqYdVzoAgAAkQICAAPek0P//hiCAgACc10A= Date: Tue, 26 Mar 2019 23:19:59 +0000 Message-ID: <105F7BF4D0229846AF094488D65A0989356F3436@PGSMSX112.gar.corp.intel.com> References: <20190320162119.4469-1-jarkko.sakkinen@linux.intel.com> <20190320162119.4469-9-jarkko.sakkinen@linux.intel.com> <1553602654.17255.15.camel@intel.com> <20190326142719.GC3757@linux.intel.com> <105F7BF4D0229846AF094488D65A0989356F307D@PGSMSX112.gar.corp.intel.com> <20190326215727.GG3757@linux.intel.com> In-Reply-To: <20190326215727.GG3757@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGM1YjM3NzEtZTI1MS00NzJlLWFjMmYtY2MxZDkwYzAxNzU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRVdVczFaTU9MZE9mZENWY2EwXC9HMTVhYlVJWEMzWExSTURcLzU4emFJT2h5dVc5NlBPOG82c3FRK2htMEtITmJiIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Tue, Mar 26, 2019 at 02:25:52PM -0700, Huang, Kai wrote: > > > > > > That being said, this in no way impacts KVM's ability to virtualize SGX, e.g. > > > KVM can directly do CPUID and {RD,WR}MSR to probe the capabilities > > > of the platform as needed. > > > > I am not following. KVM can do whatever it wants, but it cannot change > > the fact that KVM guest cannot run intel enclave if platform's MSRs > > are configured to 3rd party and locked. > > > > Or am I misunderstanding? > > What does that have to do with this patch? The only thing this patch does is > clear a *software* bit that says "SGX LC is enabled" so that the kernel can > make the reasonable assumption that the MSRs are writable when > X86_FEATURE_SGX_LC=1. Sorted out offline discussion with you. Will let you handle :) Thanks, -Kai