search for: isr_mem

Displaying 10 results from an estimated 10 matches for "isr_mem".

2014 Oct 25
0
[RFC PATCH 1/2] Add a new register offset let interrupt reason available
...o_mmio.c b/drivers/virtio/virtio_mmio.c index ef9a165..28ddb55 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -122,6 +122,8 @@ struct virtio_mmio_device { /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + uint8_t *isr_mem; }; struct virtio_mmio_vq_info { @@ -443,6 +445,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) struct virtio_mmio_device *vm_dev; struct resource *mem; unsigned long magic; + int err; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) @@ -481,6 +484,15...
2014 Oct 25
8
[RFC PATCH 0/2] virtio-mmio: add irqfd support for vhost-net based on virtio-mmio
From: Li Liu <john.liuli at huawei.com> This set of patches try to implemet irqfd support of vhost-net based on virtio-mmio. I had posted a mail to talking about the status of vhost-net on kvm-arm refer to http://www.spinics.net/lists/kvm-arm/msg10804.html. Some dependent patches are listed in the mail too. Basically the vhost-net brings great performance improvements, almost 50%+.
2014 Oct 25
8
[RFC PATCH 0/2] virtio-mmio: add irqfd support for vhost-net based on virtio-mmio
From: Li Liu <john.liuli at huawei.com> This set of patches try to implemet irqfd support of vhost-net based on virtio-mmio. I had posted a mail to talking about the status of vhost-net on kvm-arm refer to http://www.spinics.net/lists/kvm-arm/msg10804.html. Some dependent patches are listed in the mail too. Basically the vhost-net brings great performance improvements, almost 50%+.
2014 Oct 26
0
[RFC PATCH 1/2] Add a new register offset let interrupt reason available
...index ef9a165..28ddb55 100644 > --- a/drivers/virtio/virtio_mmio.c > +++ b/drivers/virtio/virtio_mmio.c > @@ -122,6 +122,8 @@ struct virtio_mmio_device { > /* a list of queues so we can dispatch IRQs */ > spinlock_t lock; > struct list_head virtqueues; > + > + uint8_t *isr_mem; > }; > > struct virtio_mmio_vq_info { > @@ -443,6 +445,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) > struct virtio_mmio_device *vm_dev; > struct resource *mem; > unsigned long magic; > + int err; > > mem = platform_get_resource(pdev,...
2014 Oct 25
1
[RFC PATCH 2/2] Assign a new irq handler while irqfd enabled
...*/ +static irqreturn_t vm_interrupt_irqfd(int irq, void *opaque) +{ + struct virtio_mmio_device *vm_dev = opaque; + struct virtio_mmio_vq_info *info; + unsigned long status; + unsigned long flags; + irqreturn_t ret = IRQ_NONE; + /* Read the interrupt reason and reset it */ + status = *vm_dev->isr_mem; + *vm_dev->isr_mem = 0x0; + + if (unlikely(status & VIRTIO_MMIO_INT_CONFIG)) { + virtio_config_changed(&vm_dev->vdev); + ret = IRQ_HANDLED; + } + + spin_lock_irqsave(&vm_dev->lock, flags); + list_for_each_entry(info, &vm_dev->virtqueues, node) + ret |= vring_interrup...
2014 Oct 25
1
[RFC PATCH 2/2] Assign a new irq handler while irqfd enabled
...*/ +static irqreturn_t vm_interrupt_irqfd(int irq, void *opaque) +{ + struct virtio_mmio_device *vm_dev = opaque; + struct virtio_mmio_vq_info *info; + unsigned long status; + unsigned long flags; + irqreturn_t ret = IRQ_NONE; + /* Read the interrupt reason and reset it */ + status = *vm_dev->isr_mem; + *vm_dev->isr_mem = 0x0; + + if (unlikely(status & VIRTIO_MMIO_INT_CONFIG)) { + virtio_config_changed(&vm_dev->vdev); + ret = IRQ_HANDLED; + } + + spin_lock_irqsave(&vm_dev->lock, flags); + list_for_each_entry(info, &vm_dev->virtqueues, node) + ret |= vring_interrup...
2014 Oct 27
1
[RFC PATCH 2/2] Assign a new irq handler while irqfd enabled
...;> + struct virtio_mmio_device *vm_dev = opaque; >> + struct virtio_mmio_vq_info *info; >> + unsigned long status; >> + unsigned long flags; >> + irqreturn_t ret = IRQ_NONE; >> >> + /* Read the interrupt reason and reset it */ >> + status = *vm_dev->isr_mem; >> + *vm_dev->isr_mem = 0x0; > > you are reading and modifying shared memory > without atomics and any memory barriers. > Why is this safe? > good catch, a stupid mistake. >> + >> + if (unlikely(status & VIRTIO_MMIO_INT_CONFIG)) { >> + virtio_conf...
2014 Oct 27
1
[RFC PATCH 2/2] Assign a new irq handler while irqfd enabled
...;> + struct virtio_mmio_device *vm_dev = opaque; >> + struct virtio_mmio_vq_info *info; >> + unsigned long status; >> + unsigned long flags; >> + irqreturn_t ret = IRQ_NONE; >> >> + /* Read the interrupt reason and reset it */ >> + status = *vm_dev->isr_mem; >> + *vm_dev->isr_mem = 0x0; > > you are reading and modifying shared memory > without atomics and any memory barriers. > Why is this safe? > good catch, a stupid mistake. >> + >> + if (unlikely(status & VIRTIO_MMIO_INT_CONFIG)) { >> + virtio_conf...
2014 Oct 26
0
[RFC PATCH 2/2] Assign a new irq handler while irqfd enabled
...t irq, void *opaque) > +{ > + struct virtio_mmio_device *vm_dev = opaque; > + struct virtio_mmio_vq_info *info; > + unsigned long status; > + unsigned long flags; > + irqreturn_t ret = IRQ_NONE; > > + /* Read the interrupt reason and reset it */ > + status = *vm_dev->isr_mem; > + *vm_dev->isr_mem = 0x0; you are reading and modifying shared memory without atomics and any memory barriers. Why is this safe? > + > + if (unlikely(status & VIRTIO_MMIO_INT_CONFIG)) { > + virtio_config_changed(&vm_dev->vdev); > + ret = IRQ_HANDLED; > + } &gt...
2014 Oct 27
0
[RFC PATCH 2/2] Assign a new irq handler while irqfd enabled
...vm_dev = opaque; > >> + struct virtio_mmio_vq_info *info; > >> + unsigned long status; > >> + unsigned long flags; > >> + irqreturn_t ret = IRQ_NONE; > >> > >> + /* Read the interrupt reason and reset it */ > >> + status = *vm_dev->isr_mem; > >> + *vm_dev->isr_mem = 0x0; > > > > you are reading and modifying shared memory > > without atomics and any memory barriers. > > Why is this safe? > > > > good catch, a stupid mistake. > > >> + > >> + if (unlikely(status &...