Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3653634imm; Mon, 25 Jun 2018 02:15:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLFMbeOW3+ywef1S+us7Dua42e4WpZ3h9zGDvtTQdo6znozGKRHf9GeahDS6vobEnNrjbP8 X-Received: by 2002:a62:3f11:: with SMTP id m17-v6mr8284185pfa.132.1529918143822; Mon, 25 Jun 2018 02:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529918143; cv=none; d=google.com; s=arc-20160816; b=BWpy20RC/Lzm0MvshssQx5oc4WAZdcDhAuR4AWeHe+qSC/ZUY5NX7k2LtMygQpc+tl qAqbzLYGqiQcCHdP7qfoCFver9BX+0pyBQyt6Co3/eS/3LP/tKCZoA/lkBTqcfU+qscL XNR8kajMteRcref5Btxma33VN4NxEUN1jreOz9HSoaFfeBizcF9jDLzAFR9sgh55lyBd ljgTOIWCK/c+GX26KjKmYaIVhdZDJUd5qNaUTIadbUkHIN1JUQzam2ooxZFZDtAlh8gV y06WrR4UFmct3S5nt97Hee23EdjyzZAfxVSnSqPGTOqH/LtxFHmQrVuUdaTrJXC931y3 WBaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=dZZxuHLCrQoN/gq8oCfoasUGRjGEePDeoiwL+YcK5+o=; b=OzhaMfOWXBAxgVgIZoghCmJ7vXU1kc8UIslytdEHYm1RWMuFCLkIaGZFWPYGkGWQY0 k2+ORF/XSsOBH+l7snnZtUeLlCqVJbuVDy3e9qYW8TJr5/10OiyoEN3tBEUbJcRELg+Z gu/tmWlNYIVLjcDblnYSV4RYTZZmTzg+SV0kKGbHBBqJYB3ibY1D++owu/F1vGB5XrE8 Z0+vdNJX2WdwskZCoqfHeqdb5QndUEQKWFX6YlgtpM6RLnCTnu22WbPN1QMj/fO+jf7Q QE5vSayqNvJn+nnmCnpc3IMX7w83Xe+9R5V/eKC6wt196JlFEsEzIClndMFsXh6c9J0c 1WOA== 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 j14-v6si14263168pfd.207.2018.06.25.02.15.29; Mon, 25 Jun 2018 02:15:43 -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 S1754937AbeFYJOc (ORCPT + 99 others); Mon, 25 Jun 2018 05:14:32 -0400 Received: from mga17.intel.com ([192.55.52.151]:38241 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754449AbeFYJO3 (ORCPT ); Mon, 25 Jun 2018 05:14:29 -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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 02:14:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,269,1526367600"; d="scan'208";a="52653829" Received: from jsakkine-mobl1.tm.intel.com (HELO sfriis-mobl.ger.corp.intel.com) ([10.237.50.42]) by orsmga006.jf.intel.com with ESMTP; 25 Jun 2018 02:14:12 -0700 Message-ID: <3ec30640bcb4b38f33e6c92a5e0c1c14ed23bd1b.camel@linux.intel.com> Subject: Re: [PATCH v11 09/13] x86, sgx: basic routines for enclave page cache From: Jarkko Sakkinen To: Sean Christopherson Cc: Dave Hansen , x86@kernel.org, platform-driver-x86@vger.kernel.org, nhorman@redhat.com, npmccallum@redhat.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "open list:INTEL SGX" Date: Mon, 25 Jun 2018 12:14:12 +0300 In-Reply-To: <20180619155924.GA13375@linux.intel.com> References: <20180608171216.26521-1-jarkko.sakkinen@linux.intel.com> <20180608171216.26521-10-jarkko.sakkinen@linux.intel.com> <3c1b04d6-6e93-efaa-1890-101b7fd9784c@intel.com> <20180619145753.GB8034@linux.intel.com> <20180619155924.GA13375@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-06-19 at 08:59 -0700, Sean Christopherson wrote: > On Tue, Jun 19, 2018 at 05:57:53PM +0300, Jarkko Sakkinen wrote: > > On Fri, Jun 08, 2018 at 11:24:12AM -0700, Dave Hansen wrote: > > > On 06/08/2018 10:09 AM, Jarkko Sakkinen wrote: > > > > +static __init bool sgx_is_enabled(bool *lc_enabled) > > > > { > > > > unsigned long fc; > > > > > > > > @@ -41,12 +466,26 @@ static __init bool sgx_is_enabled(void) > > > > if (!(fc & FEATURE_CONTROL_SGX_ENABLE)) > > > > return false; > > > > > > > > + *lc_enabled = !!(fc & FEATURE_CONTROL_SGX_LE_WR); > > > > + > > > > return true; > > > > } > > > > > > I'm baffled why lc_enabled is connected to the enclave page cache. > > > > KVM works only with writable MSRs. Driver works both with writable > > and read-only MSRs. > > That's not true, KVM can/will support SGX regardless of whether or not > Launch Control (LC) is available and/or enabled. KVM does need to > know whether or not LC is enabled. I understood from earlier discussion with talks that this was additional requirement for KVM but please shed some light. Could this be dropped altogether from this patch set and then brought up in the KVM patch set? Right now it is unused. /Jarkko