Re: [RFC PATCH 1/3] content: Add VIRTIO_F_SWIOTLB to negotiate use of SWIOTLB bounce buffers
From: Christoph Hellwig
Date: Mon Apr 07 2025 - 03:38:59 EST
On Fri, Apr 04, 2025 at 11:15:33AM +0100, David Woodhouse wrote:
> Of course, the beauty of the restricted-dma-pool as supported by DT is
> that it's a *system* memory buffer, which is actually OK as long as
> it's reserved address space and not just part of normal system memory
> that an unsuspecting guest might use for general purposes. So the
> trusted part of the hypervisor (e.g. pKVM) can *allow* the VMM access
> to that space.
>
> It doesn't *have* to be on-device. That just seemed like the more
> natural way to do it for PCI.
It isn't very natural. For actual PCI devices it is a lot less efficient
compared to bounce buffering in special host memory. For virtual device
that's not the case, but at least for Linux guest it still makes the setup
a lot more complicated as we can't just reuse the restricted-dma-pool
but need a new version of it that uses MMIO helpers and device specific
setup code.