[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v5 for-xen-4.5 3/3] dpci: In hvm_dirq_assist stop using pt_pirq_iterate
As we are now called from dpci_softirq with the outstanding 'struct hvm_pirq_dpci' there is no need to call pt_pirq_iterate which will iterate over all of the PIRQs and call us with every one that is mapped. And then _hvm_dirq_assist figuring out which one to execute. We know which one to execute as 'schedule_dpci_for' is called for the specific 'struct hvm_pirq_dpci' that has an outstanding interrupt. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> --- xen/drivers/passthrough/io.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 13433a5..62fdca9 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -621,9 +621,13 @@ void hvm_dpci_msi_eoi(struct domain *d, int vector) spin_unlock(&d->event_lock); } -static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci, - void *arg) +static int hvm_dirq_assist(struct hvm_pirq_dpci *pirq_dpci) { + struct domain *d = pirq_dpci->dom; + + ASSERT(d && d->arch.hvm_domain.irq.dpci); + + spin_lock(&d->event_lock); if ( test_and_clear_bool(pirq_dpci->masked) ) { struct pirq *pirq = dpci_pirq(pirq_dpci); @@ -634,13 +638,13 @@ static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci, send_guest_pirq(d, pirq); if ( pirq_dpci->flags & HVM_IRQ_DPCI_GUEST_MSI ) - return 0; + goto out; } if ( pirq_dpci->flags & HVM_IRQ_DPCI_GUEST_MSI ) { vmsi_deliver_pirq(d, pirq_dpci); - return 0; + goto out; } list_for_each_entry ( digl, &pirq_dpci->digl_list, list ) @@ -653,7 +657,7 @@ static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci, { /* for translated MSI to INTx interrupt, eoi as early as possible */ __msi_pirq_eoi(pirq_dpci); - return 0; + goto out; } /* @@ -666,21 +670,12 @@ static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci, ASSERT(pt_irq_need_timer(pirq_dpci->flags)); set_timer(&pirq_dpci->timer, NOW() + PT_IRQ_TIME_OUT); } + out: + spin_unlock(&d->event_lock); return 0; } -static void hvm_dirq_assist(struct hvm_pirq_dpci *pirq_dpci) -{ - struct domain *d = pirq_dpci->dom; - - ASSERT(d && d->arch.hvm_domain.irq.dpci); - - spin_lock(&d->event_lock); - pt_pirq_iterate(d, _hvm_dirq_assist, NULL); - spin_unlock(&d->event_lock); -} - static void __hvm_dpci_eoi(struct domain *d, const struct hvm_girq_dpci_mapping *girq, const union vioapic_redir_entry *ent) -- 1.9.3 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |