Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5815528ioo; Wed, 1 Jun 2022 13:10:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdt1bDw3qo60+jOYWGBKpzEPX/5qojYJl8b4vt91HFdR8uPJLyJvoRDJu5D2UZ9tpC83Rl X-Received: by 2002:a17:90b:1c05:b0:1e0:bda1:d8c7 with SMTP id oc5-20020a17090b1c0500b001e0bda1d8c7mr35767736pjb.90.1654114243720; Wed, 01 Jun 2022 13:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654114243; cv=none; d=google.com; s=arc-20160816; b=i7WTwIcEAThNHKPBn0YSXcu10CqUzwFufXLsQ761eE3VfHNoVmfxRFmXe8mDmaTZFj +a2AgNLXcGm62jhu7BwWavRi1QxAjWISNcYKaKnmLf650mKE0CulZHqagg7aHTPLHRA+ XPcGbYyA3gJ2IGgp4jni9k+lXICJvttRPQz4V06iiOOlEG4Ka8kfxtnJVSoVzBBkMUsd IWu7qlDsG0+2pgxWbwqEiUtMpsNWbZIU6/jhzKVj+9J5zJBt/V8EeOANNpqNtkpo5kGE eB9dxGZTygJ1JoDQyWCNQbFdpo6nb4uE467kqmt6L/phF71/BwwY+ydI4z3mfDNCjNDp 8T/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=GgwIInYFQ+i4wBUK6us+RvRaDWXGnylLfCTBSD/AkgU=; b=OajKpqBDzzrk9a1TZf+eNt+b96/9CLN5BL6ebLQiApjphN5sw7xKsglrOGCDQ+d0DL i/Zs/j3vEYx5snViq7M9gf6nuLlQjM0UIvMYX36Kw6AqbZzX8G/S8MHu16s7KeAhR8o+ TPiTkU+OwhoNkJ2AtSA26/d7iu9Kde9Ff7JhCvZ4oADwyy6xIuEIw9T3gEfxjMSm7Tbf 80stl4bvMLyKgpxaaG2tE6O2lpatK+db+ih/NEEXz/X1ypgAX40UPWjSlsY4BxAnzugW zoUSRxPOQ4qJ4WCx9v9KeYUs8NQR4afvm8exP/556sLKO/W0IXGxrkX98a9Q4taJ2L0C z/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DfuMHCjb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j4-20020a170902758400b0015f4422e432si3553874pll.130.2022.06.01.13.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:10:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DfuMHCjb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C9402346B8; Wed, 1 Jun 2022 12:26:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbiFAAfI (ORCPT + 99 others); Tue, 31 May 2022 20:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343793AbiFAAfB (ORCPT ); Tue, 31 May 2022 20:35:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9798768304; Tue, 31 May 2022 17:34:57 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 3DED06149E; Wed, 1 Jun 2022 00:34:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D44A2C385A9; Wed, 1 Jun 2022 00:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654043696; bh=AGLxz/xreC1/Xeaa2Sjt8QqZXIylnuwZjPxvPygrygg=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=DfuMHCjbgseVb9ElRvU6+fEgDpIv3ulhOxsoIPOQDdh5GUh8KjIJ28oGLRaKeGvWL 0OGOBkYVHKvSBhLuz9k1LfSVAr5J41JWFoFQ4TABVCeTglNoTjSMmz8FJQ49sdckLg qsGKa+Yr+MoyMmAdmNIWUZGeNcE1QpV9WDLAqZFgKgw12wg03tSKY2yAzfzVh+OlIr IhSeKnYLMf2s3ZC0XoXksZyr4Mb/ha+g8gPhA0eQAKOPF5QkoCt5VR2mG2iYj77PY2 +OIvjXfirEI3JrU/2GAu0wBIXEs9XmzEmlNrwfNOn0Ao2FA84oEYKiBszft0wz/igv pc1IcOOf15l3Q== Date: Tue, 31 May 2022 17:34:54 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: Oleksandr Tyshchenko 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 , Stefano Stabellini , "Michael S. Tsirkin" , Christoph Hellwig , Arnd Bergmann Subject: Re: [PATCH V3 5/8] dt-bindings: Add xen,grant-dma IOMMU description for xen-grant DMA ops In-Reply-To: <1653944417-17168-6-git-send-email-olekstysh@gmail.com> Message-ID: References: <1653944417-17168-1-git-send-email-olekstysh@gmail.com> <1653944417-17168-6-git-send-email-olekstysh@gmail.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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: Reviewed-by: Stefano Stabellini > +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 >