On Tue, 13 Oct 2020, Arnd Bergmann wrote:
On Tue, Oct 13, 2020 at 8:05 PM Stefano Stabellini stefano.stabellini@xilinx.com wrote:
On Tue, 13 Oct 2020, Arnd Bergmann wrote:
On Tue, Oct 13, 2020 at 2:53 AM Stefano Stabellini stefano.stabellini@xilinx.com wrote:
On Mon, 12 Oct 2020, Alex Bennée wrote: Just FYI, Xen has mechanisms to pre-share memory areas statically (from VM creation) between VMs. We could pre-share a memory region between domU1 and domU2 and use it for virtio. We would have to come up with a way to mark the memory as "special virtio memory" and let Linux/QEMU know about it. Maybe we could use a reserved-memory binding for it.
If the host allocates that memory, I'd probably just define it as a device specific area (e.g. a PCI BAR) rather than making it part of system RAM and then marking it as reserved.
What I had in mind would be more like the existing virtio though: allocate a contiguous guest physical memory area at device initialization time and register it in place of the normal virtqueue descriptor table.
And the memory allocation would come from the guest with the frontends, right? I think it would be best if the memory allocation was done by the domU with the frontends, rather than the domain with the backends, because otherwise we risk the backend domain running low on memory (many frontend domains connect to a single backend domain).
I'm not sure I was using the same meaning of frontend vs backend here. I thought the use case here would be one front-end with many backends that each access one hardware device.
The allocation needs to be from the guest that runs the virtio driver as normal, and get exported to whatever implements the device behind it, which could be host kernel, host user space or another guest.
Getting the terminology right is always half of the challenge :-)
I have been calling "frontend" the guest running the virtio driver, typically in the kernel, e.g. drivers/net/virtio_net.c.
I have been calling "backend" the domain with the virtio emulator, e.g. QEMU.
So it looks like we are actually saying the same thing.