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 CC5DDCED619 for ; Wed, 9 Oct 2024 07:31:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.813781.1226803 (Exim 4.92) (envelope-from ) id 1syR9w-0004rq-7E; Wed, 09 Oct 2024 07:31:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 813781.1226803; Wed, 09 Oct 2024 07:31:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1syR9w-0004rj-4Z; Wed, 09 Oct 2024 07:31:00 +0000 Received: by outflank-mailman (input) for mailman id 813781; Wed, 09 Oct 2024 07:30:58 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1syR9u-0004rd-Ue for xen-devel@lists.xenproject.org; Wed, 09 Oct 2024 07:30:58 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1syR9s-0002iD-EL; Wed, 09 Oct 2024 07:30:56 +0000 Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1syR9s-0007Ql-8a; Wed, 09 Oct 2024 07:30:56 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=KCds8fb9VBnrfQfPYtElZuRg0mBMNkzJF4od8SkPqx8=; b=d3H8jKbFiXKb50ZceKus4YRz6L YTuAKVadsINoDFjMRVKMbgS4jkj9Z0UlUpVMfOJKNPb4jvGnzAT1mKYCnkbTFJlXok7x7Omg0Z9AR lQBO0UgUULTcRmrJdBEFs87XRDNr/DVOq5dtshmCkwXSRPPxtI9+7qXH19yTzQyMxqJA=; Message-ID: <10b3e5ae-1845-4bca-ad13-da0da2ec66bc@xen.org> Date: Wed, 9 Oct 2024 08:30:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] docs: fusa: Add requirements for Device Passthrough Content-Language: en-GB To: Bertrand Marquis , Stefano Stabellini Cc: Oleksandr Tyshchenko , Xen-devel , Oleksandr Tyshchenko , Michal Orzel , Ayan Kumar Halder , Artem Mygaiev , Hisao Munakata References: <20241007185508.3044115-1-olekstysh@gmail.com> <6E89CC97-C7E3-40DF-8BFA-5F3065429F54@arm.com> <85FF2EB0-474D-4807-8DB3-FC502A5B2DE8@arm.com> From: Julien Grall In-Reply-To: <85FF2EB0-474D-4807-8DB3-FC502A5B2DE8@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Bertrand, On 09/10/2024 07:30, Bertrand Marquis wrote: > Hi Stefano, > >> On 9 Oct 2024, at 00:46, Stefano Stabellini wrote: >> >> On Tue, 8 Oct 2024, Oleksandr Tyshchenko wrote: >>>>> On 7 Oct 2024, at 20:55, Oleksandr Tyshchenko wrote: >>>>> + >>>>> +Rationale: >>>>> + >>>>> +Comments: >>>>> + >>>>> +Covers: >>>>> + - `XenProd~device_passthrough~1` >>>>> + >>>>> +Assign PCI device to domain (with IOMMU) >>>>> +---------------------------------------- >>>>> + >>>>> +`XenSwdgn~passthrough_assign_pci_device_with_iommu~1` >>>>> + >>>>> +Description: >>>>> +Xen shall assign a specified PCI device (always implied as DMA-capable) >>>>> to >>>>> +a domain during its creation using passthrough (partial) device tree on >>>>> Arm64 >>>>> +and Hyperlaunch device tree on AMD-x86. The physical device to be >>>>> assigned is >>>>> +protected by the IOMMU. >>>> >>>> This is a very long and complex requirement. >>>> I would suggest to split it in 3: >>>> - generic: Xen shall support assign PCI devices to domains. >>>> - arm64 one: Xen shall assign PCI devices based on device tree (explain how >>>> this is configured in dts) >>>> - amd: xxxx based on hyperlaunch >>> >>> I agree, will split, but ... >>> >>>> - Xen shall use the IOMMU to enforce DMA operations done by a PCI device >>>> assigned to a domain to be restricted to the memory of the given domain. >>> >>> >>> ... does this need to be a separate 4th requirement here (and for the similar >>> requirement for the platform device down the document) or this sentence is >>> meant to be added to all resulting generic/arm64/amd requirements? >> >> This is not specific to PCI, though? The generic requirement is "Xen >> shall use the IOMMU to enforce DMA operations done by a DMA-capable >> device assigned to a domain to be restricted to the memory of the given >> domain". >> >> I think it is also OK to both have a PCI-specific and a >> non-PCI-specific requirement for that, I just wanted to mention that it >> doesn't look like something to PCI-specific. > > I think we should completely abstract out the DMA engine problem as it > is not specific to a PCI or not device but to any DMA capable stuff. +1 > > Maybe the same also goes for interrupts and how those are assigned or > forwarded or not to a domain (attached or not to a device). I am not sure we can abstract this one because: * For platform devices, we should be able to support SPIs and MSI(-x) (only the former is so far). * For PCI devices, at least on Arm, AFAIR, we only intend to support MSI(-x). Cheers, -- Julien Grall