Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1372994ybz; Wed, 29 Apr 2020 21:01:48 -0700 (PDT) X-Google-Smtp-Source: APiQypJPFXh0eo6rQ2xdzlp0gDkQviUDJ0GHWCMjt4pRcbZxk0DSRTaPxUTZIZx8BVAHr2n3wq3P X-Received: by 2002:a17:906:459:: with SMTP id e25mr867749eja.379.1588219308310; Wed, 29 Apr 2020 21:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588219308; cv=none; d=google.com; s=arc-20160816; b=cid1y9jtCV4sWNa0cnZQuTzpLmcN+yYDhHUjAy5iVl+jE26PGFsL7RuvBgULUqgFU2 2TNiz40BcXfWqmiU5aqOUX4c1ITO54Ucen/Z4dtNNgZkCWJsV5DtXDRPjR3BjLSKYGGb tUX3N4FoMy9HcxKhse80egYSQVPWj07EQnB9wc+3ie20qUtHrxSj/nUT1wBRYMKfSetS m+tzmRNiMnr4xQCPrX+JRJRPdIZzMLkOS25qqBkXrbp6/QtmVaSvcWaOC3lXh30kPX0k bX8ir6d7OjEdrEc8PoQ3a/zO3HabnQ3i5JPnYgqClvNjGz+EckZ6rCfZrMiy5xXCn/Kr QkmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=a+Wk6IAKdxB3UClI0OFh6ZZ5yC/riRC5Z0abohDXgIU=; b=aoaN7l8JLxdwRFY52hKLSrNS68DUMCtwmJZvmQwwd0K5aOfTIOf29m5MgUd7XWOSrZ aXpYVd4SzPbTA6BR8aJv8BewU3yN96Kt7pyFnWUgC/O6w9E0rz9r3n601t1VfhbVv8T9 kqKAqJK/NfswyRxmCrPTg25B/m0lkAxRIAb1oPEwmjMU+LGQK4ujxKWNEY5SYwiLoAvD P5HMDsNJTw81MHZhlK6w3zaJb8TjirroZflS/FVfNuZzmvHyLNdpMu5UdPxUUBPe7480 v2DRdD90cJ9GL+3jHd9b+nCrb6F/D81sExUnb3roteG/IlK4msU6rD6B1vDLhRKGy9Rm OaqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l64si3571876ede.47.2020.04.29.21.01.25; Wed, 29 Apr 2020 21:01:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726742AbgD3D7X (ORCPT + 99 others); Wed, 29 Apr 2020 23:59:23 -0400 Received: from mga17.intel.com ([192.55.52.151]:52651 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726474AbgD3D7W (ORCPT ); Wed, 29 Apr 2020 23:59:22 -0400 IronPort-SDR: ZJhZhyHehvW/g29fNP4/8+w3qqlrmaEUq+zFfrn4MeCLpcq/Syf43iClscJoKJsC7JfeQrOxVy 3gvxA9SUjQag== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 20:59:22 -0700 IronPort-SDR: VOTVsbRJbD49pzQSkQdPM+6nI5c9fCzBN6AfdleYJKGnsaDNaYTIURnGp+qAn2J48BV80oxTue xpdDqzPZtADw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,333,1583222400"; d="scan'208";a="432812461" Received: from aanderso-mobl3.amr.corp.intel.com (HELO localhost) ([10.252.52.101]) by orsmga005.jf.intel.com with ESMTP; 29 Apr 2020 20:59:12 -0700 Date: Thu, 30 Apr 2020 06:59:11 +0300 From: Jarkko Sakkinen To: Sean Christopherson Cc: "Dr. Greg" , torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, cedric.xing@intel.com, puiterwijk@redhat.com Subject: Re: [PATCH v29 00/20] Intel SGX foundations Message-ID: <20200430035850.GC31820@linux.intel.com> References: <20200421215316.56503-1-jarkko.sakkinen@linux.intel.com> <20200426165753.GA11046@wind.enjellic.com> <20200429052329.GD8452@linux.intel.com> <20200429151459.GC15992@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429151459.GC15992@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 08:14:59AM -0700, Sean Christopherson wrote: > On Wed, Apr 29, 2020 at 08:23:29AM +0300, Jarkko Sakkinen wrote: > > On Sun, Apr 26, 2020 at 11:57:53AM -0500, Dr. Greg wrote: > > > On Wed, Apr 22, 2020 at 12:52:56AM +0300, Jarkko Sakkinen wrote: > > > > > > Good day, I hope the weekend is going well for everyone. > > > > > > > Intel(R) SGX is a set of CPU instructions that can be used by applications > > > > to set aside private regions of code and data. The code outside the enclave > > > > is disallowed to access the memory inside the enclave by the CPU access > > > > control. > > > > > > > > ... [ elided ] .. > > > > > > > > The current implementation requires that the firmware sets > > > > IA32_SGXLEPUBKEYHASH* MSRs as writable so that ultimately the kernel can > > > > decide what enclaves it wants run. The implementation does not create > > > > any bottlenecks to support read-only MSRs later on. > > > > > > It seems highly unlikely that a driver implementation with any type of > > > support for read-only launch control registers would ever get into the > > > kernel. All one needs to do is review the conversations that Matthew > > > Garrett's lockdown patches engender to get a sense of that, ie: > > > > > > https://lwn.net/Articles/818277/ > > > > We do not require read-only MSRs. > > Greg is pointing out the opposite, that supporting read-only MSRs is highly > unlikely to ever be supported in the mainline kernel. In a nutshell, what is wrong in the current code changes and what *exactly* should we change? This is way too high level at the moment at least for my limited brain capacity. /Jarkko