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 2/2] passthrough: deliver IRQs even if bsp is halted

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2/2] passthrough: deliver IRQs even if bsp is halted (support kexec/kdump on hvm)
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Tue, 30 Jun 2009 15:57:18 +0900
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Tue, 30 Jun 2009 00:01:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <7kr5x2nrcd.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
References: <7kr5x2nrcd.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This patch is needed for kexec/kdump on hvm since kdump halts bsp.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 7397608bce87 xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c      Mon Jun 29 15:50:32 2009 +0100
+++ b/xen/drivers/passthrough/io.c      Tue Jun 30 13:16:26 2009 +0900
@@ -362,6 +362,7 @@ int pt_irq_destroy_bind_vtd(
 int hvm_do_IRQ_dpci(struct domain *d, unsigned int mirq)
 {
     struct hvm_irq_dpci *dpci = domain_get_irq_dpci(d);
+    struct vcpu *v;
 
     ASSERT(spin_is_locked(&irq_desc[domain_irq_to_vector(d, mirq)].lock));
     if ( !iommu_enabled || (d == dom0) || !dpci ||
@@ -378,7 +379,13 @@ int hvm_do_IRQ_dpci(struct domain *d, un
     if ( pt_irq_need_timer(dpci->mirq[mirq].flags) )
         set_timer(&dpci->hvm_timer[domain_irq_to_vector(d, mirq)],
                   NOW() + PT_IRQ_TIME_OUT);
-    vcpu_kick(d->vcpu[0]);
+
+    for_each_vcpu(d, v)
+        if ( !test_bit(_VPF_down, &v->pause_flags) )
+        {
+            vcpu_kick(v);
+            break;
+        }
 
     return 1;
 }
@@ -437,7 +444,7 @@ void hvm_dirq_assist(struct vcpu *v)
     struct hvm_irq_dpci *hvm_irq_dpci = d->arch.hvm_domain.irq.dpci;
     struct dev_intx_gsi_link *digl;
 
-    if ( !iommu_enabled || (v->vcpu_id != 0) || (hvm_irq_dpci == NULL) )
+    if ( !iommu_enabled || (hvm_irq_dpci == NULL) )
         return;
 
     for ( irq = find_first_bit(hvm_irq_dpci->dirq_mask, d->nr_pirqs);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel