Displaying 20 results from an estimated 209 matches for "iowrite16".
2015 Feb 15
3
[PATCH 1/2] virtio_pci_modern: type-safe io accessors
...oread8(addr);
+}
+static inline u16 vp_ioread16 (u16 __iomem *addr)
+{
+ return ioread16(addr);
+}
+
+static inline u32 vp_ioread32(u32 __iomem *addr)
+{
+ return ioread32(addr);
+}
+
+static inline void vp_iowrite8(u8 value, u8 __iomem *addr)
+{
+ iowrite8(value, addr);
+}
+
+static inline void vp_iowrite16(u16 value, u16 __iomem *addr)
+{
+ iowrite16(value, addr);
+}
+
+static inline void vp_iowrite32(u32 value, u32 __iomem *addr)
+{
+ iowrite16(value, addr);
+}
+
static void __iomem *map_capability(struct pci_dev *dev, int off,
size_t minlen,
u32 align,
--
MST
2015 Feb 15
3
[PATCH 1/2] virtio_pci_modern: type-safe io accessors
...oread8(addr);
+}
+static inline u16 vp_ioread16 (u16 __iomem *addr)
+{
+ return ioread16(addr);
+}
+
+static inline u32 vp_ioread32(u32 __iomem *addr)
+{
+ return ioread32(addr);
+}
+
+static inline void vp_iowrite8(u8 value, u8 __iomem *addr)
+{
+ iowrite8(value, addr);
+}
+
+static inline void vp_iowrite16(u16 value, u16 __iomem *addr)
+{
+ iowrite16(value, addr);
+}
+
+static inline void vp_iowrite32(u32 value, u32 __iomem *addr)
+{
+ iowrite16(value, addr);
+}
+
static void __iomem *map_capability(struct pci_dev *dev, int off,
size_t minlen,
u32 align,
--
MST
2019 Nov 05
0
[PATCH 1/2] IFC hardware operation layer
...hw->common_cfg == NULL || hw->notify_base == NULL ||
> + hw->isr == NULL || hw->net_cfg == NULL) {
> + IFC_DBG(&dev->dev, "Incomplete PCI capabilities.\n");
> + return -1;
> + }
> +
> + for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
> + iowrite16(i, &hw->common_cfg->queue_select);
> + notify_off = ioread16(&hw->common_cfg->queue_notify_off);
> + hw->notify_addr[i] = (void *)((u8 *)hw->notify_base +
> + notify_off * hw->notify_off_multiplier);
> + }
> +
> + hw->lm_cfg = hw->mem_r...
2019 Nov 08
0
[PATCH 1/2] IFC hardware operation layer
...hw->common_cfg == NULL || hw->notify_base == NULL ||
> + hw->isr == NULL || hw->net_cfg == NULL) {
> + IFC_DBG(&dev->dev, "Incomplete PCI capabilities.\n");
> + return -1;
> + }
> +
> + for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
> + iowrite16(i, &hw->common_cfg->queue_select);
> + notify_off = ioread16(&hw->common_cfg->queue_notify_off);
> + hw->notify_addr[i] = (void *)((u8 *)hw->notify_base +
> + notify_off * hw->notify_off_multiplier);
> + }
> +
> + hw->lm_cfg = hw->mem_r...
2019 Nov 05
1
[PATCH 1/2] IFC hardware operation layer
...hw->common_cfg == NULL || hw->notify_base == NULL ||
> + hw->isr == NULL || hw->net_cfg == NULL) {
> + IFC_DBG(&dev->dev, "Incomplete PCI capabilities.\n");
> + return -1;
> + }
> +
> + for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
> + iowrite16(i, &hw->common_cfg->queue_select);
> + notify_off = ioread16(&hw->common_cfg->queue_notify_off);
> + hw->notify_addr[i] = (void *)((u8 *)hw->notify_base +
> + notify_off * hw->notify_off_multiplier);
> + }
> +
> + hw->lm_cfg = hw->mem_r...
2015 Feb 11
2
[RFC 0/2] virtio_pci: patches never to apply.
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support,
but I'm pretty sure we should never allow these patches upstream.
Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG.
Rusty Russell (2):
virtio_pci: abstract all MMIO accesses.
virtio: Introducing virtio_pci.no_mmio, the worst boot option in
history.
drivers/virtio/virtio_pci_common.c |
2015 Feb 11
2
[RFC 0/2] virtio_pci: patches never to apply.
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support,
but I'm pretty sure we should never allow these patches upstream.
Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG.
Rusty Russell (2):
virtio_pci: abstract all MMIO accesses.
virtio: Introducing virtio_pci.no_mmio, the worst boot option in
history.
drivers/virtio/virtio_pci_common.c |
2019 Nov 06
0
[PATCH 1/2] IFC hardware operation layer
...y_base == NULL ||
> + hw->isr == NULL || hw->net_cfg == NULL) {
> + IFC_DBG(&dev->dev, "Incomplete PCI capabilities.\n");
> + return -1;
Maybe it's better to fail eailier.
> + }
> +
> + for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
> + iowrite16(i, &hw->common_cfg->queue_select);
> + notify_off = ioread16(&hw->common_cfg->queue_notify_off);
> + hw->notify_addr[i] = (void *)((u8 *)hw->notify_base +
> + notify_off * hw->notify_off_multiplier);
It might be better to store notify_addr inside the...
2019 Oct 16
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...== NULL) {
> + IFC_ERR(&dev->dev, "Incomplete PCI capabilities.\n");
> + return -1;
> + }
> +
> + for (i = 0; i < (IFCVF_MAX_QUEUE_PAIRS * 2); i++) {
Any reason for using hard coded queue pairs limit other than the
max_queue_pairs in the net config?
> + iowrite16(i, &hw->common_cfg->queue_select);
> + notify_off = ioread16(&hw->common_cfg->queue_notify_off);
> + hw->notify_addr[i] = (void *)((u8 *)hw->notify_base +
> + notify_off * hw->notify_off_multiplier);
> + }
> +
> + hw->lm_cfg = hw->mem_resour...
2019 Oct 21
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...s in the net config?
> Hi Jason, Thanks for your kindly comments. For now the driver don't
> support MQ, we intend to provide a minimal feature sets in this
> version 1 driver.
Ok, it's better to add comment above IFCVF_MAX_QUEUE_PAIRS.
>>
>>
>>> +??????? iowrite16(i, &hw->common_cfg->queue_select);
>>> +??????? notify_off = ioread16(&hw->common_cfg->queue_notify_off);
>>> +??????? hw->notify_addr[i] = (void *)((u8 *)hw->notify_base +
>>> +??????????????? notify_off * hw->notify_off_multiplier);
>>...
2009 May 07
1
[PATCH 3/3] virtio_pci: optional MSI-X support
...vring_interrupt(irq, info->vq) == IRQ_HANDLED)
- ret = IRQ_HANDLED;
+/* the config->free_vqs() implementation */
+static void vp_free_vectors(struct virtio_device *vdev) {
+ struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+ int i;
+
+ /* Disable the vector used for configuration */
+ iowrite16(VP_MSIX_NO_VECTOR,
+ vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
+
+ for (i = 0; i < vp_dev->msix_preset_vectors; ++i)
+ free_irq(vp_dev->msix_entries[i].vector, vp_dev);
+
+ if (!vp_dev->msix_preset_vectors)
+ free_irq(vp_dev->pci_dev->irq, vp_dev);
+
+ if (vp_dev->msi...
2009 May 07
1
[PATCH 3/3] virtio_pci: optional MSI-X support
...vring_interrupt(irq, info->vq) == IRQ_HANDLED)
- ret = IRQ_HANDLED;
+/* the config->free_vqs() implementation */
+static void vp_free_vectors(struct virtio_device *vdev) {
+ struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+ int i;
+
+ /* Disable the vector used for configuration */
+ iowrite16(VP_MSIX_NO_VECTOR,
+ vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
+
+ for (i = 0; i < vp_dev->msix_preset_vectors; ++i)
+ free_irq(vp_dev->msix_entries[i].vector, vp_dev);
+
+ if (!vp_dev->msix_preset_vectors)
+ free_irq(vp_dev->pci_dev->irq, vp_dev);
+
+ if (vp_dev->msi...
2010 Sep 29
1
[RFC PATCH] virtio: (Partially) enable suspend/resume support
...evice *vp_dev = pci_get_drvdata(pci_dev);
+ struct virtio_pci_vq_info *info;
+ unsigned long flags;
+
pci_restore_state(pci_dev);
pci_set_power_state(pci_dev, PCI_D0);
+
+ iowrite32(vp_dev->vdev.features[0], vp_dev->ioaddr+VIRTIO_PCI_GUEST_FEATURES);
+ if (vp_dev->msix_used_vectors)
+ iowrite16(vp_dev->msix_used_vectors,
+ vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
+
+ spin_lock_irqsave(&vp_dev->lock, flags);
+ list_for_each_entry(info, &vp_dev->virtqueues, node) {
+ /* Select the queue we're interested in */
+ iowrite16(info->queue_index,
+ vp_dev-&g...
2010 Sep 29
1
[RFC PATCH] virtio: (Partially) enable suspend/resume support
...evice *vp_dev = pci_get_drvdata(pci_dev);
+ struct virtio_pci_vq_info *info;
+ unsigned long flags;
+
pci_restore_state(pci_dev);
pci_set_power_state(pci_dev, PCI_D0);
+
+ iowrite32(vp_dev->vdev.features[0], vp_dev->ioaddr+VIRTIO_PCI_GUEST_FEATURES);
+ if (vp_dev->msix_used_vectors)
+ iowrite16(vp_dev->msix_used_vectors,
+ vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
+
+ spin_lock_irqsave(&vp_dev->lock, flags);
+ list_for_each_entry(info, &vp_dev->virtqueues, node) {
+ /* Select the queue we're interested in */
+ iowrite16(info->queue_index,
+ vp_dev-&g...
2013 May 29
1
[RFC 7/11] virtio_pci: new, capability-aware driver.
On Wed, May 29, 2013 at 10:47:52AM +0930, Rusty Russell wrote:
> "Michael S. Tsirkin" <mst at redhat.com> writes:
>
> > On Mon, Dec 12, 2011 at 01:49:13PM +0200, Michael S. Tsirkin wrote:
> >> On Mon, Dec 12, 2011 at 09:15:03AM +1030, Rusty Russell wrote:
> >> > On Sun, 11 Dec 2011 11:42:56 +0200, "Michael S. Tsirkin" <mst at
2015 Feb 10
1
[PATCH] virtio_pci: use 16-bit accessor for queue_enable.
...oread8(&cfg->queue_enable))
+ if (!num || ioread16(&cfg->queue_enable))
return ERR_PTR(-ENOENT);
if (num & (num - 1)) {
@@ -394,7 +394,7 @@ static int vp_modern_find_vqs(struct virtio_device *vdev, unsigned nvqs,
*/
list_for_each_entry(vq, &vdev->vqs, list) {
iowrite16(vq->index, &vp_dev->common->queue_select);
- iowrite8(1, &vp_dev->common->queue_enable);
+ iowrite16(1, &vp_dev->common->queue_enable);
}
return 0;
2015 Feb 10
1
[PATCH] virtio_pci: use 16-bit accessor for queue_enable.
...oread8(&cfg->queue_enable))
+ if (!num || ioread16(&cfg->queue_enable))
return ERR_PTR(-ENOENT);
if (num & (num - 1)) {
@@ -394,7 +394,7 @@ static int vp_modern_find_vqs(struct virtio_device *vdev, unsigned nvqs,
*/
list_for_each_entry(vq, &vdev->vqs, list) {
iowrite16(vq->index, &vp_dev->common->queue_select);
- iowrite8(1, &vp_dev->common->queue_enable);
+ iowrite16(1, &vp_dev->common->queue_enable);
}
return 0;
2012 Oct 16
6
[PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.
...c b/drivers/virtio/virtio_pci.c
index b59237c..e3ecc94 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -203,8 +203,7 @@ static void vp_notify(struct virtqueue *vq)
/* we write the queue's selector into the notification register to
* signal the other end */
- iowrite16(virtqueue_get_queue_index(vq),
- vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY);
+ iowrite16(vq->index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY);
}
/* Handle a configuration change: Tell driver if it wants to know. */
@@ -479,8 +478,7 @@ static void vp_del_vq(struct virtqueue *vq)
lis...
2012 Oct 16
6
[PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.
...c b/drivers/virtio/virtio_pci.c
index b59237c..e3ecc94 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -203,8 +203,7 @@ static void vp_notify(struct virtqueue *vq)
/* we write the queue's selector into the notification register to
* signal the other end */
- iowrite16(virtqueue_get_queue_index(vq),
- vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY);
+ iowrite16(vq->index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY);
}
/* Handle a configuration change: Tell driver if it wants to know. */
@@ -479,8 +478,7 @@ static void vp_del_vq(struct virtqueue *vq)
lis...
2009 May 14
1
[PATCHv6 4/4] virtio_pci: optional MSI-X support
...ci_dev->irq, vp_dev);
+ vp_dev->intx_enabled = 0;
+ }
+
+ for (i = 0; i < vp_dev->msix_used_vectors; ++i)
+ free_irq(vp_dev->msix_entries[i].vector, vp_dev);
+ vp_dev->msix_used_vectors = 0;
+
+ if (vp_dev->msix_enabled) {
+ /* Disable the vector used for configuration */
+ iowrite16(VIRTIO_MSI_NO_VECTOR,
+ vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
+ /* Flush the write out to device */
+ ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
+
+ vp_dev->msix_enabled = 0;
+ pci_disable_msix(vp_dev->pci_dev);
+ }
+}
+
+static int vp_enable_msix(struct pci_dev...