Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2194196imu; Thu, 10 Jan 2019 09:48:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN4TyEJ63RXoMwDzPiWS6LdDaPNqNi0PTyYZIubG0AZGz9I9+1WqGHPATXZE2SjQDpJG0Wk/ X-Received: by 2002:a62:c683:: with SMTP id x3mr10910197pfk.10.1547142489736; Thu, 10 Jan 2019 09:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547142489; cv=none; d=google.com; s=arc-20160816; b=n17r6iflHG95a+C0gXfcxJG1EIFpmQhBfT4hOHnfxDr8Y/NlUjkQJYQE14QZ/s9L0N eYRbLnVHDBSt4KhGIpRXzHFMCJOsfVU6GTwKDuqd1l/DqoDhx7ad4BEEeBrRzS+LiYyO dTcewlT9Z82SgO5uOkMUs0ItjyoFN9xO4IPqANL2N9We6SxDCKYh2b5f/ioEzkOjT78i 9Ch+SIykGxqKIslKlK+qNjv2cHkDz8ckzaU5sAvZb3eXsrm2k/b9y7L4DUVzhxvM+uOc U2OlEIPOtRSiMPSk0hGqfS1mfYf6K+jB0keC0N+KJFIu7fDhQKqbyvQk05KVv/nKB1UI Hlfw== 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=42CQZfoD8028CJYoJhxIyvMfQqOY65z0cKCvqp1YYn8=; b=xwlImX9hUA8rV7NmlJgyFmsRQ4U50tI5b77Lt3QzDe+P2Na3nWQ2kh5PCazf7FTs3R cEuS4+BiuSgRTEoY2uXqi4f6SgomU0gvK8nd8ta+5NOA8CAjOMOqYbqdVTE6POnONtcI kytQ4SnfEUsKbqPK+DgoDiUcLnNzGyY36G0a+BP1TbIuh0AQoFURbBasS/EVc6kYXa5h EstymukITNzJgUuNbMAQdvCvL0z39KwS6JgTmTYuSdWkw5hULD0iIqOwleReAQD88Otk 9oflz0kFVb0XQx50+p2RKUaOcgZ0H1IPk0DwcOk/jqUndHSEE/jt8JxpZjKl89cTWtZt o0kw== 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 l185si13311508pgd.253.2019.01.10.09.47.54; Thu, 10 Jan 2019 09:48:09 -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 S1730632AbfAJRqB (ORCPT + 99 others); Thu, 10 Jan 2019 12:46:01 -0500 Received: from mga04.intel.com ([192.55.52.120]:45246 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729890AbfAJRqA (ORCPT ); Thu, 10 Jan 2019 12:46: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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2019 09:46:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,462,1539673200"; d="scan'208";a="137170777" Received: from vanderss-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.254.152]) by fmsmga001.fm.intel.com with ESMTP; 10 Jan 2019 09:45:52 -0800 Date: Thu, 10 Jan 2019 19:45:50 +0200 From: Jarkko Sakkinen To: Andy Lutomirski Cc: Sean Christopherson , "Huang, Kai" , Jethro Beekman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "x86@kernel.org" , Dave Hansen , Peter Zijlstra , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , "linux-sgx@vger.kernel.org" , Josh Triplett , Haitao Huang , "Dr . Greg Wettstein" Subject: Re: x86/sgx: uapi change proposal Message-ID: <20190110174550.GJ6589@linux.intel.com> References: <7706b2aa71312e1f0009958bcab24e1e9d8d1237.camel@linux.intel.com> <598cd050-f0b5-d18c-96a0-915f02525e3e@fortanix.com> <20181219091148.GA5121@linux.intel.com> <613c6814-4e71-38e5-444a-545f0e286df8@fortanix.com> <20181219144515.GA30909@linux.intel.com> <20181221162825.GB26865@linux.intel.com> <105F7BF4D0229846AF094488D65A0989355A45B6@PGSMSX112.gar.corp.intel.com> <20190108220946.GA30462@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 Tue, Jan 08, 2019 at 02:54:11PM -0800, Andy Lutomirski wrote: > I do think it makes sense to have QEMU delegate the various ENCLS > operations (especially EINIT) to the regular SGX interface, which will > mean that VM guests will have exactly the same access controls applied > as regular user programs, which is probably what we want. If so, > there will need to be a way to get INITTOKEN privilege for the purpose > of running non-Linux OSes in the VM, which isn't the end of the world. > We might still want the actual ioctl to do EINIT using an actual > explicit token to be somehow restricted in a way that strongly > discourages its use by anything other than a hypervisor. Or I suppose > we could just straight-up ignore the guest-provided init token. Does it even matter if just leave EINITTOKENKEY attribute unprivileged given that Linux requires that MSRs are writable? Maybe I'll just whitelist that attribute to any enclave? /Jarkko