Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp640179imu; Mon, 5 Nov 2018 06:39:30 -0800 (PST) X-Google-Smtp-Source: AJdET5drAq2QpS7M+iLq6laoOUFefljfmkUHVF2sQMpeu79G8h2EhULJ/iI/AVi+TlCpr83q4L9A X-Received: by 2002:a62:4151:: with SMTP id o78-v6mr22468576pfa.66.1541428770151; Mon, 05 Nov 2018 06:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541428770; cv=none; d=google.com; s=arc-20160816; b=0tF9pLTUMNj4Fq47yyczNxIuLegKVHvMSOXIVyYIwwHZIBOkDVLL7GN6diIgjeJU1e wfVlzumeL3RK8tiG6W1PD+Az/M1zFdtKEkv7YOKTi5sIVFJxi/rlyPbrnWMEevNDR5zc 3jZ3uGg1yfCgazXOTbMCg3mncEohoEWNVXgCWH9ZzmCLizTtXnTuj7BsWXzCJoyBAuY6 3leGXrlSVkdr28gbq/v0CfEGKKNRB7kemdXWouALruON/ILQulHJ32NDMIVF6ixBHHp3 3PJLfCoQ1x5MlDGcm1dp1h4e39cIc/sCf0LrkyJo64rD/YEoL655sJ/MQDk45OyUl07z 6+EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=P4Oky12JqzvG5JblaDF8uONwZnVq89Bt8xxAJAKQ9k0=; b=KRzdrvhFqy4AdXWXd2AUTqPm2FjgIUxBkkUz/Ah1FKqYZO8BcRH+7SeRmL8RwrPnlJ Cui8RlirC8Mjaxcz5cg9Af07O8BPuIh61tjpZGbBYBI11ZJQQNj+gtgX97OLedOWv2PT 0igiu4Nod//smV/oCu7N3wcGOAPDoZ2oQFas2BwwIPVNGxf6WFLuZXAhHbJwysfs6RhS 3Y6IQWsdDtKZ/glBblvfDTkVjoiqdWIUOZqN9Crx6/UYV05czmcHPye6y+/fVukg8KSI iWd1Y04R/SYAQMbzATIANdF9zhhp3KDI/b2WcFXMwpY75wAtk01Vv9vXtYTZ6lIF/Cai H/uQ== 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 gn9si42062049plb.71.2018.11.05.06.39.15; Mon, 05 Nov 2018 06:39:30 -0800 (PST) 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 S1730100AbeKEX6A (ORCPT + 99 others); Mon, 5 Nov 2018 18:58:00 -0500 Received: from mga17.intel.com ([192.55.52.151]:47376 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbeKEX6A (ORCPT ); Mon, 5 Nov 2018 18:58:00 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 06:37:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,468,1534834800"; d="scan'208";a="105405589" Received: from fhoeg-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.66]) by fmsmga001.fm.intel.com with ESMTP; 05 Nov 2018 06:37:50 -0800 Date: Mon, 5 Nov 2018 16:37:49 +0200 From: Jarkko Sakkinen To: Andy Shevchenko Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Platform Driver , linux-sgx@vger.kernel.org, Dave Hansen , sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, mark.shanahan@intel.com, Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Konrad Rzeszutek Wilk , David Woodhouse , "Kirill A. Shutemov" , davidwang@zhaoxin.com, "Levin, Alexander (Sasha Levin)" , qianyue.zj@alibaba-inc.com, Linux Kernel Mailing List Subject: Re: [PATCH v15 14/23] x86/cpu/intel: Clear SGX_LC capability if not enabled in FEATURE_CONTROL Message-ID: <20181105143749.GB2798@linux.intel.com> References: <20181102231320.29164-1-jarkko.sakkinen@linux.intel.com> <20181102231320.29164-15-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 03, 2018 at 03:15:15PM +0200, Andy Shevchenko wrote: > > @@ -618,6 +618,8 @@ static void detect_sgx(struct cpuinfo_x86 *c) > > setup_clear_cpu_cap(X86_FEATURE_SGX1); > > setup_clear_cpu_cap(X86_FEATURE_SGX2); > > } > > + if (unsupported || !(fc & FEATURE_CONTROL_SGX_LE_WR)) > > + setup_clear_cpu_cap(X86_FEATURE_SGX_LC); > > } > > A-ha, I see how you use this variable here (though it's still possible > to get rid of it, choose what is better for readability / > maintenance). I would propose to squash this one to the earlier commit and refactor it in a way that I proposed. Having this part as a separate commit in my opinion is a bit confusing. /Jarkko