[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v1] arm/irq: Reorder check when the IRQ is already used by someone
On Fri, 2 Dec 2016, Oleksandr Tyshchenko wrote: > Call irq_get_domain for the IRQ we are interested in > only after making sure that it is the guest IRQ to avoid > ASSERT(test_bit(_IRQ_GUEST, &desc->status)) triggering. > > Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx> > Signed-off-by: Andrii Anisov <andrii_anisov@xxxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> Applied to xen-arm-next (queued for the next release). > xen/arch/arm/irq.c | 32 +++++++++++++++++++------------- > 1 file changed, 19 insertions(+), 13 deletions(-) > > diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c > index 06d4843..508028b 100644 > --- a/xen/arch/arm/irq.c > +++ b/xen/arch/arm/irq.c > @@ -477,26 +477,32 @@ int route_irq_to_guest(struct domain *d, unsigned int > virq, > */ > if ( desc->action != NULL ) > { > + if ( test_bit(_IRQ_GUEST, &desc->status) ) > { > + struct domain *ad = irq_get_domain(desc); > + > + if ( d == ad ) > + { > + if ( irq_get_guest_info(desc)->virq != virq ) > + { > + printk(XENLOG_G_ERR > + "d%u: IRQ %u is already assigned to vIRQ %u\n", > + d->domain_id, irq, > irq_get_guest_info(desc)->virq); > + retval = -EBUSY; > + } > + } > + else > { > + printk(XENLOG_G_ERR "IRQ %u is already used by domain %u\n", > + irq, ad->domain_id); > retval = -EBUSY; > } > } > else > + { > printk(XENLOG_G_ERR "IRQ %u is already used by Xen\n", irq); > - retval = -EBUSY; > + retval = -EBUSY; > + } > goto out; > } > > -- > 2.7.4 > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |