ia64/xen-unstable

changeset 16001:2b0cbf3ef83f

[IA64] Kexec: Add kexec_disable_iosapic

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@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
author Alex Williamson <alex.williamson@hp.com>
date Thu Sep 27 15:12:58 2007 -0600 (2007-09-27)
parents d7c3b12014b3
children ec3f4e9e62f6
files xen/arch/ia64/linux-xen/iosapic.c xen/arch/ia64/xen/crash.c xen/arch/ia64/xen/machine_kexec.c xen/include/xen/kexec.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/iosapic.c	Thu Sep 27 15:10:42 2007 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/iosapic.c	Thu Sep 27 15:12:58 2007 -0600
     1.3 @@ -268,6 +268,24 @@ nop (unsigned int vector)
     1.4  	/* do nothing... */
     1.5  }
     1.6  
     1.7 +void
     1.8 +kexec_disable_iosapic(void)
     1.9 +{
    1.10 +        struct iosapic_intr_info *info;
    1.11 +        struct iosapic_rte_info *rte;
    1.12 +        u8 vec = 0;
    1.13 +        for (info = iosapic_intr_info; info <
    1.14 +                        iosapic_intr_info + IA64_NUM_VECTORS; ++info, ++vec) {
    1.15 +                list_for_each_entry(rte, &info->rtes,
    1.16 +                                rte_list) {
    1.17 +                        iosapic_write(rte->addr,
    1.18 +                                        IOSAPIC_RTE_LOW(rte->rte_index),
    1.19 +                                        IOSAPIC_MASK|vec);
    1.20 +                        iosapic_eoi(rte->addr, vec);
    1.21 +                }
    1.22 +        }
    1.23 +}
    1.24 +
    1.25  static void
    1.26  mask_irq (unsigned int irq)
    1.27  {
     2.1 --- a/xen/arch/ia64/xen/crash.c	Thu Sep 27 15:10:42 2007 -0600
     2.2 +++ b/xen/arch/ia64/xen/crash.c	Thu Sep 27 15:12:58 2007 -0600
     2.3 @@ -30,6 +30,7 @@ void machine_crash_shutdown(void)
     2.4      dom0_mm_pgd_mfn = __pa(dom0->arch.mm.pgd) >> PAGE_SHIFT;
     2.5      memcpy((char *)info + offsetof(crash_xen_info_t, dom0_mm_pgd_mfn),
     2.6  	   &dom0_mm_pgd_mfn, sizeof(dom0_mm_pgd_mfn));
     2.7 +    kexec_disable_iosapic();
     2.8  #ifdef CONFIG_SMP
     2.9      smp_send_stop();
    2.10  #endif
     3.1 --- a/xen/arch/ia64/xen/machine_kexec.c	Thu Sep 27 15:10:42 2007 -0600
     3.2 +++ b/xen/arch/ia64/xen/machine_kexec.c	Thu Sep 27 15:12:58 2007 -0600
     3.3 @@ -85,6 +85,7 @@ static void ia64_machine_kexec(struct un
     3.4  
     3.5  void machine_kexec(xen_kexec_image_t *image)
     3.6  {
     3.7 +	kexec_disable_iosapic();
     3.8  	unw_init_running(ia64_machine_kexec, image);
     3.9  	for(;;);
    3.10  }
     4.1 --- a/xen/include/xen/kexec.h	Thu Sep 27 15:10:42 2007 -0600
     4.2 +++ b/xen/include/xen/kexec.h	Thu Sep 27 15:12:58 2007 -0600
     4.3 @@ -27,6 +27,7 @@ void machine_kexec_reserved(xen_kexec_re
     4.4  void machine_reboot_kexec(xen_kexec_image_t *image);
     4.5  void machine_kexec(xen_kexec_image_t *image);
     4.6  void kexec_crash(void);
     4.7 +void kexec_disable_iosapic(void);
     4.8  void kexec_crash_save_cpu(void);
     4.9  crash_xen_info_t *kexec_crash_save_info(void);
    4.10  void machine_crash_shutdown(void);