search for: vp_free_vectors

Displaying 20 results from an estimated 77 matches for "vp_free_vectors".

2013 Jun 20
3
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
From: Andrew Vagin <avagin at openvz.org> vp_dev->msix_vectors should be initialized before allocating msix_affinity_masks, otherwise vp_free_vectors will not free these objects. unreferenced object 0xffff88010f969d88 (size 512): comm "systemd-udevd", pid 158, jiffies 4294673645 (age 80.545s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00...
2013 Jun 20
3
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
From: Andrew Vagin <avagin at openvz.org> vp_dev->msix_vectors should be initialized before allocating msix_affinity_masks, otherwise vp_free_vectors will not free these objects. unreferenced object 0xffff88010f969d88 (size 512): comm "systemd-udevd", pid 158, jiffies 4294673645 (age 80.545s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00...
2014 Sep 15
1
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...d be handled correctly. > > This might happen if host runs out of resources when trying > to map VQs to vectors, so doesn't have to be a bug. > > But I don't see what the problem is: > msix_used_vectors reflects the number of used vectors > and msix_enabled is set, thus vp_free_vectors > will free all IRQs and then disable MSIX. > > Where is the inconsistency you speak about? I missed the fact that vp_free_vectors() conditionally sets msix_enabled=0. It seems a bit cludgy especially since it is called both before and after setting msix_enabled=1. I ran into a number o...
2014 Sep 15
1
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...d be handled correctly. > > This might happen if host runs out of resources when trying > to map VQs to vectors, so doesn't have to be a bug. > > But I don't see what the problem is: > msix_used_vectors reflects the number of used vectors > and msix_enabled is set, thus vp_free_vectors > will free all IRQs and then disable MSIX. > > Where is the inconsistency you speak about? I missed the fact that vp_free_vectors() conditionally sets msix_enabled=0. It seems a bit cludgy especially since it is called both before and after setting msix_enabled=1. I ran into a number o...
2013 Jun 19
2
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
vp_dev->msix_vectors should be initialized before allocating msix_affinity_masks, otherwise vp_free_vectors will not free these objects. unreferenced object 0xffff88010f969d88 (size 512): comm "systemd-udevd", pid 158, jiffies 4294673645 (age 80.545s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00...
2013 Jun 19
2
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
vp_dev->msix_vectors should be initialized before allocating msix_affinity_masks, otherwise vp_free_vectors will not free these objects. unreferenced object 0xffff88010f969d88 (size 512): comm "systemd-udevd", pid 158, jiffies 4294673645 (age 80.545s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00...
2014 Sep 15
3
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...vp_dev->msix_names[v], vp_dev); if (err) - goto error; + goto error_msix_used; ++vp_dev->msix_used_vectors; } return 0; +error_msix_used: + v = --vp_dev->msix_used_vectors; + free_irq(vp_dev->msix_entries[v].vector, vp_dev); error: + vp_dev->msix_enabled = 0; vp_free_vectors(vdev); return err; } -- 1.7.9.5
2014 Sep 15
3
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...vp_dev->msix_names[v], vp_dev); if (err) - goto error; + goto error_msix_used; ++vp_dev->msix_used_vectors; } return 0; +error_msix_used: + v = --vp_dev->msix_used_vectors; + free_irq(vp_dev->msix_entries[v].vector, vp_dev); error: + vp_dev->msix_enabled = 0; vp_free_vectors(vdev); return err; } -- 1.7.9.5
2013 Jun 19
0
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
On Wed, Jun 19, 2013 at 07:59:48PM +0400, Andrew Vagin wrote: > vp_dev->msix_vectors should be initialized before allocating > msix_affinity_masks, otherwise vp_free_vectors will not free these > objects. > > unreferenced object 0xffff88010f969d88 (size 512): > comm "systemd-udevd", pid 158, jiffies 4294673645 (age 80.545s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 0...
2019 Apr 27
0
[PATCH AUTOSEL 5.0 48/79] virtio_pci: fix a NULL pointer reference in vp_del_vqs
From: Longpeng <longpeng2 at huawei.com> [ Upstream commit 6a8aae68c87349dbbcd46eac380bc43cdb98a13b ] If the msix_affinity_masks is alloced failed, then we'll try to free some resources in vp_free_vectors() that may access it directly. We met the following stack in our production: [ 29.296767] BUG: unable to handle kernel NULL pointer dereference at (null) [ 29.311151] IP: [<ffffffffc04fe35a>] vp_free_vectors+0x6a/0x150 [virtio_pci] [ 29.324787] PGD 0 [ 29.333224] Oops: 0000 [#1] SMP...
2019 Apr 27
0
[PATCH AUTOSEL 4.19 37/53] virtio_pci: fix a NULL pointer reference in vp_del_vqs
From: Longpeng <longpeng2 at huawei.com> [ Upstream commit 6a8aae68c87349dbbcd46eac380bc43cdb98a13b ] If the msix_affinity_masks is alloced failed, then we'll try to free some resources in vp_free_vectors() that may access it directly. We met the following stack in our production: [ 29.296767] BUG: unable to handle kernel NULL pointer dereference at (null) [ 29.311151] IP: [<ffffffffc04fe35a>] vp_free_vectors+0x6a/0x150 [virtio_pci] [ 29.324787] PGD 0 [ 29.333224] Oops: 0000 [#1] SMP...
2019 Apr 27
0
[PATCH AUTOSEL 4.14 20/32] virtio_pci: fix a NULL pointer reference in vp_del_vqs
From: Longpeng <longpeng2 at huawei.com> [ Upstream commit 6a8aae68c87349dbbcd46eac380bc43cdb98a13b ] If the msix_affinity_masks is alloced failed, then we'll try to free some resources in vp_free_vectors() that may access it directly. We met the following stack in our production: [ 29.296767] BUG: unable to handle kernel NULL pointer dereference at (null) [ 29.311151] IP: [<ffffffffc04fe35a>] vp_free_vectors+0x6a/0x150 [virtio_pci] [ 29.324787] PGD 0 [ 29.333224] Oops: 0000 [#1] SMP...
2009 Jul 21
2
[PATCH 1/2] virtio: fix memory leak on device removal
..._del_vq(struct virtqueue *vq) /* the config->del_vqs() implementation */ static void vp_del_vqs(struct virtio_device *vdev) { + struct virtio_pci_device *vp_dev = to_vp_device(vdev); struct virtqueue *vq, *n; list_for_each_entry_safe(vq, n, &vdev->vqs, list) vp_del_vq(vq); vp_free_vectors(vdev); + kfree(vp_dev->msix_names); + kfree(vp_dev->msix_entries); } /* the config->find_vqs() implementation */ -- 1.6.2.5
2009 Jul 21
2
[PATCH 1/2] virtio: fix memory leak on device removal
..._del_vq(struct virtqueue *vq) /* the config->del_vqs() implementation */ static void vp_del_vqs(struct virtio_device *vdev) { + struct virtio_pci_device *vp_dev = to_vp_device(vdev); struct virtqueue *vq, *n; list_for_each_entry_safe(vq, n, &vdev->vqs, list) vp_del_vq(vq); vp_free_vectors(vdev); + kfree(vp_dev->msix_names); + kfree(vp_dev->msix_entries); } /* the config->find_vqs() implementation */ -- 1.6.2.5
2013 Jun 21
0
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
On 06/20/2013 01:36 PM, Andrey Vagin wrote: > From: Andrew Vagin <avagin at openvz.org> > > vp_dev->msix_vectors should be initialized before allocating > msix_affinity_masks, otherwise vp_free_vectors will not free these > objects. > > unreferenced object 0xffff88010f969d88 (size 512): > comm "systemd-udevd", pid 158, jiffies 4294673645 (age 80.545s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 00...
2014 Apr 19
1
RFC: sharing config interrupt between virtio devices for saving MSI
...ts to know. */ if (isr & VIRTIO_PCI_ISR_CONFIG) - vp_config_changed(irq, opaque); - - return vp_vring_interrupt(irq, opaque); + return vp_config_changed(irq, opaque); + else + return vp_vring_interrupt(irq, opaque); } static void vp_free_vectors(struct virtio_device *vdev) -- Amos. -------------- next part -------------- diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 101db3f..5ba348d 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -302,6 +302,8 @@ static void vp_free_vectors(...
2014 Apr 19
1
RFC: sharing config interrupt between virtio devices for saving MSI
...ts to know. */ if (isr & VIRTIO_PCI_ISR_CONFIG) - vp_config_changed(irq, opaque); - - return vp_vring_interrupt(irq, opaque); + return vp_config_changed(irq, opaque); + else + return vp_vring_interrupt(irq, opaque); } static void vp_free_vectors(struct virtio_device *vdev) -- Amos. -------------- next part -------------- diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 101db3f..5ba348d 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -302,6 +302,8 @@ static void vp_free_vectors(...
2009 May 07
1
[PATCH 3/3] virtio_pci: optional MSI-X support
...return vp_vring_interrupt(irq, opaque); } - spin_lock_irqsave(&vp_dev->lock, flags); - list_for_each_entry(info, &vp_dev->virtqueues, node) { - if (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_...
2009 May 07
1
[PATCH 3/3] virtio_pci: optional MSI-X support
...return vp_vring_interrupt(irq, opaque); } - spin_lock_irqsave(&vp_dev->lock, flags); - list_for_each_entry(info, &vp_dev->virtqueues, node) { - if (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_...
2009 Jul 23
0
qemu-kvm missing some msix capability check
...> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c > index 9dcc368..567c972 100644 > --- a/drivers/virtio/virtio_pci.c > +++ b/drivers/virtio/virtio_pci.c > @@ -273,26 +273,35 @@ static void vp_free_vectors(struct virtio_device *vdev) > } > > static int vp_enable_msix(struct pci_dev *dev, struct msix_entry *entries, > - int *options, int noptions) > + int nvectors) > { > - int i; > - for (i = 0; i < noptions; ++i) > - if (!pci_enable_msix(dev, entries, optio...