linux/arch/ia64/kernel
Hanjun Guo ffa9095532 Fix kexec oops when iosapic was removed
Iosapic hotplug was supported in IA64 code, but will lead to kexec oops
when iosapic was removed. here is the code logic:

iosapic_remove
  iosapic_free
    memset(&iosapic_lists[index], 0, sizeof(iosapic_lists[0]))
      iosapic_lists[index].addr was set to 0;

and then kexec a new kernel
kexec_disable_iosapic
  iosapic_write(rte->iosapic,..)
    __iosapic_write(iosapic->addr, reg, val);
      addr was set to 0 when iosapic_remove, and oops happened

The call trace is:
Starting new kernel
kexec[11336]: Oops 8804682956800 [1]
Modules linked in: raw(N) ipv6(N) acpi_cpufreq(N) binfmt_misc(N) fuse(N) nls_iso
8859_1(N) loop(N) ipmi_si(N) ipmi_devintf(N) ipmi_msghandler(N) mca_ereport(N) s
csi_ereport(N) nic_ereport(N) pcie_ereport(N) err_transport(N) nvlist(PN) dm_mod
(N) tpm_tis(N) tpm(N) ppdev(N) tpm_bios(N) serio_raw(N) i2c_i801(N) iTCO_wdt(N)
i2c_core(N) iTCO_vendor_support(N) sg(N) ioatdma(N) igb(N) mptctl(N) dca(N) parp
ort_pc(N) parport(N) container(N) button(N) usbhid(N) hid(N) uhci_hcd(N) ehci_hc
d(N) usbcore(N) sd_mod(N) crc_t10dif(N) ext3(N) mbcache(N) jbd(N) fan(N) process
or(N) ide_pci_generic(N) ide_core(N) ata_piix(N) libata(N) mptsas(N) mptscsih(N)
 mptbase(N) scsi_transport_sas(N) scsi_mod(N) thermal(N) thermal_sys(N) hwmon(N)

Supported: Yes, External

Pid: 11336, CPU 0, comm:                kexec
psr : 0000101009522030 ifs : 8000000000000791 ip  : [<a00000010004c160>]    Tain
ted: P          N  (2.6.32.12_RAS_V1R3C00B011)
ip is at kexec_disable_iosapic+0x120/0x1e0
unat: 0000000000000000 pfs : 0000000000000791 rsc : 0000000000000003
rnat: 0000000000000000 bsps: 0000000000000000 pr  : 65519aa6a555a659
ldrs: 0000000000000000 ccv : 00000000ea3cf51e fpsr: 0009804c8a70033f
csd : 0000000000000000 ssd : 0000000000000000
b0  : a00000010004c150 b6  : a000000100012620 b7  : a00000010000cda0
f6  : 000000000000000000000 f7  : 1003e0000000002000000
f8  : 1003e0000000050000003 f9  : 1003e0000028fb97183cd
f10 : 1003ee9f380df3c548b67 f11 : 1003e00000000000000cc
r1  : a0000001016cf660 r2  : 0000000000000000 r3  : 0000000000000000
r8  : 0000001009526030 r9  : a000000100012620 r10 : e00000010053f600
r11 : c0000000fec34040 r12 : e00000078f76fd30 r13 : e00000078f760000
r14 : 0000000000000000 r15 : 0000000000000000 r16 : 0000000000000000
r17 : 0000000000000000 r18 : 0000000000007fff r19 : 0000000000000000
r20 : 0000000000000000 r21 : e00000010053f590 r22 : a000000100cf0000
r23 : 0000000000000036 r24 : e0000007002f8a84 r25 : 0000000000000022
r26 : e0000007002f8a88 r27 : 0000000000000020 r28 : 0000000000000002
r29 : a0000001012c8c60 r30 : 0000000000000000 r31 : 0000000000322e49

Call Trace:
 [<a000000100018ca0>] show_stack+0x80/0xa0
                                sp=e00000078f76f8f0 bsp=e00000078f761380
 [<a000000100019300>] show_regs+0x640/0x920
                                sp=e00000078f76fac0 bsp=e00000078f761328
 [<a00000010002a130>] die+0x190/0x2e0
                                sp=e00000078f76fad0 bsp=e00000078f7612e8
 [<a000000100922fa0>] ia64_do_page_fault+0x840/0xb20
                                sp=e00000078f76fad0 bsp=e00000078f761288
 [<a00000010000d5c0>] ia64_native_leave_kernel+0x0/0x270
                                sp=e00000078f76fb60 bsp=e00000078f761288
 [<a00000010004c160>] kexec_disable_iosapic+0x120/0x1e0
                                sp=e00000078f76fd30 bsp=e00000078f761200
 [<a000000100016970>] machine_shutdown+0x110/0x140
                                sp=e00000078f76fd30 bsp=e00000078f7611c8
 [<a000000100133530>] kernel_kexec+0xd0/0x120
                                sp=e00000078f76fd30 bsp=e00000078f7611a0
 [<a0000001000eca40>] sys_reboot+0x480/0x4e0
                                sp=e00000078f76fd30 bsp=e00000078f761128
 [<a00000010000d420>] ia64_ret_from_syscall+0x0/0x20
                                sp=e00000078f76fe30 bsp=e00000078f761120
Kernel panic - not syncing: Fatal exception

With Tony and Toshi's advice, the patch removes the "rte" from rte_list
when the iosapic was removed.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2013-03-19 16:14:53 -07:00
..
cpufreq [CPUFREQ] use dynamic debug instead of custom infrastructure 2011-05-04 11:50:57 -04:00
.gitignore [IA64] Cleanup generated file not ignored by .gitignore 2008-08-04 11:06:16 -07:00
acpi-ext.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
acpi.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
asm-offsets.c cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
audit.c [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
brl_emu.c
crash.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
crash_dump.c crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn 2011-03-23 19:47:19 -07:00
cyclone.c ia64: Replace clocksource.fsys_mmio with generic arch data 2011-07-14 17:57:09 -07:00
dma-mapping.c ia64: Add export.h to arch/ia64 specific files as required 2011-10-31 19:30:58 -04:00
efi.c /dev/mem: use phys_addr_t for physical addresses 2012-10-24 15:32:50 -07:00
efi_stub.S
elfcore.c elf coredump: add extended numbering support 2010-03-06 11:26:46 -08:00
entry.h
entry.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
err_inject.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
esi.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
esi_stub.S
fsys.S Fix broken fsys_getppid() 2013-03-19 16:14:52 -07:00
fsyscall_gtod_data.h ia64: vsyscall: Use seqcount instead of seqlock 2012-03-15 18:17:59 -07:00
ftrace.c ftrace, ia64: IA64 dynamic ftrace support 2009-01-14 12:11:31 +01:00
gate-data.S Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
gate.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
gate.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
head.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
ia64_ksyms.c treewide: Put a space between #include and FILE 2012-06-28 11:44:36 +02:00
init_task.c Rename .data.init_task to .data..init_task. 2010-03-03 11:25:58 +01:00
iosapic.c Fix kexec oops when iosapic was removed 2013-03-19 16:14:53 -07:00
irq.c ia64: Use generic show_interrupts() 2011-03-29 14:48:05 +02:00
irq_ia64.c random: remove rand_initialize_irq() 2012-07-19 10:38:32 -04:00
irq_lsapic.c ia64: Convert lsapic to new irq_chip functions 2011-03-29 14:48:02 +02:00
ivt.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
jprobes.S [IA64] Move include/asm-ia64 to arch/ia64/include/asm 2008-08-01 10:21:21 -07:00
kprobes.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
machine_kexec.c [IA64] kexec: Move the dereference below the NULL test 2012-09-10 14:31:23 -07:00
machvec.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
Makefile iommu: Rename the DMAR and INTR_REMAP config options 2011-09-21 10:22:03 +02:00
Makefile.gate Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
mca.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
mca_asm.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
mca_drv.c userns: On ia64 deal with current_uid and current_gid being kuid and kgid 2012-09-21 03:13:29 -07:00
mca_drv.h [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv_asm.S [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
minstate.h cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
msi_ia64.c arch/ia64: remove references to cpu_*_map 2012-03-28 17:14:36 -07:00
nr-irqs.c ia64/pv_ops/xen: define the nubmer of irqs which xen needs. 2008-10-17 10:06:59 -07:00
numa.c [IA64] Minimize per_cpu reservations. 2008-04-08 13:51:35 -07:00
pal.S
palinfo.c [IA64] Use static const char * const in palinfo.c 2010-09-23 14:22:05 -07:00
paravirt.c static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]() 2012-02-24 10:05:59 +01:00
paravirt_inst.h ia64/pv_ops: paravirtualized instruction checker. 2008-10-17 10:12:54 -07:00
paravirt_patch.c ia64/pv_op/binarypatch: add helper functions to support binary patching for paravirt_ops. 2009-03-26 11:02:31 -07:00
paravirt_patchlist.c [IA64] Fix build error in paravirt_patchlist.c 2009-06-17 09:04:40 -07:00
paravirt_patchlist.h ia64/pv_ops: gate page paravirtualization. 2009-03-26 10:51:02 -07:00
paravirtentry.S Rename .data.read_mostly to .data..read_mostly. 2010-03-03 11:26:00 +01:00
patch.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
pci-dma.c iommu: Remove group_mf 2012-06-25 13:48:30 +02:00
pci-swiotlb.c X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
perfmon.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
perfmon_default_smpl.c Fix common misspellings 2011-03-31 11:26:23 -03:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
process.c ia64 idle: delete pm_idle 2013-02-17 23:37:06 -05:00
ptrace.c ia64: kill thread_matches(), unexport ptrace_check_attach() 2013-01-20 12:26:05 -08:00
relocate_kernel.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
sal.c [IA64] Update check_sal_cache_flush to use platform_send_ipi() 2008-06-11 16:40:33 -07:00
salinfo.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
setup.c ia64 idle: delete pm_idle 2013-02-17 23:37:06 -05:00
sigframe.h
signal.c ia64: switch to generic sigaltstack 2013-02-03 18:15:58 -05:00
smp.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
smpboot.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
stacktrace.c [IA64] Add CONFIG_STACKTRACE_SUPPORT 2010-09-23 13:52:07 -07:00
sys_ia64.c mm: use vm_unmapped_area() on ia64 architecture 2013-02-22 13:46:59 -08:00
time.c kvm: Prepare to add generic guest entry/exit callbacks 2013-01-27 20:35:40 +01:00
topology.c [IA64] Resolve name space collision for cache_show() 2012-11-07 15:51:04 -08:00
traps.c taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
unaligned.c [IA64] use __ratelimit 2010-05-18 14:45:54 -07:00
uncached.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind_decoder.c
unwind_i.h
vmlinux.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00