search for: virtio_pci_queue_pfn

Displaying 20 results from an estimated 119 matches for "virtio_pci_queue_pfn".

2014 Aug 27
2
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...e == NULL) { > err = -ENOMEM; > goto out_info; > } > > /* activate the queue */ > - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > > /* create the vring */ > @@ -462,7 +464,8 @@ out_assign: > vring_del_virtqueue(vq); > out_activate_queue: > iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > - free_pages_exact(info->queue, size); > + dma_free_coherent(vdev->dev.parent, size, &gt...
2014 Aug 27
2
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...e == NULL) { > err = -ENOMEM; > goto out_info; > } > > /* activate the queue */ > - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > > /* create the vring */ > @@ -462,7 +464,8 @@ out_assign: > vring_del_virtqueue(vq); > out_activate_queue: > iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > - free_pages_exact(info->queue, size); > + dma_free_coherent(vdev->dev.parent, size, &gt...
2014 Dec 08
0
[PATCH v2 06/10] virtio_pci: setup vqs indirectly
...= to_vp_device(vdev); - struct virtio_pci_vq_info *info; struct virtqueue *vq; - unsigned long flags, size; + unsigned long size; u16 num; int err; @@ -409,28 +415,21 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index, if (!num || ioread32(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN)) return ERR_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(...
2014 Dec 08
0
[PATCH v2 06/10] virtio_pci: setup vqs indirectly
...= to_vp_device(vdev); - struct virtio_pci_vq_info *info; struct virtqueue *vq; - unsigned long flags, size; + unsigned long size; u16 num; int err; @@ -409,28 +415,21 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index, if (!num || ioread32(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN)) return ERR_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(...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...e == NULL) { > err = -ENOMEM; > goto out_info; > } > > /* activate the queue */ > - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > > /* create the vring */ > vq = vring_new_virtqueue(index, info->num, VIRTIO_PCI_VRING_ALIGN, vdev, > - true, false, info->queue, > + true, info->use_dma_api, info->queue, > vp_notify, callback, name); > if (!vq) { > err = -ENOMEM; &g...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...e == NULL) { > err = -ENOMEM; > goto out_info; > } > > /* activate the queue */ > - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > > /* create the vring */ > vq = vring_new_virtqueue(index, info->num, VIRTIO_PCI_VRING_ALIGN, vdev, > - true, false, info->queue, > + true, info->use_dma_api, info->queue, > vp_notify, callback, name); > if (!vq) { > err = -ENOMEM; &g...
2014 Sep 17
1
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...e == NULL) { > err = -ENOMEM; > goto out_info; > } > > /* activate the queue */ > - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > > /* create the vring */ > vq = vring_new_virtqueue(index, info->num, VIRTIO_PCI_VRING_ALIGN, vdev, > - true, false, info->queue, > + true, info->use_dma_api, info->queue, > vp_notify, callback, name); > if (!vq) { > err = -ENOMEM; &g...
2014 Sep 17
1
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...e == NULL) { > err = -ENOMEM; > goto out_info; > } > > /* activate the queue */ > - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > > /* create the vring */ > vq = vring_new_virtqueue(index, info->num, VIRTIO_PCI_VRING_ALIGN, vdev, > - true, false, info->queue, > + true, info->use_dma_api, info->queue, > vp_notify, callback, name); > if (!vq) { > err = -ENOMEM; &g...
2014 Aug 26
0
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...a_addr, GFP_KERNEL); if (info->queue == NULL) { err = -ENOMEM; goto out_info; } /* activate the queue */ - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); /* create the vring */ @@ -462,7 +464,8 @@ out_assign: vring_del_virtqueue(vq); out_activate_queue: iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); - free_pages_exact(info->queue, size); + dma_free_coherent(vdev->dev.parent, size, + info->queue, info->queue_dma_ad...
2014 Aug 27
0
[PATCH 3/3] virtio_pci: Use the DMA API for virtqueues
...out_info; >> } >> >> /* activate the queue */ >> - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, >> + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, >> vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); >> >> /* create the vring */ >> @@ -462,7 +464,8 @@ out_assign: >> vring_del_virtqueue(vq); >> out_activate_queue: >> iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); >> - free_pages_exact(info->queue, size); >> +...
2014 Dec 08
0
[PATCH v2 08/10] virtio_pci: split out legacy device support
...num; - int err; - - /* Select the queue we're interested in */ - iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); - - /* Check if queue 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 q...
2014 Dec 08
0
[PATCH v2 08/10] virtio_pci: split out legacy device support
...num; - int err; - - /* Select the queue we're interested in */ - iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); - - /* Check if queue 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 q...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...info->queue); + } if (info->queue == NULL) { err = -ENOMEM; goto out_info; } /* activate the queue */ - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); /* create the vring */ vq = vring_new_virtqueue(index, info->num, VIRTIO_PCI_VRING_ALIGN, vdev, - true, false, info->queue, + true, info->use_dma_api, info->queue, vp_notify, callback, name); if (!vq) { err = -ENOMEM; @@ -463,7 +518,12 @@ out_assign: vring_d...
2014 Dec 08
0
[PATCH 8/9] virtio_pci: split out legacy device support
...num; - int err; - - /* Select the queue we're interested in */ - iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); - - /* Check if queue 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 q...
2014 Dec 08
0
[PATCH 8/9] virtio_pci: split out legacy device support
...num; - int err; - - /* Select the queue we're interested in */ - iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); - - /* Check if queue 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 q...
2010 Sep 29
1
[RFC PATCH] virtio: (Partially) enable suspend/resume support
...I haven't looked at this part of the problem yet. We also need a per-driver resume callback which can update the devices with driver-specific data. Eg, for virtio_console, the guest port open/close status will have to be known to the device. QEMU also starts using the queues as soon as the VIRTIO_PCI_QUEUE_PFN command is sent, so it has to be taught to only start using queues when the device is ready and the queues are set up. However, I just wanted to send this out to get reactions / comments. Not-yet-Signed-off-by: Amit Shah <amit.shah at redhat.com> --- drivers/virtio/virtio_pci.c | 34 +++...
2010 Sep 29
1
[RFC PATCH] virtio: (Partially) enable suspend/resume support
...I haven't looked at this part of the problem yet. We also need a per-driver resume callback which can update the devices with driver-specific data. Eg, for virtio_console, the guest port open/close status will have to be known to the device. QEMU also starts using the queues as soon as the VIRTIO_PCI_QUEUE_PFN command is sent, so it has to be taught to only start using queues when the device is ready and the queues are set up. However, I just wanted to send this out to get reactions / comments. Not-yet-Signed-off-by: Amit Shah <amit.shah at redhat.com> --- drivers/virtio/virtio_pci.c | 34 +++...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 05/13] [Mostly resend] virtio additions
...+ + /* Select the queue we're interested in */ + iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); + + /* Check if queue 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); + + /* 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->queue_index = index; + info->num =...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 05/13] [Mostly resend] virtio additions
...+ + /* Select the queue we're interested in */ + iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); + + /* Check if queue 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); + + /* 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->queue_index = index; + info->num =...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...out_info; >> } >> >> /* activate the queue */ >> - iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, >> + iowrite32(info->queue_dma_addr >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, >> vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); >> >> /* create the vring */ >> vq = vring_new_virtqueue(index, info->num, VIRTIO_PCI_VRING_ALIGN, vdev, >> - true, false, info->queue, >> + true, info->use_dma_api, info->queue, >&g...