diff mbox

[v5,1/3] x86/dpci: make sure hvm_do_IRQ_dpci is only called for HVM guests

Message ID 20170620091539.59051-2-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné June 20, 2017, 9:15 a.m. UTC
While there add an ASSERT to hvm_do_IRQ_dpci.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes since v4:
 - New in this version.
---
 xen/arch/x86/irq.c           | 2 +-
 xen/drivers/passthrough/io.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Jan Beulich June 20, 2017, 11:45 a.m. UTC | #1
>>> On 20.06.17 at 11:15, <roger.pau@citrix.com> wrote:
> While there add an ASSERT to hvm_do_IRQ_dpci.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox

Patch

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7f6c2fe9fb..3cfe848ecc 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;