From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93FC1C433F5 for ; Wed, 1 Jun 2022 13:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353269AbiFANcQ (ORCPT ); Wed, 1 Jun 2022 09:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242653AbiFANcJ (ORCPT ); Wed, 1 Jun 2022 09:32:09 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680502018E; Wed, 1 Jun 2022 06:32:07 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id s6so2735825lfo.13; Wed, 01 Jun 2022 06:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=6AmNd1uoVJElSSIZ5NcicKz1NijvWaHzL3bjyTaCTH4=; b=ldSt7vIuRD+IuLgBfjyNqBye32eNJ62ST9orWrrQ7xCyXt5nToDaIro4j7IujIzZIw zgZ8vXfHbYGORoIsxAJLQvjkcc6sykEM9L1EyLORHH6oaIcpSY1IUyFUk03VKLCwnPN6 +6LwGg/O5yk6KhmJNaozXZv2nmZ9jjdhr218OF8Xzfva6FguxwE3Hdd8DrotuQXxODYV ocw8FcfH9d/LPrBKVlTYvsTkJqyYatVMDZ+6eGYRZc3e5wOgbRaPB/gd6lX7imnGwALe 3Zrzu6o06WNYbgVRgdyOI4ykt7Tb46alUg5IEUKgeCqhd4Re1nl50dMdjR8kh7X+CtQR trgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6AmNd1uoVJElSSIZ5NcicKz1NijvWaHzL3bjyTaCTH4=; b=khSzIF+p2RkSJH3faaZyLi0Ehzh02gQ85m10JzB6ZG29DC0OYsMXTkWUbLasd3+duB GY4WZRYohyEJ6C9twjXE5nS1U9uwjhpzcDCS32fPeclW8aiWz5MURB3jwas8SphbJ0ma fvEncNN6W6a+DUHpuBp8dnqlJ5+YCIY5iCafJjjO8WF7i4QUDuABMuhkGZnJhmKYND9v devyBzJEvCUBUpeRBvQAg87RR9nn9o/s4O6iVr/BlNwiWRb52KD5agscpbPDpWgQ6TX9 y4tHUg7pTfDOxt92RrVYi6n6QU60Nyd98jNtFqq05er5xfg+fT6q/ZAKVkrikhaw/yaV hGVw== X-Gm-Message-State: AOAM5307QuNk5hi3JHU3m9/AKdNyWjSveQ+jxbCWlSutLBEp6LBZEZn+ wl4++Se8gIuRjqZW4KOzW1k= X-Google-Smtp-Source: ABdhPJxB3fNJrJkKRrllMC2ycuvNXzvXlHnLWls/OtCzWnm+TxujSRcM7FqomSJRwMxSqo/CEZZNhg== X-Received: by 2002:a05:6512:1041:b0:478:afc6:5846 with SMTP id c1-20020a056512104100b00478afc65846mr24643051lfb.132.1654090325618; Wed, 01 Jun 2022 06:32:05 -0700 (PDT) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id d20-20020a05651233d400b0047255d2115csm366642lfg.139.2022.06.01.06.32.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jun 2022 06:32:05 -0700 (PDT) Subject: Re: [PATCH V3 5/8] dt-bindings: Add xen,grant-dma IOMMU description for xen-grant DMA ops To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, Oleksandr Tyshchenko , Rob Herring , Joerg Roedel , Will Deacon , Krzysztof Kozlowski , Julien Grall , Juergen Gross , "Michael S. Tsirkin" , Christoph Hellwig , Arnd Bergmann References: <1653944417-17168-1-git-send-email-olekstysh@gmail.com> <1653944417-17168-6-git-send-email-olekstysh@gmail.com> From: Oleksandr Message-ID: <31c21ef0-3847-a896-a387-c2e1cc0f9467@gmail.com> Date: Wed, 1 Jun 2022 16:32:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.06.22 03:34, Stefano Stabellini wrote: Hello Stefano > On Tue, 31 May 2022, Oleksandr Tyshchenko wrote: >> From: Oleksandr Tyshchenko >> >> The main purpose of this binding is to communicate Xen specific >> information using generic IOMMU device tree bindings (which is >> a good fit here) rather than introducing a custom property. >> >> Introduce Xen specific IOMMU for the virtualized device (e.g. virtio) >> to be used by Xen grant DMA-mapping layer in the subsequent commit. >> >> The reference to Xen specific IOMMU node using "iommus" property >> indicates that Xen grant mappings need to be enabled for the device, >> and it specifies the ID of the domain where the corresponding backend >> resides. The domid (domain ID) is used as an argument to the Xen grant >> mapping APIs. >> >> This is needed for the option to restrict memory access using Xen grant >> mappings to work which primary goal is to enable using virtio devices >> in Xen guests. >> >> Signed-off-by: Oleksandr Tyshchenko >> --- >> Changes RFC -> V1: >> - update commit subject/description and text in description >> - move to devicetree/bindings/arm/ >> >> Changes V1 -> V2: >> - update text in description >> - change the maintainer of the binding >> - fix validation issue >> - reference xen,dev-domid.yaml schema from virtio/mmio.yaml >> >> Change V2 -> V3: >> - Stefano already gave his Reviewed-by, I dropped it due to the changes (significant) >> - use generic IOMMU device tree bindings instead of custom property >> "xen,dev-domid" >> - change commit subject and description, was >> "dt-bindings: Add xen,dev-domid property description for xen-grant DMA ops" >> --- >> .../devicetree/bindings/iommu/xen,grant-dma.yaml | 49 ++++++++++++++++++++++ >> 1 file changed, 49 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> >> diff --git a/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> new file mode 100644 >> index 00000000..ab5765c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> @@ -0,0 +1,49 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/iommu/xen,grant-dma.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Xen specific IOMMU for virtualized devices (e.g. virtio) >> + >> +maintainers: >> + - Stefano Stabellini >> + >> +description: >> + The reference to Xen specific IOMMU node using "iommus" property indicates >> + that Xen grant mappings need to be enabled for the device, and it specifies >> + the ID of the domain where the corresponding backend resides. >> + The binding is required to restrict memory access using Xen grant mappings. > I think this is OK and in line with the discussion we had on the list. I > propose the following wording instead: > > """ > The Xen IOMMU represents the Xen grant table interface. Grant mappings > are to be used with devices connected to the Xen IOMMU using the > "iommus" property, which also specifies the ID of the backend domain. > The binding is required to restrict memory access using Xen grant > mappings. > """ > > >> +properties: >> + compatible: >> + const: xen,grant-dma >> + >> + '#iommu-cells': >> + const: 1 >> + description: >> + Xen specific IOMMU is multiple-master IOMMU device. >> + The single cell describes the domid (domain ID) of the domain where >> + the backend is running. > Here I would say: > > """ > The single cell is the domid (domain ID) of the domain where the backend > is running. > """ > > With the two wording improvements: I am happy with proposed wording improvements, will update. > > Reviewed-by: Stefano Stabellini Thanks! > > >> +required: >> + - compatible >> + - "#iommu-cells" >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + xen_iommu { >> + compatible = "xen,grant-dma"; >> + #iommu-cells = <1>; >> + }; >> + >> + virtio@3000 { >> + compatible = "virtio,mmio"; >> + reg = <0x3000 0x100>; >> + interrupts = <41>; >> + >> + /* The backend is located in Xen domain with ID 1 */ >> + iommus = <&xen_iommu 1>; >> + }; >> -- >> 2.7.4 >> >> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> -- Regards, Oleksandr Tyshchenko From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 300A8C433EF for ; Wed, 1 Jun 2022 13:32:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B8C09409ED; Wed, 1 Jun 2022 13:32:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kdrnCXRG0Kne; Wed, 1 Jun 2022 13:32:10 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1483C4109F; Wed, 1 Jun 2022 13:32:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DA9F8C0039; Wed, 1 Jun 2022 13:32:09 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5F671C002D for ; Wed, 1 Jun 2022 13:32:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3940D404F4 for ; Wed, 1 Jun 2022 13:32:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AsbQw8TivV-O for ; Wed, 1 Jun 2022 13:32:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by smtp2.osuosl.org (Postfix) with ESMTPS id CC03A4013B for ; Wed, 1 Jun 2022 13:32:07 +0000 (UTC) Received: by mail-lf1-x135.google.com with SMTP id l13so2740988lfp.11 for ; Wed, 01 Jun 2022 06:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=6AmNd1uoVJElSSIZ5NcicKz1NijvWaHzL3bjyTaCTH4=; b=ldSt7vIuRD+IuLgBfjyNqBye32eNJ62ST9orWrrQ7xCyXt5nToDaIro4j7IujIzZIw zgZ8vXfHbYGORoIsxAJLQvjkcc6sykEM9L1EyLORHH6oaIcpSY1IUyFUk03VKLCwnPN6 +6LwGg/O5yk6KhmJNaozXZv2nmZ9jjdhr218OF8Xzfva6FguxwE3Hdd8DrotuQXxODYV ocw8FcfH9d/LPrBKVlTYvsTkJqyYatVMDZ+6eGYRZc3e5wOgbRaPB/gd6lX7imnGwALe 3Zrzu6o06WNYbgVRgdyOI4ykt7Tb46alUg5IEUKgeCqhd4Re1nl50dMdjR8kh7X+CtQR trgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6AmNd1uoVJElSSIZ5NcicKz1NijvWaHzL3bjyTaCTH4=; b=DuyP9zCZQZ7gcu/LsXZ66HtWKcfzioHpZiypOCPLJlBI+4EL103VAc3fTLSwtR5cYZ wOxJXcQ2ZKE29AuoMl1GkHwwXC6FM7klqqJJMQUqEe4jWAulpL1jdRhKKp8nTTlpVgj+ fE2oM+HsDU7UpRDzkAbuGA0TzA/obXjWOLDKcYbatSJzvEkaJ3LkBI2uiHv2m5nYXP2N yJJ/HFsgx4Apr0HxXBmOAKMhguA93znEYb71ujiy2oFAYiQsADXWUqptm8RHqFUBOHej rDiB360lEdLfR3ZrI+Zx0XWDX9q2KIc6zKuviv1+2HPMmkD8LdGWE2+Xz3fN8z5KvNXL qEQQ== X-Gm-Message-State: AOAM5325ZOPKv9ozpGvc2LPEeeeIMMUm2p2VX2BrjbFj7pPWRrxiksKK 0mBuotBQdii2vEG7yOI448Y= X-Google-Smtp-Source: ABdhPJxB3fNJrJkKRrllMC2ycuvNXzvXlHnLWls/OtCzWnm+TxujSRcM7FqomSJRwMxSqo/CEZZNhg== X-Received: by 2002:a05:6512:1041:b0:478:afc6:5846 with SMTP id c1-20020a056512104100b00478afc65846mr24643051lfb.132.1654090325618; Wed, 01 Jun 2022 06:32:05 -0700 (PDT) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id d20-20020a05651233d400b0047255d2115csm366642lfg.139.2022.06.01.06.32.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jun 2022 06:32:05 -0700 (PDT) Subject: Re: [PATCH V3 5/8] dt-bindings: Add xen,grant-dma IOMMU description for xen-grant DMA ops To: Stefano Stabellini References: <1653944417-17168-1-git-send-email-olekstysh@gmail.com> <1653944417-17168-6-git-send-email-olekstysh@gmail.com> From: Oleksandr Message-ID: <31c21ef0-3847-a896-a387-c2e1cc0f9467@gmail.com> Date: Wed, 1 Jun 2022 16:32:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Cc: Juergen Gross , devicetree@vger.kernel.org, Julien Grall , Arnd Bergmann , "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Christoph Hellwig , Oleksandr Tyshchenko , iommu@lists.linux-foundation.org, Rob Herring , Krzysztof Kozlowski , xen-devel@lists.xenproject.org, Will Deacon , linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 01.06.22 03:34, Stefano Stabellini wrote: Hello Stefano > On Tue, 31 May 2022, Oleksandr Tyshchenko wrote: >> From: Oleksandr Tyshchenko >> >> The main purpose of this binding is to communicate Xen specific >> information using generic IOMMU device tree bindings (which is >> a good fit here) rather than introducing a custom property. >> >> Introduce Xen specific IOMMU for the virtualized device (e.g. virtio) >> to be used by Xen grant DMA-mapping layer in the subsequent commit. >> >> The reference to Xen specific IOMMU node using "iommus" property >> indicates that Xen grant mappings need to be enabled for the device, >> and it specifies the ID of the domain where the corresponding backend >> resides. The domid (domain ID) is used as an argument to the Xen grant >> mapping APIs. >> >> This is needed for the option to restrict memory access using Xen grant >> mappings to work which primary goal is to enable using virtio devices >> in Xen guests. >> >> Signed-off-by: Oleksandr Tyshchenko >> --- >> Changes RFC -> V1: >> - update commit subject/description and text in description >> - move to devicetree/bindings/arm/ >> >> Changes V1 -> V2: >> - update text in description >> - change the maintainer of the binding >> - fix validation issue >> - reference xen,dev-domid.yaml schema from virtio/mmio.yaml >> >> Change V2 -> V3: >> - Stefano already gave his Reviewed-by, I dropped it due to the changes (significant) >> - use generic IOMMU device tree bindings instead of custom property >> "xen,dev-domid" >> - change commit subject and description, was >> "dt-bindings: Add xen,dev-domid property description for xen-grant DMA ops" >> --- >> .../devicetree/bindings/iommu/xen,grant-dma.yaml | 49 ++++++++++++++++++++++ >> 1 file changed, 49 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> >> diff --git a/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> new file mode 100644 >> index 00000000..ab5765c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> @@ -0,0 +1,49 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/iommu/xen,grant-dma.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Xen specific IOMMU for virtualized devices (e.g. virtio) >> + >> +maintainers: >> + - Stefano Stabellini >> + >> +description: >> + The reference to Xen specific IOMMU node using "iommus" property indicates >> + that Xen grant mappings need to be enabled for the device, and it specifies >> + the ID of the domain where the corresponding backend resides. >> + The binding is required to restrict memory access using Xen grant mappings. > I think this is OK and in line with the discussion we had on the list. I > propose the following wording instead: > > """ > The Xen IOMMU represents the Xen grant table interface. Grant mappings > are to be used with devices connected to the Xen IOMMU using the > "iommus" property, which also specifies the ID of the backend domain. > The binding is required to restrict memory access using Xen grant > mappings. > """ > > >> +properties: >> + compatible: >> + const: xen,grant-dma >> + >> + '#iommu-cells': >> + const: 1 >> + description: >> + Xen specific IOMMU is multiple-master IOMMU device. >> + The single cell describes the domid (domain ID) of the domain where >> + the backend is running. > Here I would say: > > """ > The single cell is the domid (domain ID) of the domain where the backend > is running. > """ > > With the two wording improvements: I am happy with proposed wording improvements, will update. > > Reviewed-by: Stefano Stabellini Thanks! > > >> +required: >> + - compatible >> + - "#iommu-cells" >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + xen_iommu { >> + compatible = "xen,grant-dma"; >> + #iommu-cells = <1>; >> + }; >> + >> + virtio@3000 { >> + compatible = "virtio,mmio"; >> + reg = <0x3000 0x100>; >> + interrupts = <41>; >> + >> + /* The backend is located in Xen domain with ID 1 */ >> + iommus = <&xen_iommu 1>; >> + }; >> -- >> 2.7.4 >> >> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> -- Regards, Oleksandr Tyshchenko _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2A8F3C433F5 for ; Wed, 1 Jun 2022 13:33:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=plOpQZmQZBj+kctL4KptZifRy7kEJFV56CEpUfbHtcE=; b=DPkYVEiCtbpHmP8nA9xc1gOPDZ +opJJVS+xQm7YZ5sr51GuSSUHHnm+HpPyNU/+7YKGj+tHLx3lPJJz+OYC9lwfB5Ul8qbf2ndLeP0N +vMrZdtX46zLq1ckF+wWhvo7vRLpo/dKJE9jvgEjs0DAsfzGXVkBgZEAX27Wh6lK9aw+EBo4a2aPA p+9DKp319FdCYOgs9Iz22I67Mn0z2Yr19XbfqYww1+vNiFpO0LzdbbTAcja4F6aZDcRBt4NfMyRQn kYIPeIxoVgT43ieopWBCoZ9kpwS592C/JTD9+nWmUBe+YKMmJ5kF9OlCscWR2eCzdjd63zHZO4IWo CackOQ7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwOSS-00GILl-ER; Wed, 01 Jun 2022 13:32:20 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwOSO-00GIHd-ER for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 13:32:18 +0000 Received: by mail-lf1-x133.google.com with SMTP id h23so2772195lfe.4 for ; Wed, 01 Jun 2022 06:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=6AmNd1uoVJElSSIZ5NcicKz1NijvWaHzL3bjyTaCTH4=; b=ldSt7vIuRD+IuLgBfjyNqBye32eNJ62ST9orWrrQ7xCyXt5nToDaIro4j7IujIzZIw zgZ8vXfHbYGORoIsxAJLQvjkcc6sykEM9L1EyLORHH6oaIcpSY1IUyFUk03VKLCwnPN6 +6LwGg/O5yk6KhmJNaozXZv2nmZ9jjdhr218OF8Xzfva6FguxwE3Hdd8DrotuQXxODYV ocw8FcfH9d/LPrBKVlTYvsTkJqyYatVMDZ+6eGYRZc3e5wOgbRaPB/gd6lX7imnGwALe 3Zrzu6o06WNYbgVRgdyOI4ykt7Tb46alUg5IEUKgeCqhd4Re1nl50dMdjR8kh7X+CtQR trgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6AmNd1uoVJElSSIZ5NcicKz1NijvWaHzL3bjyTaCTH4=; b=KV7i+8h4AvkGnp9KZO3Tm8TRMLpD+Gq6PBvtiF8pFNEVVKkQL9ZXcEDM6l9+AE1eB3 YEeOY3+uQl4KEfFOEtMHqVBpjkA6PyHUPs/Ge1LOR1TcNzlTk+ufADZEzcHx+WWZ0v+6 rQYQVM7vF8Ia8vsxwxAb0J/fIod0OOP0X7d3/DQUEFJFKp24DDzr56XSe/jnP03pIBJS wYCvg+h2raqHZbAdBCt6e35inKiBmK83MayeBSzvRF3B1WD2MTPCl/xWCkOiOd0hfhhi 9r2RV3lo8kHKNhgl8ScEJQRdwq4inQJLSsLvpRCLHVzadpqtxyfLKRsLSQAhOS3nwSv8 w51A== X-Gm-Message-State: AOAM532Lvnihm4AFbf8GW4IaMEY/vzlpuIBcKl74b3sacuah9eiYBsdO +/kBJ4J5P93ZYsSgUriJQFqfH1NTShk= X-Google-Smtp-Source: ABdhPJxB3fNJrJkKRrllMC2ycuvNXzvXlHnLWls/OtCzWnm+TxujSRcM7FqomSJRwMxSqo/CEZZNhg== X-Received: by 2002:a05:6512:1041:b0:478:afc6:5846 with SMTP id c1-20020a056512104100b00478afc65846mr24643051lfb.132.1654090325618; Wed, 01 Jun 2022 06:32:05 -0700 (PDT) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id d20-20020a05651233d400b0047255d2115csm366642lfg.139.2022.06.01.06.32.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jun 2022 06:32:05 -0700 (PDT) Subject: Re: [PATCH V3 5/8] dt-bindings: Add xen,grant-dma IOMMU description for xen-grant DMA ops To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, Oleksandr Tyshchenko , Rob Herring , Joerg Roedel , Will Deacon , Krzysztof Kozlowski , Julien Grall , Juergen Gross , "Michael S. Tsirkin" , Christoph Hellwig , Arnd Bergmann References: <1653944417-17168-1-git-send-email-olekstysh@gmail.com> <1653944417-17168-6-git-send-email-olekstysh@gmail.com> From: Oleksandr Message-ID: <31c21ef0-3847-a896-a387-c2e1cc0f9467@gmail.com> Date: Wed, 1 Jun 2022 16:32:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_063216_576434_3D3C2492 X-CRM114-Status: GOOD ( 35.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 01.06.22 03:34, Stefano Stabellini wrote: Hello Stefano > On Tue, 31 May 2022, Oleksandr Tyshchenko wrote: >> From: Oleksandr Tyshchenko >> >> The main purpose of this binding is to communicate Xen specific >> information using generic IOMMU device tree bindings (which is >> a good fit here) rather than introducing a custom property. >> >> Introduce Xen specific IOMMU for the virtualized device (e.g. virtio) >> to be used by Xen grant DMA-mapping layer in the subsequent commit. >> >> The reference to Xen specific IOMMU node using "iommus" property >> indicates that Xen grant mappings need to be enabled for the device, >> and it specifies the ID of the domain where the corresponding backend >> resides. The domid (domain ID) is used as an argument to the Xen grant >> mapping APIs. >> >> This is needed for the option to restrict memory access using Xen grant >> mappings to work which primary goal is to enable using virtio devices >> in Xen guests. >> >> Signed-off-by: Oleksandr Tyshchenko >> --- >> Changes RFC -> V1: >> - update commit subject/description and text in description >> - move to devicetree/bindings/arm/ >> >> Changes V1 -> V2: >> - update text in description >> - change the maintainer of the binding >> - fix validation issue >> - reference xen,dev-domid.yaml schema from virtio/mmio.yaml >> >> Change V2 -> V3: >> - Stefano already gave his Reviewed-by, I dropped it due to the changes (significant) >> - use generic IOMMU device tree bindings instead of custom property >> "xen,dev-domid" >> - change commit subject and description, was >> "dt-bindings: Add xen,dev-domid property description for xen-grant DMA ops" >> --- >> .../devicetree/bindings/iommu/xen,grant-dma.yaml | 49 ++++++++++++++++++++++ >> 1 file changed, 49 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> >> diff --git a/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> new file mode 100644 >> index 00000000..ab5765c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml >> @@ -0,0 +1,49 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/iommu/xen,grant-dma.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Xen specific IOMMU for virtualized devices (e.g. virtio) >> + >> +maintainers: >> + - Stefano Stabellini >> + >> +description: >> + The reference to Xen specific IOMMU node using "iommus" property indicates >> + that Xen grant mappings need to be enabled for the device, and it specifies >> + the ID of the domain where the corresponding backend resides. >> + The binding is required to restrict memory access using Xen grant mappings. > I think this is OK and in line with the discussion we had on the list. I > propose the following wording instead: > > """ > The Xen IOMMU represents the Xen grant table interface. Grant mappings > are to be used with devices connected to the Xen IOMMU using the > "iommus" property, which also specifies the ID of the backend domain. > The binding is required to restrict memory access using Xen grant > mappings. > """ > > >> +properties: >> + compatible: >> + const: xen,grant-dma >> + >> + '#iommu-cells': >> + const: 1 >> + description: >> + Xen specific IOMMU is multiple-master IOMMU device. >> + The single cell describes the domid (domain ID) of the domain where >> + the backend is running. > Here I would say: > > """ > The single cell is the domid (domain ID) of the domain where the backend > is running. > """ > > With the two wording improvements: I am happy with proposed wording improvements, will update. > > Reviewed-by: Stefano Stabellini Thanks! > > >> +required: >> + - compatible >> + - "#iommu-cells" >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + xen_iommu { >> + compatible = "xen,grant-dma"; >> + #iommu-cells = <1>; >> + }; >> + >> + virtio@3000 { >> + compatible = "virtio,mmio"; >> + reg = <0x3000 0x100>; >> + interrupts = <41>; >> + >> + /* The backend is located in Xen domain with ID 1 */ >> + iommus = <&xen_iommu 1>; >> + }; >> -- >> 2.7.4 >> >> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> -- Regards, Oleksandr Tyshchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel