Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1738567pxb; Sat, 15 Jan 2022 22:47:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwh7hJMt0cvqRgUVJHVjJkgIXXxhwkRfjNBkBnsgCzek5KBNxXNwvpaEA86wmv/1Aouayod X-Received: by 2002:a17:907:3fa0:: with SMTP id hr32mr13295715ejc.196.1642315677960; Sat, 15 Jan 2022 22:47:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642315677; cv=none; d=google.com; s=arc-20160816; b=QjKhOcPLUznueln8kQgowqIK+oXxrsmTkQch/qABqxr3vEJluUEyEhJLkLZ4OE3QwC w1RO4PTjD8d8Uy5UgtVLuaXYi7NJSt1Bv2xc9nZcnwGxJT9w5qc4E1vbFdeKZzxJDrRh c6CxvAg1cMGat2e1hpKlw99Ne1tcAfItnwaGJTF+Nu1tlfES9e8xjkUsKOK5PR23ympg rgUbmtvKvG3A6o44eKuAC9tANvZYF5W1l1XDBk8X4V3IOuSygs+xQW4U3KPSPxIribVg scEzA0vZiRdmfeumBZRpG5oW9jpm+YB/VYkd/6clRZZqF9VfjVq5ksSJJ+Q88hRq0G0e NIOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3Pg8JhxhY7888hrfv3xIgx83YAxe/eVJnftE4PFe4Ik=; b=ZdNzGmzZ1IdPwlpQafWIEjWxCTJ2kRJ60JaUD5JFant1dA5ZHJFChw3QjSWgjfT/in S0yTU+U+J5TzWzi0bk03j4iXpK19g/iO7vRcpwytj17kKXCaCJK4jpVOrdvxD+osfU6G vJ0orlKZgN340GMihJxXujCmSlgSLGHDhF+UEIU7G7EXkohCJf7l7LlrqKePuOUVQXZo qJPnHAll6/Ae+xS/AizHHC8BST2uzfB7Pr3TfDY8Wu0ePQ0yPsauxorCXbbFr+Njx8zl 3t38YkB0vfC9sYNNKkPNCqlcSRPxFXLIIzFoBemjji+Y+30oCpw5bgR9d2dPXXMC0LdK 7bxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fT2BoyLg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f15si7410034edd.272.2022.01.15.22.47.34; Sat, 15 Jan 2022 22:47:57 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fT2BoyLg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233215AbiAOQtx (ORCPT + 99 others); Sat, 15 Jan 2022 11:49:53 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:49550 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232284AbiAOQtv (ORCPT ); Sat, 15 Jan 2022 11:49:51 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A835DB801B8; Sat, 15 Jan 2022 16:49:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D97BEC36AE3; Sat, 15 Jan 2022 16:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642265389; bh=CLLfm9z4AHVfy39p3/9aWoBxWNIR8mlJbzJzJMB4pGA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fT2BoyLg2sMw1ZkvgyyXgU/zckpUzC9vWesoXeQxZxHb4P+njNTe2XErZfUHI5Olh YE8ISfpYQ/6+KR7+Z9PSTAiztDm3WNAndhUWHICkAqTaKq3yPGy3BxFLoNtFWVs/bW FCLE1wS7F5CW6eRhzg7RYMebwA6hEeBpcGACogLQGSezs49RY9XO0K9dl/3UPp/DF8 mL0lb0L9mZ1btelK1h2wSRcrNe5fxIT2T7xtkqepaJdjfnk2JYoL1+3NmLlwqRAiMj 6cvLs19sakmx/SARIAulVloqt8P3RUnDL2UXdTM7OEt+ZlGJhrS60s+u236Ut+Onq0 U6s2wNz4sry7A== Date: Sat, 15 Jan 2022 18:49:36 +0200 From: Jarkko Sakkinen To: Reinette Chatre Cc: Nathaniel McCallum , Haitao Huang , Andy Lutomirski , dave.hansen@linux.intel.com, tglx@linutronix.de, bp@alien8.de, mingo@redhat.com, linux-sgx@vger.kernel.org, x86@kernel.org, seanjc@google.com, kai.huang@intel.com, cathy.zhang@intel.com, cedric.xing@intel.com, haitao.huang@intel.com, mark.shanahan@intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/25] x86/sgx: Introduce runtime protection bits Message-ID: References: <4195402f-cbf9-bc75-719d-22cea8e36e60@intel.com> <168fb2c9-de3f-384a-bb17-ab84db2cf533@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 15, 2022 at 01:15:53AM +0200, Jarkko Sakkinen wrote: > > After running ENCLU[EMODPE] user space uses SGX_IOC_ENCLAVE_MOD_PROTECTIONS > > OK, great. > > A minor nit: please call it SGX_IOC_ENCLAVE_MODIFY_PROTECTIONS. I'm not confident after looking through the test case and ioctl about EMODPE support but I do not want disturb this anymore. Bunch of things have been nailed and I'm now running the code, which is great. The obviously wrong implementation choice in this ioctl is that it is multi-function. It should be just split it into two ioctls: sgx_restrict_page_permissions and sgx_extend_page_permissions. They are conceptually different flows and I'm also basing this on earlier discussion in this mailing list from which I conclude that it is also consensus to not have such ioctls. Might sound clanky but it is much easier to comprehend what is going on "in the blackbox" by doing that split. /Jarkko