Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5347724imm; Tue, 19 Jun 2018 09:00:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJUpgjAhbgr+AoJoKCC1bJRvVKTsx5wc1xlS5Z9p3rOLaSfypHEUTpfk2TvYuFYmp/48ndd X-Received: by 2002:a17:902:bd8f:: with SMTP id q15-v6mr19793460pls.161.1529424027766; Tue, 19 Jun 2018 09:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529424027; cv=none; d=google.com; s=arc-20160816; b=N2gSVC8vL96rxlvXj7EOlW6F52WicSRF/Bb54tvIqw17zgROndy2ig9nEva1n7ws7N g4qVCCfhO6BkJIPgtfsPYK7GwD4V8ZxtuxMiXA55VAMf1ieNI3Fhn8pFXvwdKQNxTM5w MB5SBneIJvSU+LqB18nH7TEcVhjXir6lWqzD2cR5JUnl1DEI0G5+EqsQXJIWl1HbbomR AxMTAZJV10tOgeBRPThMieEgb22TXNuz7CrhB8RqYd3JZP7EJs+xmebT+GIRUqy8IOqO sm9w7oeMKZavRUQi8Q/poSp7oTOT16lf8KBy/+ZldzkWdO7RR8GY9oFRfzq1PNCl8Rzn nmAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ujkB3N2Q/4U7SxpVgBupDC7+ciMYBk6/mFysRNW1PLw=; b=SVm6VYNHEI6bYdasqs/i0zPjl2cr6JOEi1CmX+fZ1BaycCnbfSomAdTCQMuvAB3moj i/Hw2Mejjgf68IYV9YtC5CAtGhEu9F8IQS3IwCyTQXdkznA1jr/Pzte+NV2xlC8k8Znb b4S96kTKrvGVPa2bnjMpcpi0E/2slKy/6hxVOOu7IpOVOM6wZUCg2oGbb/FDHNO8HHUF FsygQEKtDJyJrW1azSjwQd/1yPAA8ZjC2NstVHBo81y7F+XuUogAgabYx7XsxSGHdSpL Ta84ksU/xVMPO/D0glB7xmeX3Yyh2aBzF7zr7mfLgqTbD9E/AGwK9JjT72g+8TtqCG1G Cyow== 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 d2-v6si20737plh.387.2018.06.19.09.00.13; Tue, 19 Jun 2018 09:00:27 -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 S966803AbeFSP71 (ORCPT + 99 others); Tue, 19 Jun 2018 11:59:27 -0400 Received: from mga11.intel.com ([192.55.52.93]:35525 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966563AbeFSP70 (ORCPT ); Tue, 19 Jun 2018 11:59:26 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2018 08:59:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,243,1526367600"; d="scan'208";a="238787359" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.135]) by fmsmga006.fm.intel.com with ESMTP; 19 Jun 2018 08:59:25 -0700 Date: Tue, 19 Jun 2018 08:59:25 -0700 From: Sean Christopherson To: Jarkko Sakkinen 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" Subject: Re: [PATCH v11 09/13] x86, sgx: basic routines for enclave page cache Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619145753.GB8034@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Back to Dave's question, LC isn't connected to the EPC management, the LC code should be split into a separate patch. > Thanks, I'll try my best to deal with all this :-) > > /Jarkko