search for: virtio_direct_dma_op

Displaying 20 results from an estimated 25 matches for "virtio_direct_dma_op".

Did you mean: virtio_direct_dma_ops
2018 Jul 28
3
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
...andual wrote: > Now that virtio core always needs all virtio devices to have DMA OPS, we > need to make sure that the structure it points is the right one. In the > absence of VIRTIO_F_IOMMU_PLATFORM flag QEMU expects GPA from guest kernel. > In such case, virtio device must use default virtio_direct_dma_ops DMA OPS > structure which transforms scatter gather buffer addresses as GPA. This > DMA OPS override must happen as early as possible during virtio device > initializatin sequence before virtio core starts using given device's DMA > OPS callbacks for I/O transactions. This change d...
2018 Jul 28
3
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
...andual wrote: > Now that virtio core always needs all virtio devices to have DMA OPS, we > need to make sure that the structure it points is the right one. In the > absence of VIRTIO_F_IOMMU_PLATFORM flag QEMU expects GPA from guest kernel. > In such case, virtio device must use default virtio_direct_dma_ops DMA OPS > structure which transforms scatter gather buffer addresses as GPA. This > DMA OPS override must happen as early as possible during virtio device > initializatin sequence before virtio core starts using given device's DMA > OPS callbacks for I/O transactions. This change d...
2018 Jul 28
0
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
...gt; Now that virtio core always needs all virtio devices to have DMA OPS, we > > need to make sure that the structure it points is the right one. In the > > absence of VIRTIO_F_IOMMU_PLATFORM flag QEMU expects GPA from guest kernel. > > In such case, virtio device must use default virtio_direct_dma_ops DMA OPS > > structure which transforms scatter gather buffer addresses as GPA. This > > DMA OPS override must happen as early as possible during virtio device > > initializatin sequence before virtio core starts using given device's DMA > > OPS callbacks for I/O transac...
2018 Jul 30
1
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
> +const struct dma_map_ops virtio_direct_dma_ops; This belongs into a header if it is non-static. If you only use it in this file anyway please mark it static and avoid a forward declaration. > + > int virtio_finalize_features(struct virtio_device *dev) > { > int ret = dev->config->finalize_features(dev); > @@ -174,6...
2018 Jul 30
1
[RFC 1/4] virtio: Define virtio_direct_dma_ops structure
...turn queue; queue is a very odd name in a generic memory allocator. > +void virtio_direct_free(struct device *dev, size_t size, void *vaddr, > + dma_addr_t dma_addr, unsigned long attrs) > +{ > + free_pages_exact(vaddr, PAGE_ALIGN(size)); > +} > + > +const struct dma_map_ops virtio_direct_dma_ops = { > + .alloc = virtio_direct_alloc, > + .free = virtio_direct_free, > + .map_page = virtio_direct_map_page, > + .unmap_page = virtio_direct_unmap_page, > + .mapping_error = virtio_direct_mapping_error, > +}; This is missing a dma_map_sg implementation. In general this...
2018 Jul 30
1
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
> > + > > + if (xen_domain()) > > + goto skip_override; > > + > > + if (virtio_has_iommu_quirk(dev)) > > + set_dma_ops(dev->dev.parent, &virtio_direct_dma_ops); > > + > > + skip_override: > > + > > I prefer normal if scoping as opposed to goto spaghetti pls. > Better yet move vring_use_dma_api here and use it. > Less of a chance something will break. I agree about avoid pointless gotos here, but we can do things perfectly...
2018 Jul 20
0
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
Now that virtio core always needs all virtio devices to have DMA OPS, we need to make sure that the structure it points is the right one. In the absence of VIRTIO_F_IOMMU_PLATFORM flag QEMU expects GPA from guest kernel. In such case, virtio device must use default virtio_direct_dma_ops DMA OPS structure which transforms scatter gather buffer addresses as GPA. This DMA OPS override must happen as early as possible during virtio device initializatin sequence before virtio core starts using given device's DMA OPS callbacks for I/O transactions. This change detects device's...
2018 Jul 20
0
[RFC 1/4] virtio: Define virtio_direct_dma_ops structure
...s_addr)) { + free_pages_exact(queue, PAGE_ALIGN(size)); + return NULL; + } + } + return queue; +} + +void virtio_direct_free(struct device *dev, size_t size, void *vaddr, + dma_addr_t dma_addr, unsigned long attrs) +{ + free_pages_exact(vaddr, PAGE_ALIGN(size)); +} + +const struct dma_map_ops virtio_direct_dma_ops = { + .alloc = virtio_direct_alloc, + .free = virtio_direct_free, + .map_page = virtio_direct_map_page, + .unmap_page = virtio_direct_unmap_page, + .mapping_error = virtio_direct_mapping_error, +}; +EXPORT_SYMBOL(virtio_direct_dma_ops); diff --git a/drivers/virtio/virtio_pci_common.h b/driv...
2018 Jul 20
15
[RFC 0/4] Virtio uses DMA API for all devices
...l.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 secon...
2018 Jul 20
15
[RFC 0/4] Virtio uses DMA API for all devices
...l.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 secon...
2018 Jul 20
3
[RFC 4/4] virtio: Add platform specific DMA API translation for virito devices
...s if required */ > +} > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c > index 6b13987..432c332 100644 > --- a/drivers/virtio/virtio.c > +++ b/drivers/virtio/virtio.c > @@ -168,6 +168,12 @@ EXPORT_SYMBOL_GPL(virtio_add_status); > > const struct dma_map_ops virtio_direct_dma_ops; > > +#ifndef platform_override_dma_ops > +static inline void platform_override_dma_ops(struct virtio_device *vdev) > +{ > +} > +#endif > + > int virtio_finalize_features(struct virtio_device *dev) > { > int ret = dev->config->finalize_features(dev); >...
2018 Jul 20
3
[RFC 4/4] virtio: Add platform specific DMA API translation for virito devices
...s if required */ > +} > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c > index 6b13987..432c332 100644 > --- a/drivers/virtio/virtio.c > +++ b/drivers/virtio/virtio.c > @@ -168,6 +168,12 @@ EXPORT_SYMBOL_GPL(virtio_add_status); > > const struct dma_map_ops virtio_direct_dma_ops; > > +#ifndef platform_override_dma_ops > +static inline void platform_override_dma_ops(struct virtio_device *vdev) > +{ > +} > +#endif > + > int virtio_finalize_features(struct virtio_device *dev) > { > int ret = dev->config->finalize_features(dev); >...
2018 Aug 03
2
[RFC 0/4] Virtio uses DMA API for all devices
...ns 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 &g...
2018 Aug 03
2
[RFC 0/4] Virtio uses DMA API for all devices
...ns 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 &g...
2018 Jul 23
0
[RFC 4/4] virtio: Add platform specific DMA API translation for virito devices
...;> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c >> index 6b13987..432c332 100644 >> --- a/drivers/virtio/virtio.c >> +++ b/drivers/virtio/virtio.c >> @@ -168,6 +168,12 @@ EXPORT_SYMBOL_GPL(virtio_add_status); >> >> const struct dma_map_ops virtio_direct_dma_ops; >> >> +#ifndef platform_override_dma_ops >> +static inline void platform_override_dma_ops(struct virtio_device *vdev) >> +{ >> +} >> +#endif >> + >> int virtio_finalize_features(struct virtio_device *dev) >> { >> int ret = dev->...
2018 Jul 20
0
[RFC 0/4] Virtio uses DMA API for all devices
...> 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...
2018 Aug 02
0
[RFC 0/4] Virtio uses DMA API for all devices
...> 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...
2018 Aug 03
0
[RFC 0/4] Virtio uses DMA API for all devices
...fferent 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...
2018 Jul 23
2
[RFC 0/4] Virtio uses DMA API for all devices
...ns 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 &g...
2018 Jul 23
2
[RFC 0/4] Virtio uses DMA API for all devices
...ns 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 &g...