Displaying 20 results from an estimated 116 matches for "virtio_pci_vring_align".
2014 Aug 27
2
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...gt; /* the list node for the virtqueues list */
> struct list_head node;
> @@ -417,15 +418,16 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
> info->num = num;
> info->msix_vector = msix_vec;
>
> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> + &info->queue_dma_addr, GFP_KERNEL);
> if (info->queue == NULL) {
>...
2014 Aug 27
2
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...gt; /* the list node for the virtqueues list */
> struct list_head node;
> @@ -417,15 +418,16 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
> info->num = num;
> info->msix_vector = msix_vec;
>
> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> + &info->queue_dma_addr, GFP_KERNEL);
> if (info->queue == NULL) {
>...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...const char *name,
> @@ -416,21 +462,30 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
>
> info->num = num;
> info->msix_vector = msix_vec;
> + info->use_dma_api = vp_use_dma_api();
>
> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> + if (info->use_dma_api) {
> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> + &info->queue_dma_addr,
> + GFP_...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...const char *name,
> @@ -416,21 +462,30 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
>
> info->num = num;
> info->msix_vector = msix_vec;
> + info->use_dma_api = vp_use_dma_api();
>
> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> + if (info->use_dma_api) {
> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> + &info->queue_dma_addr,
> + GFP_...
2014 Sep 17
1
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...const char *name,
> @@ -416,21 +462,30 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
>
> info->num = num;
> info->msix_vector = msix_vec;
> + info->use_dma_api = vp_use_dma_api();
>
> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> + if (info->use_dma_api) {
> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> + &info->queue_dma_addr,
> + GFP_...
2014 Sep 17
1
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...const char *name,
> @@ -416,21 +462,30 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
>
> info->num = num;
> info->msix_vector = msix_vec;
> + info->use_dma_api = vp_use_dma_api();
>
> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> + if (info->use_dma_api) {
> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> + &info->queue_dma_addr,
> + GFP_...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...(*callback)(struct virtqueue *vq),
const char *name,
@@ -416,21 +462,30 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
info->num = num;
info->msix_vector = msix_vec;
+ info->use_dma_api = vp_use_dma_api();
- size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
- info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
+ size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
+ if (info->use_dma_api) {
+ info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
+ &info->queue_dma_addr,
+ GFP_KERNEL);
+ } else {
+ info-&g...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...6,21 +462,30 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
>>
>> info->num = num;
>> info->msix_vector = msix_vec;
>> + info->use_dma_api = vp_use_dma_api();
>>
>> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
>> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
>> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
>> + if (info->use_dma_api) {
>> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
>> +...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...@@ -416,21 +462,30 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
> >
> > info->num = num;
> > info->msix_vector = msix_vec;
> > + info->use_dma_api = vp_use_dma_api();
> >
> > - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> > - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> > + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> > + if (info->use_dma_api) {
> > + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> > + &info->queue_dma...
2014 Aug 26
0
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...eue_dma_addr; /* bus address */
/* the list node for the virtqueues list */
struct list_head node;
@@ -417,15 +418,16 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
info->num = num;
info->msix_vector = msix_vec;
- size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
- info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
+ size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
+ info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
+ &info->queue_dma_addr, GFP_KERNEL);
if (info->queue == NULL) {
err = -ENOMEM;
goto out_...
2014 Sep 17
6
[PATCH v5 0/3] virtio: Use the DMA API when appropriate
This fixes virtio on Xen guests as well as on any other platform
that uses virtio_pci on which physical addresses don't match bus
addresses.
This can be tested with:
virtme-run --xen xen --kimg arch/x86/boot/bzImage --console
using virtme from here:
https://git.kernel.org/cgit/utils/kernel/virtme/virtme.git
Without these patches, the guest hangs forever. With these patches,
2014 Sep 17
6
[PATCH v5 0/3] virtio: Use the DMA API when appropriate
This fixes virtio on Xen guests as well as on any other platform
that uses virtio_pci on which physical addresses don't match bus
addresses.
This can be tested with:
virtme-run --xen xen --kimg arch/x86/boot/bzImage --console
using virtme from here:
https://git.kernel.org/cgit/utils/kernel/virtme/virtme.git
Without these patches, the guest hangs forever. With these patches,
2014 Aug 27
0
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...ues list */
>> struct list_head node;
>> @@ -417,15 +418,16 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
>> info->num = num;
>> info->msix_vector = msix_vec;
>>
>> - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
>> - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
>> + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
>> + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
>> + &info->queue_dma_a...
2014 Dec 08
0
[PATCH v2 06/10] virtio_pci: setup vqs indirectly
..._PTR(-ENOENT);
- /* allocate and fill out our structure the represents an active
- * queue */
- info = kmalloc(sizeof(struct virtio_pci_vq_info), GFP_KERNEL);
- if (!info)
- return ERR_PTR(-ENOMEM);
-
info->num = num;
info->msix_vector = msix_vec;
size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
- if (info->queue == NULL) {
- err = -ENOMEM;
- goto out_info;
- }
+ if (info->queue == NULL)
+ return ERR_PTR(-ENOMEM);
/* activate the queue */
iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADD...
2014 Dec 08
0
[PATCH v2 06/10] virtio_pci: setup vqs indirectly
..._PTR(-ENOENT);
- /* allocate and fill out our structure the represents an active
- * queue */
- info = kmalloc(sizeof(struct virtio_pci_vq_info), GFP_KERNEL);
- if (!info)
- return ERR_PTR(-ENOMEM);
-
info->num = num;
info->msix_vector = msix_vec;
size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
- if (info->queue == NULL) {
- err = -ENOMEM;
- goto out_info;
- }
+ if (info->queue == NULL)
+ return ERR_PTR(-ENOMEM);
/* activate the queue */
iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADD...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...t virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
> > >
> > > info->num = num;
> > > info->msix_vector = msix_vec;
> > > + info->use_dma_api = vp_use_dma_api();
> > >
> > > - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> > > - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> > > + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> > > + if (info->use_dma_api) {
> > > + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> &g...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...t virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
> > >
> > > info->num = num;
> > > info->msix_vector = msix_vec;
> > > + info->use_dma_api = vp_use_dma_api();
> > >
> > > - size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
> > > - info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
> > > + size = vring_size(num, VIRTIO_PCI_VRING_ALIGN);
> > > + if (info->use_dma_api) {
> > > + info->queue = dma_zalloc_coherent(vdev->dev.parent, size,
> &g...
2014 Dec 08
0
[PATCH v2 08/10] virtio_pci: split out legacy device support
...ue is either not available or already active. */
- num = ioread16(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NUM);
- if (!num || ioread32(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN))
- return ERR_PTR(-ENOENT);
-
- info->num = num;
- info->msix_vector = msix_vec;
-
- size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
- info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
- if (info->queue == NULL)
- return ERR_PTR(-ENOMEM);
-
- /* activate the queue */
- iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT,
- vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
-
- /* create t...
2014 Dec 08
0
[PATCH v2 08/10] virtio_pci: split out legacy device support
...ue is either not available or already active. */
- num = ioread16(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NUM);
- if (!num || ioread32(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN))
- return ERR_PTR(-ENOENT);
-
- info->num = num;
- info->msix_vector = msix_vec;
-
- size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
- info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
- if (info->queue == NULL)
- return ERR_PTR(-ENOMEM);
-
- /* activate the queue */
- iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT,
- vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
-
- /* create t...
2014 Dec 08
0
[PATCH 8/9] virtio_pci: split out legacy device support
...ue is either not available or already active. */
- num = ioread16(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NUM);
- if (!num || ioread32(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN))
- return ERR_PTR(-ENOENT);
-
- info->num = num;
- info->msix_vector = msix_vec;
-
- size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
- info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
- if (info->queue == NULL)
- return ERR_PTR(-ENOMEM);
-
- /* activate the queue */
- iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT,
- vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
-
- /* create t...