WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xen: kill hvm_timer only when is initialized

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen: kill hvm_timer only when is initialized
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 1 Jul 2010 17:02:56 +0100
Delivery-date: Thu, 01 Jul 2010 09:03:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
Don't try to kill the per-irq hvm_timer if it wasn't initialized
before (doing so causes an ASSERT to fail).

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff -r 2f8d5503d614 xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c      Thu Jul 01 16:59:37 2010 +0100
+++ b/xen/drivers/passthrough/io.c      Thu Jul 01 17:00:38 2010 +0100
@@ -28,7 +28,7 @@
 
 static void hvm_dirq_assist(unsigned long _d);
 
-static int pt_irq_need_timer(uint32_t flags)
+int pt_irq_need_timer(uint32_t flags)
 {
     return !(flags & (HVM_IRQ_DPCI_GUEST_MSI | HVM_IRQ_DPCI_TRANSLATE));
 }
diff -r 2f8d5503d614 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c     Thu Jul 01 16:59:37 2010 +0100
+++ b/xen/drivers/passthrough/pci.c     Thu Jul 01 17:00:38 2010 +0100
@@ -260,7 +260,8 @@
               i = find_next_bit(hvm_irq_dpci->mapping, d->nr_pirqs, i + 1) )
         {
             pirq_guest_unbind(d, i);
-            kill_timer(&hvm_irq_dpci->hvm_timer[domain_pirq_to_irq(d, i)]);
+            if ( pt_irq_need_timer(hvm_irq_dpci->mirq[i].flags) )
+                kill_timer(&hvm_irq_dpci->hvm_timer[domain_pirq_to_irq(d, i)]);
 
             list_for_each_safe ( digl_list, tmp,
                                  &hvm_irq_dpci->mirq[i].digl_list )
diff -r 2f8d5503d614 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h   Thu Jul 01 16:59:37 2010 +0100
+++ b/xen/include/xen/iommu.h   Thu Jul 01 17:00:38 2010 +0100
@@ -81,6 +81,7 @@
 void iommu_domain_teardown(struct domain *d);
 int hvm_do_IRQ_dpci(struct domain *d, unsigned int irq);
 int dpci_ioport_intercept(ioreq_t *p);
+int pt_irq_need_timer(uint32_t flags);
 int pt_irq_create_bind_vtd(struct domain *d,
                            xen_domctl_bind_pt_irq_t *pt_irq_bind);
 int pt_irq_destroy_bind_vtd(struct domain *d,

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>