From: Roger Pau Monné Date: Tue, 20 Jun 2017 12:49:11 +0000 (+0200) Subject: x86/dpci: make sure hvm_do_IRQ_dpci is only called for HVM guests X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1965 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9b62c90308982a044e671361f1e6410f49c00aca;p=xen.git x86/dpci: make sure hvm_do_IRQ_dpci is only called for HVM guests While there add an ASSERT to hvm_do_IRQ_dpci. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 466e60b779..523d089006 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1180,7 +1180,7 @@ static void __do_IRQ_guest(int irq) if ( (action->ack_type != ACKTYPE_NONE) && !test_and_set_bool(pirq->masked) ) action->in_flight++; - if ( !hvm_do_IRQ_dpci(d, pirq) ) + if ( !is_hvm_domain(d) || !hvm_do_IRQ_dpci(d, pirq) ) send_guest_pirq(d, pirq); } diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index e5a43e508f..7158afea88 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -696,6 +696,8 @@ int hvm_do_IRQ_dpci(struct domain *d, struct pirq *pirq) struct hvm_irq_dpci *dpci = domain_get_irq_dpci(d); struct hvm_pirq_dpci *pirq_dpci = pirq_dpci(pirq); + ASSERT(is_hvm_domain(d)); + if ( !iommu_enabled || !dpci || !pirq_dpci || !(pirq_dpci->flags & HVM_IRQ_DPCI_MAPPED) ) return 0;