* [PATCH] qemu-kvm: fix error handling in msix vector add
@ 2009-07-23 13:34 Michael S. Tsirkin
2009-07-25 15:30 ` Marcelo Tosatti
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2009-07-23 13:34 UTC (permalink / raw)
To: avi, kvm, amit.shah
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 <mst@redhat.com>
---
hw/msix.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/msix.c b/hw/msix.c
index 5f77dc9..47cbdc7 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -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;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] qemu-kvm: fix error handling in msix vector add
2009-07-23 13:34 [PATCH] qemu-kvm: fix error handling in msix vector add Michael S. Tsirkin
@ 2009-07-25 15:30 ` Marcelo Tosatti
2009-07-28 13:22 ` Michael S. Tsirkin
2009-09-07 7:05 ` Mark McLoughlin
0 siblings, 2 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2009-07-25 15:30 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: avi, kvm, amit.shah
On Thu, Jul 23, 2009 at 04:34:13PM +0300, Michael S. Tsirkin wrote:
> 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 <mst@redhat.com>
Applied, thanks.
> ---
> hw/msix.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/hw/msix.c b/hw/msix.c
> index 5f77dc9..47cbdc7 100644
> --- a/hw/msix.c
> +++ b/hw/msix.c
> @@ -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;
> }
>
> --
> 1.6.2.5
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qemu-kvm: fix error handling in msix vector add
2009-07-25 15:30 ` Marcelo Tosatti
@ 2009-07-28 13:22 ` Michael S. Tsirkin
2009-07-28 13:31 ` Marcelo Tosatti
2009-09-07 7:05 ` Mark McLoughlin
1 sibling, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2009-07-28 13:22 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: avi, kvm, amit.shah
On Sat, Jul 25, 2009 at 12:30:52PM -0300, Marcelo Tosatti wrote:
> On Thu, Jul 23, 2009 at 04:34:13PM +0300, Michael S. Tsirkin wrote:
> > 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 <mst@redhat.com>
>
> Applied, thanks.
Should I see this in qemu-kvm master?
It does not seem to be there.
> > ---
> > hw/msix.c | 10 ++++++++--
> > 1 files changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/hw/msix.c b/hw/msix.c
> > index 5f77dc9..47cbdc7 100644
> > --- a/hw/msix.c
> > +++ b/hw/msix.c
> > @@ -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;
> > }
> >
> > --
> > 1.6.2.5
> > --
> > To unsubscribe from this list: send the line "unsubscribe kvm" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qemu-kvm: fix error handling in msix vector add
2009-07-28 13:22 ` Michael S. Tsirkin
@ 2009-07-28 13:31 ` Marcelo Tosatti
0 siblings, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2009-07-28 13:31 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: avi, kvm, amit.shah
On Tue, Jul 28, 2009 at 04:22:36PM +0300, Michael S. Tsirkin wrote:
> On Sat, Jul 25, 2009 at 12:30:52PM -0300, Marcelo Tosatti wrote:
> > On Thu, Jul 23, 2009 at 04:34:13PM +0300, Michael S. Tsirkin wrote:
> > > 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 <mst@redhat.com>
> >
> > 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.
>
> > > ---
> > > hw/msix.c | 10 ++++++++--
> > > 1 files changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/hw/msix.c b/hw/msix.c
> > > index 5f77dc9..47cbdc7 100644
> > > --- a/hw/msix.c
> > > +++ b/hw/msix.c
> > > @@ -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;
> > > }
> > >
> > > --
> > > 1.6.2.5
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe kvm" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qemu-kvm: fix error handling in msix vector add
2009-07-25 15:30 ` Marcelo Tosatti
2009-07-28 13:22 ` Michael S. Tsirkin
@ 2009-09-07 7:05 ` Mark McLoughlin
2009-09-09 12:08 ` Avi Kivity
1 sibling, 1 reply; 6+ messages in thread
From: Mark McLoughlin @ 2009-09-07 7:05 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: Michael S. Tsirkin, avi, kvm, amit.shah
On Sat, 2009-07-25 at 12:30 -0300, Marcelo Tosatti wrote:
> On Thu, Jul 23, 2009 at 04:34:13PM +0300, Michael S. Tsirkin wrote:
> > 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 <mst@redhat.com>
>
> Applied, thanks.
We need this on stable-0.11 too. See:
https://bugzilla.redhat.com/519787
Thanks,
Mark.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qemu-kvm: fix error handling in msix vector add
2009-09-07 7:05 ` Mark McLoughlin
@ 2009-09-09 12:08 ` Avi Kivity
0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2009-09-09 12:08 UTC (permalink / raw)
To: Mark McLoughlin; +Cc: Marcelo Tosatti, Michael S. Tsirkin, kvm, amit.shah
On 09/07/2009 10:05 AM, Mark McLoughlin wrote:
> On Sat, 2009-07-25 at 12:30 -0300, Marcelo Tosatti wrote:
>
>> On Thu, Jul 23, 2009 at 04:34:13PM +0300, Michael S. Tsirkin wrote:
>>
>>> 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<mst@redhat.com>
>>>
>> Applied, thanks.
>>
> We need this on stable-0.11 too. See:
>
> https://bugzilla.redhat.com/519787
>
>
Added there, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-09-09 12:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 13:34 [PATCH] qemu-kvm: fix error handling in msix vector add Michael S. Tsirkin
2009-07-25 15:30 ` Marcelo Tosatti
2009-07-28 13:22 ` Michael S. Tsirkin
2009-07-28 13:31 ` Marcelo Tosatti
2009-09-07 7:05 ` Mark McLoughlin
2009-09-09 12:08 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).