Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C22EC001B0 for ; Tue, 8 Aug 2023 22:32:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.580535.908787 (Exim 4.92) (envelope-from ) id 1qTVEw-0001KK-D0; Tue, 08 Aug 2023 22:31:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 580535.908787; Tue, 08 Aug 2023 22:31:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTVEw-0001KD-AB; Tue, 08 Aug 2023 22:31:46 +0000 Received: by outflank-mailman (input) for mailman id 580535; Tue, 08 Aug 2023 22:31:45 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTVEv-0001K7-6H for xen-devel@lists.xenproject.org; Tue, 08 Aug 2023 22:31:45 +0000 Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com [136.143.188.50]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 593e7257-363b-11ee-b280-6b7b168915f2; Wed, 09 Aug 2023 00:31:43 +0200 (CEST) Received: from [10.10.1.156] (static-72-81-132-2.bltmmd.fios.verizon.net [72.81.132.2]) by mx.zohomail.com with SMTPS id 1691533898593224.91657336270953; Tue, 8 Aug 2023 15:31:38 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 593e7257-363b-11ee-b280-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; t=1691533899; cv=none; d=zohomail.com; s=zohoarc; b=eGWJ45Z2fb64MaWqGYJLo/rxei9X9M2+d4WskopTEu4DFJ9r113JWJ3THa3o+ZQEhsQchQ/WQ8rDeSfwVQ3zcELzXw+K3KLgB8qd4QAhkool96aIrzRMrmNOQeh4B1ae48f6VHpdGDMOBzrJK9bikLP0qlOxkDXHhLFmYJChoIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691533899; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=4UzpQ0OMpp/sjYWeLMxe4Hy3t+xUFbjxQS08RimHyQ8=; b=ZM/q5OLf+XNDDg5E6AYyxZ7JyxGDEueTCyxP9etDCDE9OKkYiBlAXXO6wbOMGTNF5WKoasBBSR7So2wT7VIz+Q/u8srhTWZ+ptuOtb/rpCuOKpPYtBS1PoIe4k+k4F4KZPopgZxyk2VFlWXJtj2kQmVN+8ipDU4JTjaipO0Dcbo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1691533899; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=4UzpQ0OMpp/sjYWeLMxe4Hy3t+xUFbjxQS08RimHyQ8=; b=VBx/6geEBP9wzVMco7zzVOyWhUA4yyAe2IaYBX8Me86jZ73mRtsnXB/qSwYE5VCo KNsOSx63Vvcqv5OGvbkP8kh2GOzp3qJAJYbf3RVk4hGoo0pJlS+hqmianc1QHZAvZnV WRvK/ZM4Uyw1U5LGIz6CgWbr1K5FgWq1RdQuEEy8= Message-ID: <3decc6de-8d82-a862-36a8-9ddcd94fac4f@apertussolutions.com> Date: Tue, 8 Aug 2023 18:31:36 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: [RFC 4/6] capabilities: introduce console io as a domain capability Content-Language: en-US To: Julien Grall , Stefano Stabellini Cc: Volodymyr Babchuk , xen-devel@lists.xenproject.org, Bertrand Marquis , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu References: <20230801202006.20322-1-dpsmith@apertussolutions.com> <20230801202006.20322-5-dpsmith@apertussolutions.com> <14346689-8276-3c26-91e1-59bc2328518e@apertussolutions.com> <423f86e7-10ee-134e-7683-e15f7e2c64ed@xen.org> From: "Daniel P. Smith" In-Reply-To: <423f86e7-10ee-134e-7683-e15f7e2c64ed@xen.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ZohoMailClient: External On 8/3/23 17:24, Julien Grall wrote: > Hi Daniel, > > On 03/08/2023 16:41, Daniel P. Smith wrote: >> On 8/1/23 21:01, Stefano Stabellini wrote: >>> On Tue, 1 Aug 2023, Daniel P. Smith wrote: >>>> patch the field is renamed to capabilities to encapsulate the >>>> capabilities a >>>> domain has been granted. The first capability being the ability to >>>> read/write >>>> the Xen console. >>>> >>>> Signed-off-by: Daniel P. Smith >>> >>> Patch looks fine to me aside the two minor nits. I am not sure I >>> understand 100% the difference between capabilities and roles but I am >>> OK with the patch. I'd like to hear Julien's feedback on this as well. >> >> This might be worth a section in the hypervisor-guide. As mentioned in >> the cover letter, this was originally proposed as being under XSM. A >> challenge I ran into is that, depending on your view, the >> `is_privileged` field and `hardware_domain` global were either abused >> as a function check and a non-resource privilege check or are just >> multifaceted variables. This is why the concept of the role was struck >> upon, it is more intuitive (for me at least) that have a role is >> something that imparts accesses (privilege checks) and dictates >> hypervisor behaviors when handling the domain (function checks). This >> then brings us to an access or behavior that may be inherent to some >> role(s) but may want to grant on an individually to a guest. A prime >> example of this is console_io, for which it is inherent that the >> hardware domain role will have access but may want to grant to a guest >> without granting it an entire role. This is why I provided for >> identifying these capabilities so that they may be assigned >> individually to a domain. > > Thanks for the explanation. Just to confirm my understanding, what you > are suggesting is that for a given role, a domain will at least have the > matching capabilities (more could be granted). Is that correct? > > If so, this wouldn't this mean we can remove d->role and simply use > d->capabilities? We could start out with CAP_CTRL and CAP_HW, but it is a little illogical. For instance, control domain has many capabilities, they just have never been fully broken out. XSM did some, but the focus there was just on system resources. Similar with the hardware domain. You are right that it would better deal with the limited number of bits currently available. >> >> While the role/capability is a natural progression from how the >> hypervisor currently operates. Another approach that could be consider >> to deliver a similar experience would be to break down every access >> and function into a capability and then define the standard roles as a >> conglomeration of certain capabilities. > > At least from the explanation above, I think it would make sense to > break down role to multiple capabilities. Would it be acceptable to do this incrementally over time as we are able to determine what needs to be broken out as a distinct capability?