Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3003959pxm; Mon, 28 Feb 2022 10:06:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5C0oMF6B4+QHPMqPSygdxop4hYdBQ4jurLWiwjDPImLGs0K/adtWCbKk8hdCfDceC7XL6 X-Received: by 2002:a17:907:2be6:b0:6ce:70da:12c2 with SMTP id gv38-20020a1709072be600b006ce70da12c2mr16591718ejc.649.1646071596012; Mon, 28 Feb 2022 10:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646071596; cv=none; d=google.com; s=arc-20160816; b=b1E1mCTodlLze9lQPsvNErkYm1n+ImQ+fOY68JUb264snqBR3UHJ+Gzhxaec1xhce9 6+blVgTvT20OYKk6S4UbYVx3q5dDE07z6zXKxgqQqdX+HEm6paMvmbel+wcc+YoQT5Ta PejwzWjxhxRjFu+FbOgqE8g39OCFyJMN6jAB/8g1SiTCHzeY+BFRZ0xPGDcz/gBeQtNI qVAGzrKP/p/cr9BM7swQdJvFCozhX/yTnRYfflexfP1cHcq6Rtb5b5xO9D1+Us6dAEYF 36S7drdd/5HbXA4CEvJSVqck4l7YZFuqDZZo2IFvboeoMkSaDs2ULqceVG/NFj84YJ7+ XfXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=FFE53S5lo4fRFNacRc+0qu3ziNy0SpDeVOG0oDiqmnA=; b=Autts5v03t7HWVTJCJ5cKBkt39i2XfbzB55PHzs9pBgrvzk5E41XKoPuO9lKUrniKo YrGpXvYvEsm/ZkoqPPMNs6nXtMokEiBiQHYf/maLgcBB9muVbaz+o2Ddv4nRXfw4Z1iI dMPDMueaYEr0ta68Dcxd8V+Ytu0jPfWekQi9Q5uhRciJvtibkwPe1ELiWVNi9h1O99Lx 2+EfASvPR8vIK1+bO7qW8GvyA4KoatwjlG+6Q57v77xTmfYK5lc2PttIGMtQ2Os+LNui c1SuCl4Id0U4cS438VrbN4XNRkE//z9dTm2SY4CougOo7E//ru6fTn6dngrKBm32JoQO xfOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dZt5eLPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a50fc90000000b00413a9ac89c9si3219102edq.31.2022.02.28.10.06.13; Mon, 28 Feb 2022 10:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dZt5eLPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237528AbiB1PRN (ORCPT + 99 others); Mon, 28 Feb 2022 10:17:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237544AbiB1PRJ (ORCPT ); Mon, 28 Feb 2022 10:17:09 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EAB683000; Mon, 28 Feb 2022 07:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646061390; x=1677597390; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=GFDKt/IDNLdqLTuvDR6yJcVQxe8prvsZyzafk0irqZQ=; b=dZt5eLPlw3/rVdLr0/J8lsOrDWfpq0pa3v7loKEUbA+zmQIBU9tSmasN cEPgzjUNMugxHN/ucZYKc9r9F2VHfmsEYHCzP/JmpeoUkZEukEJDuXGr6 HztKmgEg6rAZoUePgH6Er969RH/lUr0q+v9AD1/L+mRwopSRyNQ4/SF3M KnOw+gpCfe+5T5gTbRcSDXnIfBb9oPeRKaFtfxbb1ikbSSkbX6asrAjLE PzR1yRYiqnPsUWTbonVrysuvzql5XdgO5urnMG/HwOy8GaHWflNw3vaCQ aogwzXcEFOdsGk72YKTlegqxI2LCeywn8BFOiDmxIy9jrl6iW2m6JcC7S Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10271"; a="277563357" X-IronPort-AV: E=Sophos;i="5.90,142,1643702400"; d="scan'208";a="277563357" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 07:16:28 -0800 X-IronPort-AV: E=Sophos;i="5.90,142,1643702400"; d="scan'208";a="550276016" Received: from eliasbro-mobl.amr.corp.intel.com (HELO [10.212.174.65]) ([10.212.174.65]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 07:16:27 -0800 Message-ID: Date: Mon, 28 Feb 2022 07:16:22 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Jarkko Sakkinen , "Dhanraj, Vijay" Cc: "Chatre, Reinette" , "dave.hansen@linux.intel.com" , "tglx@linutronix.de" , "bp@alien8.de" , "Lutomirski, Andy" , "mingo@redhat.com" , "linux-sgx@vger.kernel.org" , "x86@kernel.org" , "Christopherson,, Sean" , "Huang, Kai" , "Zhang, Cathy" , "Xing, Cedric" , "Huang, Haitao" , "Shanahan, Mark" , "hpa@zytor.com" , "linux-kernel@vger.kernel.org" References: <4ce06608b5351f65f4e6bc6fc87c88a71215a2e7.1644274683.git.reinette.chatre@intel.com> From: Dave Hansen Subject: Re: [PATCH V2 16/32] x86/sgx: Support restricting of enclave page permissions In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/28/22 04:24, Jarkko Sakkinen wrote: >> Regarding the recent update of splitting the page permissions change >> request into two IOCTLS (RELAX and RESTRICT), can we combine them into >> one? That is, revert to how it was done in the v1 version? > They are logically separate complex functionalities: > > 1. "restrict" calls EMODPR and requires EACCEPT > 2. "relax" increases permissions up to vetted ("EADD") and could be > combined with EMODPE called inside enclave. It would be great to have a _slightly_ better justification than that. Existing permission interfaces like chmod or mprotect() don't have this asymmetry. I think you're saying that the underlying hardware implementation is asymmetric, so the interface should be too. I don't find that argument very convincing. If the hardware interface is arcane and we can make it look more sane in the ioctl() layer, we should that, asymmetry or not. If we can't make it any more sane, let's say why the ioctl() must or should be asymmetric. The SGX2 page permission mechanism is horribly counter intuitive. *Everybody* that looks at it thinks that it's wrong. That means that we have a lot of work ahead of us to explain the interfaces that get layered on top.