qemu-kvm: fix error handling in msix vector add
PATCH 1/1 qemu-kvm: fix error handling in msix vector add
When adding a vector fails, the used counter should not be incremented, otherwise on vector change we will try to update the routing entry.
--- hw/msix.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
hw/msix.c +8 -2
@@ -502,13 +502,19 @@ void msix_reset(PCIDevice *dev)/* Mark vector as used. */ int msix_vector_use (PCIDevice *dev,unsigned vector) { +int ret;if (vector >= dev->msix_entries_nr)return -EINVAL ; -if (dev->msix_entry_used[vector]++) +if (dev->msix_entry_used[vector]) {return 0 ; + }if (kvm_enabled () &&qemu_kvm_irqchip_in_kernel ()) { -return kvm_msix_add (dev, vector); + ret =kvm_msix_add (dev, vector); +if (ret) { +return ret; + } } + ++dev->msix_entry_used[vector];return 0 ; }
Signature · 1 line
1.6.2.5
Marcelo Tosatti
AppliedQuoted 5 lines · Michael S. Tsirkin
When adding a vector fails, the used counter should not be incremented, otherwise on vector change we will try to update the routing entry.
Signed-off-by Michael S. Tsirkin <[email protected]>
Applied, thanks.
Quoted 36 lines
--- hw/msix.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)hw/msix.c +8
-2@@ -502,13 +502,19 @@ void msix_reset(PCIDevice *dev)/* Mark vector as used. */ int msix_vector_use (PCIDevice *dev,unsigned vector) { +int ret;if (vector >= dev->msix_entries_nr)return -EINVAL ; -if (dev->msix_entry_used[vector]++) +if (dev->msix_entry_used[vector]) {return 0 ; + }if (kvm_enabled () &&qemu_kvm_irqchip_in_kernel ()) { -return kvm_msix_add (dev, vector); + ret =kvm_msix_add (dev, vector); +if (ret) { +return ret; + } } + ++dev->msix_entry_used[vector];return 0 ; }Signature · 5 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Marcelo Tosatti
Quoted 5 lines · Michael S. Tsirkin
When adding a vector fails, the used counter should not be incremented, otherwise on vector change we will try to update the routing entry.
Signed-off-by Michael S. Tsirkin <[email protected]>Applied, thanks.
Should I see this in qemu-kvm master?
It does not seem to be there.
Quoted 36 lines
Quoted 36 lines
--- hw/msix.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)hw/msix.c +8
-2@@ -502,13 +502,19 @@ void msix_reset(PCIDevice *dev)/* Mark vector as used. */ int msix_vector_use (PCIDevice *dev,unsigned vector) { +int ret;if (vector >= dev->msix_entries_nr)return -EINVAL ; -if (dev->msix_entry_used[vector]++) +if (dev->msix_entry_used[vector]) {return 0 ; + }if (kvm_enabled () &&qemu_kvm_irqchip_in_kernel ()) { -return kvm_msix_add (dev, vector); + ret =kvm_msix_add (dev, vector); +if (ret) { +return ret; + } } + ++dev->msix_entry_used[vector];return 0 ; }Signature · 5 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Michael S. Tsirkin
Quoted 5 lines · Marcelo Tosatti
Quoted 4 lines · Michael S. Tsirkin
When adding a vector fails, the used counter should not be incremented, otherwise on vector change we will try to update the routing entry.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Michael S. Tsirkin <[email protected]>Applied, thanks.
Should I see this in qemu-kvm master?
It does not seem to be there.
Hum, forgot to push. Will handle it. Sorry for the mess.
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
--- hw/msix.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)hw/msix.c +8
-2@@ -502,13 +502,19 @@ void msix_reset(PCIDevice *dev)/* Mark vector as used. */ int msix_vector_use (PCIDevice *dev,unsigned vector) { +int ret;if (vector >= dev->msix_entries_nr)return -EINVAL ; -if (dev->msix_entry_used[vector]++) +if (dev->msix_entry_used[vector]) {return 0 ; + }if (kvm_enabled () &&qemu_kvm_irqchip_in_kernel ()) { -return kvm_msix_add (dev, vector); + ret =kvm_msix_add (dev, vector); +if (ret) { +return ret; + } } + ++dev->msix_entry_used[vector];return 0 ; }Signature · 5 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Marcelo Tosatti
Quoted 5 lines · Michael S. Tsirkin
When adding a vector fails, the used counter should not be incremented, otherwise on vector change we will try to update the routing entry.
Signed-off-by Michael S. Tsirkin <[email protected]>Applied, thanks.
We need this on stable-0.11 too. See:
https://bugzilla.redhat.com/519787
Thanks,
Mark.
Quoted 8 lines · Mark McLoughlin
Quoted 6 lines · Marcelo Tosatti
Quoted 4 lines · Michael S. Tsirkin
When adding a vector fails, the used counter should not be incremented, otherwise on vector change we will try to update the routing entry.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Michael S. Tsirkin<[email protected]>Applied, thanks.
We need this on stable-0.11 too. See:
https://bugzilla.redhat.com/519787
Added there, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function