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-ia64-devel

[Xen-ia64-devel] [rfc 06/15] Kexec: Add kexec_disable_iosapic

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [rfc 06/15] Kexec: Add kexec_disable_iosapic
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Fri, 17 Aug 2007 15:50:48 +0900
Delivery-date: Fri, 17 Aug 2007 00:41:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070817065042.645546902@xxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
Ported from Linux, this shuts down iosapic before preforming kexec.
This resolves a problem whereby the serial port on an HP RX2620
(which uses IOSAPIC) was not able to accept input. It probably
resolves a bunch of other as yet unseen problems too.

Thanks to Takebe-san for working out the solution to this puzzle.

Cc: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: xen-ia64-unstable.hg/xen/arch/ia64/linux-xen/iosapic.c
===================================================================
--- xen-ia64-unstable.hg.orig/xen/arch/ia64/linux-xen/iosapic.c 2007-05-28 
14:19:45.000000000 +0900
+++ xen-ia64-unstable.hg/xen/arch/ia64/linux-xen/iosapic.c      2007-05-28 
14:19:51.000000000 +0900
@@ -268,6 +268,24 @@ nop (unsigned int vector)
        /* do nothing... */
 }
 
+void
+kexec_disable_iosapic(void)
+{
+        struct iosapic_intr_info *info;
+        struct iosapic_rte_info *rte;
+        u8 vec = 0;
+        for (info = iosapic_intr_info; info <
+                        iosapic_intr_info + IA64_NUM_VECTORS; ++info, ++vec) {
+                list_for_each_entry(rte, &info->rtes,
+                                rte_list) {
+                        iosapic_write(rte->addr,
+                                        IOSAPIC_RTE_LOW(rte->rte_index),
+                                        IOSAPIC_MASK|vec);
+                        iosapic_eoi(rte->addr, vec);
+                }
+        }
+}
+
 static void
 mask_irq (unsigned int irq)
 {
Index: xen-ia64-unstable.hg/xen/arch/ia64/xen/crash.c
===================================================================
--- xen-ia64-unstable.hg.orig/xen/arch/ia64/xen/crash.c 2007-05-28 
14:19:51.000000000 +0900
+++ xen-ia64-unstable.hg/xen/arch/ia64/xen/crash.c      2007-05-28 
14:19:51.000000000 +0900
@@ -30,6 +30,7 @@ void machine_crash_shutdown(void)
     dom0_mm_pgd_mfn = __pa(dom0->arch.mm.pgd) >> PAGE_SHIFT;
     memcpy((char *)info + offsetof(crash_xen_info_t, dom0_mm_pgd_mfn),
           &dom0_mm_pgd_mfn, sizeof(dom0_mm_pgd_mfn));
+    kexec_disable_iosapic();
 #ifdef CONFIG_SMP
     smp_send_stop();
 #endif
Index: xen-ia64-unstable.hg/xen/include/xen/kexec.h
===================================================================
--- xen-ia64-unstable.hg.orig/xen/include/xen/kexec.h   2007-05-28 
14:19:45.000000000 +0900
+++ xen-ia64-unstable.hg/xen/include/xen/kexec.h        2007-05-28 
14:19:51.000000000 +0900
@@ -27,6 +27,7 @@ void machine_kexec_reserved(xen_kexec_re
 void machine_reboot_kexec(xen_kexec_image_t *image);
 void machine_kexec(xen_kexec_image_t *image);
 void kexec_crash(void);
+void kexec_disable_iosapic(void);
 void kexec_crash_save_cpu(void);
 crash_xen_info_t *kexec_crash_save_info(void);
 void machine_crash_shutdown(void);
Index: xen-ia64-unstable.hg/xen/arch/ia64/xen/machine_kexec.c
===================================================================
--- xen-ia64-unstable.hg.orig/xen/arch/ia64/xen/machine_kexec.c 2007-05-28 
14:19:51.000000000 +0900
+++ xen-ia64-unstable.hg/xen/arch/ia64/xen/machine_kexec.c      2007-05-28 
14:19:51.000000000 +0900
@@ -89,6 +89,7 @@ static void ia64_machine_kexec(struct un
 
 void machine_kexec(xen_kexec_image_t *image)
 {
+       kexec_disable_iosapic();
        unw_init_running(ia64_machine_kexec, image);
        for(;;);
        ia64_machine_kexec(NULL, image);

-- 

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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