]> git.pld-linux.org Git - packages/xen.git/commitdiff
- don't loose level interrupts on HVM guests
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 29 Feb 2012 21:00:26 +0000 (21:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    xen-4.1-testing.23190.patch -> 1.1

xen-4.1-testing.23190.patch [new file with mode: 0644]

diff --git a/xen-4.1-testing.23190.patch b/xen-4.1-testing.23190.patch
new file mode 100644 (file)
index 0000000..2c51bc8
--- /dev/null
@@ -0,0 +1,64 @@
+
+# HG changeset patch
+# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+# Date 1321623485 0
+# Node ID 5a00ccfc63915650b8e1a262c2cad8e8d8670612
+# Parent  e73ada19a69daf821aa7d80323f1bd76239b9bae
+x86: re-inject emulated level pirqs in PV on HVM guests if still asserted
+
+PV on HVM guests can loose level interrupts coming from emulated
+devices if they have been remapped onto event channels.  The reason is
+that we are missing the code to inject a pirq again in the guest when
+the guest EOIs it, if it corresponds to an emulated level interrupt
+and the interrupt is still asserted.
+
+Fix this issue and also return error when the guest tries to get the
+irq_status of a non-existing pirq.
+
+
+Changes in this backport:
+ - move the spinlock afterward to cover the new code only.
+
+Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+Committed-by: Keir Fraser <keir@xen.org>
+xen-unstable changeset:   24007:0526644ad2a6
+xen-unstable date:        Thu Oct 27 16:07:18 2011 +0100
+
+diff -r e73ada19a69d -r 5a00ccfc6391 xen/arch/x86/physdev.c
+--- a/xen/arch/x86/physdev.c   Thu Nov 17 09:13:25 2011 +0000
++++ b/xen/arch/x86/physdev.c   Fri Nov 18 13:38:05 2011 +0000
+@@ -268,6 +268,20 @@
+             ret = pirq_guest_eoi(v->domain, eoi.irq);
+         else
+             ret = 0;
++        spin_lock(&v->domain->event_lock);
++        if ( is_hvm_domain(v->domain) &&
++                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
++        {
++            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
++            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
++
++            /* if this is a level irq and count > 0, send another
++             * notification */ 
++            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
++                    && hvm_irq->gsi_assert_count[gsi] )
++                send_guest_pirq(v->domain, eoi.irq);
++        }
++        spin_unlock(&v->domain->event_lock);
+         break;
+     }
+@@ -323,9 +337,10 @@
+             break;
+         irq_status_query.flags = 0;
+         if ( is_hvm_domain(v->domain) &&
+-             domain_pirq_to_irq(v->domain, irq) <= 0 )
++                domain_pirq_to_irq(v->domain, irq) <= 0 &&
++                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
+         {
+-            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
++            ret = -EINVAL;
+             break;
+         }
+
This page took 0.109515 seconds and 4 git commands to generate.