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 30D42C433F5 for ; Wed, 4 May 2022 00:03:27 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DaW9vG1wpJZOnj/GEPdG8WPPzNdLkRsYbcetVePhZJY=; b=WgBPA4LRa77MEJ 5rC0sEAhI1ZjFguQN7y4q7NDcFVxbOrVQf34lD81OxNuQm0Um6aJipXJAE46mjeWsfs/1im4q3yL/ tHf+ELSxJptGrVj3ZHJL8aMmsP5G7hoFuux0PH5/ZXW1esRSeLRwyjKXRKPk3cL9jqLcATNk1R83q LU/6wUfUcao2Y/fCCzGJaw1xTHxi35fXH8qcxhxEMtvBF2bdt/G5VR2CfCz0RraWqMXg/A1UWKs3K 7+sKbbD7EjJwel55UZ3EFzEQP4ccGlKIeQock/G4xrNi0mQUcay50l7J6PvLusoMmrhdRUmAF/ifV eJh01RwTMUzskPcIpMWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nm2T8-00875t-Kk; Wed, 04 May 2022 00:02:14 +0000 Received: from mail-oa1-f46.google.com ([209.85.160.46]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nm2T5-00874a-Cy for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 00:02:13 +0000 Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-ed9ac77cbbso8206722fac.1 for ; Tue, 03 May 2022 17:02:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=XPALVs8tri7925YP8yP2QcFpx7h0JSNeGifZWhU99Ro=; b=ToIVo21fmqoS79ckWm2naaqUQnbCUroPXIKpM9XzU5s7y6eRC4OkHI8kMlGcNm9TPf uUMWAXhtU1uQcVLzmvkpe19Hn8qpwM2FahGlaUQgTGViEXAmbdmrelsOsfQ1+hh6+O7G e1TLjkDt0I1gf8MAdbCwXUdF1cGL9yLTjGXQwVtODDbxfugA12SSbL3D+uBNBdUb0gG0 z5HzmnOu4nE1+Rba2uBlp3yIYOH1ijcBb3dmfagMHt1VspVAe9KgqFiRMH/m18Qk/SKp eUxmMVHwrw2uX+1fxYRbLiN9cKpIz/TqJK5hESxswKa42aWgAo4BJLP0NNVafkTHz1ec E3SQ== X-Gm-Message-State: AOAM530lA8Cd1A6XgkXjtDksHgbG8mg/REFTFo5AKscCrYjgZtWxHzMv ypspux0fAv9FhMXifwT4YQ== X-Google-Smtp-Source: ABdhPJzDGRHxbFONbrvkkP2SSUKrYke5y7WcShS5ZvQNY7jHJAryoCIKp3IBbg4qJhIn8naxdCDyWw== X-Received: by 2002:a05:6870:b292:b0:ec:ec79:4842 with SMTP id c18-20020a056870b29200b000ecec794842mr2769207oao.145.1651622529455; Tue, 03 May 2022 17:02:09 -0700 (PDT) Received: from robh.at.kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id b14-20020a056870160e00b000e915a9121csm8077296oae.52.2022.05.03.17.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 17:02:08 -0700 (PDT) Received: (nullmailer pid 275646 invoked by uid 1000); Wed, 04 May 2022 00:02:08 -0000 Date: Tue, 3 May 2022 19:02:08 -0500 From: Rob Herring To: Oleksandr Cc: xen-devel@lists.xenproject.org, virtualization@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Oleksandr Tyshchenko , Jason Wang , Krzysztof Kozlowski , Julien Grall , Juergen Gross , Stefano Stabellini , "Michael S. Tsirkin" , Christoph Hellwig Subject: Re: [PATCH V1 4/6] dt-bindings: Add xen,dev-domid property description for xen-grant DMA ops Message-ID: References: <1650646263-22047-1-git-send-email-olekstysh@gmail.com> <1650646263-22047-5-git-send-email-olekstysh@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220503_170211_465205_DEA1CE56 X-CRM114-Status: GOOD ( 42.30 ) 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-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 03, 2022 at 08:09:32PM +0300, Oleksandr wrote: > = > On 03.05.22 00:59, Rob Herring wrote: > = > Hello Rob > = > = > > On Fri, Apr 22, 2022 at 07:51:01PM +0300, Oleksandr Tyshchenko wrote: > > > From: Oleksandr Tyshchenko > > > = > > > Introduce Xen specific binding for the virtualized device (e.g. virti= o) > > > to be used by Xen grant DMA-mapping layer in the subsequent commit. > > > = > > > This binding indicates that Xen grant mappings scheme needs to be > > > enabled for the device which DT node contains that property and speci= fies > > > the ID of Xen domain where the corresponding backend resides. The ID > > > (domid) is used as an argument to the grant mapping APIs. > > > = > > > This is needed for the option to restrict memory access using Xen gra= nt > > > 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/ > > > --- > > > .../devicetree/bindings/arm/xen,dev-domid.yaml | 37 +++++++++++= +++++++++++ > > > 1 file changed, 37 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/arm/xen,dev-do= mid.yaml > > > = > > > diff --git a/Documentation/devicetree/bindings/arm/xen,dev-domid.yaml= b/Documentation/devicetree/bindings/arm/xen,dev-domid.yaml > > > new file mode 100644 > > > index 00000000..ef0f747 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/arm/xen,dev-domid.yaml > > > @@ -0,0 +1,37 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/arm/xen,dev-domid.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Xen specific binding for the virtualized device (e.g. virtio) > > > + > > > +maintainers: > > > + - Oleksandr Tyshchenko > > > + > > > +select: true > > Do we really need to support this property everywhere? > = > From my understanding - yes. > = > As, I think, any device node describing virtulized device in the guest > device tree can have this property.=A0 Initially (in the RFC series) the > "solution to restrict memory access using Xen grant mappings" was > virtio-specific. > = > Although the support of virtio is a primary target of this series, we > decided to generalize this work and expand it to any device [1]. So the X= en > grant mappings scheme (this property to be used for) can be theoretically > used for any device emulated by the Xen backend. > = > = > > > + > > > +description: > > > + This binding indicates that Xen grant mappings scheme needs to be = enabled > > > + for that device and specifies the ID of Xen domain where the corre= sponding > > > + device (backend) resides. This is needed for the option to restric= t memory > > > + access using Xen grant mappings to work. > > > + > > > +properties: > > > + xen,dev-domid: > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + description: > > > + The domid (domain ID) of the domain where the device (backend)= is running. > > > + > > > +additionalProperties: true > > > + > > > +examples: > > > + - | > > > + virtio_block@3000 { > > virtio@3000 > = > ok, will change > = > = > > = > > > + compatible =3D "virtio,mmio"; > > > + reg =3D <0x3000 0x100>; > > > + interrupts =3D <41>; > > > + > > > + /* The device is located in Xen domain with ID 1 */ > > > + xen,dev-domid =3D <1>; > > This fails validation: > > = > > Documentation/devicetree/bindings/arm/xen,dev-domid.example.dtb: virtio= _block@3000: xen,dev-domid: [[1]] is not of type 'object' > > From schema: /home/rob/proj/git/linux-dt/Documentation/devicet= ree/bindings/virtio/mmio.yaml > = > Thank you for pointing this out, my fault, I haven't "properly" checked t= his > before. I think, we need to remove "compatible =3D "virtio,mmio"; here Uhh, no. That just means the example is incomplete. You need to add this = property or reference this schema from virtio/mmio.yaml. > diff --git a/Documentation/devicetree/bindings/arm/xen,dev-domid.yaml > b/Documentation/devicetree/bindings/arm/xen,dev-domid.yaml > index 2daa8aa..d2f2140 100644 > --- a/Documentation/devicetree/bindings/arm/xen,dev-domid.yaml > +++ b/Documentation/devicetree/bindings/arm/xen,dev-domid.yaml > @@ -28,7 +28,7 @@ additionalProperties: true > =A0examples: > =A0=A0 - | > =A0=A0=A0=A0 virtio_block@3000 { > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 compatible =3D "virtio,mmio"; > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* ... */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 reg =3D <0x3000 0x100>; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 interrupts =3D <41>; > = > = > = > > = > > The property has to be added to the virtio/mmio.yaml schema. If it is > > not needed elsewhere, then *just* add the property there. > = > As I described above, the property is not virtio specific and can be used > for any virtualized device for which Xen grant mappings scheme needs to be > enabled (xen-grant DMA-mapping layer). But that's a finite list of devices, right? In any case, you have to = list the property anywhere it can be used. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel