[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250813062822.3rsgdx5fmefzslc2@vireshk-i7>
Date: Wed, 13 Aug 2025 11:58:22 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Rob Herring <robh@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Eugenio Pérez <eperezma@...hat.com>,
Jason Wang <jasowang@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Saravana Kannan <saravanak@...gle.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Arnd Bergmann <arnd@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Alex Bennée <alex.bennee@...aro.org>,
Bill Mills <bill.mills@...aro.org>, devicetree@...r.kernel.org,
virtualization@...ts.linux.dev, Sudeep Holla <sudeep.holla@....com>,
Bertrand Marquis <bertrand.marquis@....com>,
"Edgar E . Iglesias" <edgar.iglesias@....com>,
Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Subject: Re: [RFC PATCH 0/6] virtio: Add support for Virtio message transport
On 12-08-25, 08:28, Rob Herring wrote:
> On Tue, Aug 12, 2025 at 4:50 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
> > I tried something like this now:
> >
> > reserved-memory {
> > #address-cells = <2>;
> > #size-cells = <2>;
> > ranges;
> >
> > rmem@...000000 {
> > compatible = "restricted-dma-pool", "virtio-msg,loopback";
>
> The order is wrong here. The 2nd one seems more specific to me.
Right.
> But is "restricted-dma-pool" useful?
I need this to call kernel/dma/swiotlb.c: rmem_swiotlb_setup(), which
makes all the memory allocation for the device happen from that area.
> Should an OS that only understands that and not
> "virtio-msg,loopback" use it?
Since the reserved memory isn't linked to a device in the DT (via the
"memory-region" property), I don't expect an OS to use it without
virtio-msg.
> The format of compatibles is <vendor>,<device/block/interface> and
> "virtio-msg" is not a vendor.
"virtio,msg" is fine then I guess ? Just like "virtio,mmio".
> > reg = <0x00000001 0x00000000 0x0 0x00400000>; /* 4 MiB */
> > };
> > };
> >
> > and this works fine. I am adding two compatibles for virtio-msg:
> > "virtio-msg,loopback" and "virtio-msg,ffa". Yes I will properly
> > document them in the next version.
>
> Why do you need 2 compatibles? Can't you discover what the remote end
> is with some message? We only define "virtio-mmio" in DT for example,
> not that the device is a console, rng, etc.
In case of virtio-mmio, the reg-range is trapped by the other side and
meaningful MMIO messages are exchanged. And so the OS knows the kind
of device the DT node is related to.
In this case however, this memory is going to be used for virtqueues
and buffers and I don't see a way of communicating the device type
here. Maybe I can get rid of two compatibles and add a property that
links to a device type ? The memory is otherwise exactly same in both
the cases, it is just about which device is using it eventually.
--
viresh
Powered by blists - more mailing lists