Subject: Re: [PATCH net-next v1] xsk: introduce xsk_dma_cbs

From: "Michael S. Tsirkin" <[email-masked]>
Date: Sun, 23 Apr 2023 16:42:07 -0400

On Sun, Apr 23, 2023 at 08:45:20AM +0200, Greg KH wrote:
> On Sun, Apr 23, 2023 at 02:25:45PM +0800, Xuan Zhuo wrote:
> > The purpose of this patch is to allow driver pass the own dma callbacks
> > to xsk.
> > 
> > This is to cope with the scene of virtio-net. If virtio does not have
> > VIRTIO_F_ACCESS_PLATFORM, then virtio cannot use DMA API. In this case,
> > xsk cannot use DMA API directly to achieve DMA address. Based on this
> > scene, we must let xsk support driver to use the driver's dma callbacks.
> 
> Why does virtio need to use dma?  That seems to go against the overall
> goal of virtio's new security restrictions that are being proposed
> (where they do NOT want it to use dma as it is not secure).

Yes, they exactly use dma, specifically dma into bounce buffer.