RFC Virtio uses DMA API for all devices
Status from this message: Nacked-by: Christoph Hellwig <[email protected]>
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest4 patches 162 repliesNAK
Patches in v1
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | virtio: Define virtio_direct_dma_ops structuredrivers/ drivers/ | +63 | 0 replies | |
| 1/4 | virtio: Define virtio_direct_dma_ops structuredrivers/ drivers/ | +63 | 3 replies | |
| 2/4 | virtio: Override device's DMA OPS with virtio_direct_dma_ops selectivelydrivers/ | +5 | 0 replies | |
| 2/4 | virtio: Override device's DMA OPS with virtio_direct_dma_ops selectivelydrivers/ | +5 | 12 replies | |
| 3/4 | virtio: Force virtio core to use DMA API callbacks for all virtio devicesdrivers/ | +2 | 0 replies | |
| 3/4 | virtio: Force virtio core to use DMA API callbacks for all virtio devicesdrivers/ | +2 | 0 replies | |
| 4/4 | virtio: Add platform specific DMA API translation for virito devicesarch/ arch/ drivers/ | +19 | 0 replies | |
| 4/4 | virtio: Add platform specific DMA API translation for virito devicesarch/ arch/ drivers/ | +19 | 5 replies |
Reviews trailers per patch
None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Will Deacon | Christoph Hellwig |
|---|---|---|
| Series | A-b T-b | Nacked-by |
| 1/4 | ||
| 1/4 | ||
| 2/4 | ||
| 2/4 | ||
| 3/4 | ||
| 3/4 | ||
| 4/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC 0/4] Virtio uses DMA API for all devices
This patch series is the follow up on the discussions we had before about the RFC titled [RFC,V2] virtio: Add platform specific DMA API translation for virito devices (https://patchwork.kernel.org/patch/10417371/). There were suggestions about doing away with two different paths of transactions with the host/QEMU, first being the direct GPA and the other being the DMA API based translations.
First patch attempts to create a direct GPA mapping based DMA operations structure called 'virtio_direct_dma_ops' with exact same implementation of the direct GPA path which virtio core currently has but just wrapped in a DMA API format. Virtio core must use 'virtio_direct_dma_ops' instead of the arch default in absence of VIRTIO_F_IOMMU_PLATFORM flag to preserve the existing semantics. The second patch does exactly that inside the function virtio_finalize_features(). The third patch removes the default direct GPA path from virtio core forcing it to use DMA API callbacks for all devices. Now with that change, every device must have a DMA operations structure associated with it. The fourth patch adds an additional hook which gives the platform an opportunity to do yet another override if required. This platform hook can be used on POWER Ultravisor based protected guests to load up SWIOTLB DMA callbacks to do the required (as discussed previously in the above mentioned thread how host is allowed to access only parts of the guest GPA range) bounce buffering into the shared memory for all I/O scatter gather buffers to be consumed on the host side.
Please go through these patches and review whether this approach broadly makes sense. I will appreciate suggestions, inputs, comments regarding the patches or the approach in general. Thank you.
Anshuman Khandual (4):
virtio: Define virtio_direct_dma_ops structure
virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
virtio: Force virtio core to use DMA API callbacks for all virtio devices
virtio: Add platform specific DMA API translation for virito devices
arch/powerpc/include/asm/dma-mapping.h | 6 +++ arch/powerpc/platforms/pseries/iommu.c | 6 +++ drivers/virtio/virtio.c | 72 ++++++++++++++++++++++++++++++++++ drivers/virtio/virtio_pci_common.h | 3 ++ drivers/virtio/virtio_ring.c | 65 +----------------------------- 5 files changed, 89 insertions(+), 63 deletions(-)
Signature · 1 line
2.9.3