linux-kernel-test/arch/ia64/kernel
Hidetoshi Seto 4295ab3488 [IA64] kdump: Mask MCA/INIT on frozen cpus
Summary:

  INIT asserted on kdump kernel invokes INIT handler not only on a
  cpu that running on the kdump kernel, but also BSP of the panicked
  kernel, because the (badly) frozen BSP can be thawed by INIT.

Description:

  The kdump_cpu_freeze() is called on cpus except one that initiates
  panic and/or kdump, to stop/offline the cpu (on ia64, it means we
  pass control of cpus to SAL, or put them in spinloop).  Note that
  CPU0(BSP) always go to spinloop, so if panic was happened on an AP,
  there are at least 2cpus (= the AP and BSP) which not back to SAL.

  On the spinning cpus, interrupts are disabled (rsm psr.i), but INIT
  is still interruptible because psr.mc for mask them is not set unless
  kdump_cpu_freeze() is not called from MCA/INIT context.

  Therefore, assume that a panic was happened on an AP, kdump was
  invoked, new INIT handlers for kdump kernel was registered and then
  an INIT is asserted.  From the viewpoint of SAL, there are 2 online
  cpus, so INIT will be delivered to both of them.  It likely means
  that not only the AP (= a cpu executing kdump) enters INIT handler
  which is newly registered, but also BSP (= another cpu spinning in
  panicked kernel) enters the same INIT handler.  Of course setting of
  registers in BSP are still old (for panicked kernel), so what happen
  with running handler with wrong setting will be extremely unexpected.
  I believe this is not desirable behavior.

How to Reproduce:

  Start kdump on one of APs (e.g. cpu1)
    # taskset 0x2 echo c > /proc/sysrq-trigger
  Then assert INIT after kdump kernel is booted, after new INIT handler
  for kdump kernel is registered.

Expected results:

  An INIT handler is invoked only on the AP.

Actual results:

  An INIT handler is invoked on the AP and BSP.

Sample of results:

  I got following console log by asserting INIT after prompt "root:/>".
  It seems that two monarchs appeared by one INIT, and one panicked at
  last.  And it also seems that the panicked one supposed there were
  4 online cpus and no one did rendezvous:

    :
    [  0 %]dropping to initramfs shell
    exiting this shell will reboot your system
    root:/> Entered OS INIT handler. PSP=fff301a0 cpu=0 monarch=0
    ia64_init_handler: Promoting cpu 0 to monarch.
    Delaying for 5 seconds...
    All OS INIT slaves have reached rendezvous
    Processes interrupted by INIT - 0 (cpu 0 task 0xa000000100af0000)
    :
    <<snip>>
    :
    Entered OS INIT handler. PSP=fff301a0 cpu=0 monarch=1
    Delaying for 5 seconds...
    mlogbuf_finish: printing switched to urgent mode, MCA/INIT might be dodgy or fail.
    OS INIT slave did not rendezvous on cpu 1 2 3
    INIT swapper 0[0]: bugcheck! 0 [1]
    :
    <<snip>>
    :
    Kernel panic - not syncing: Attempted to kill the idle task!

Proposed fix:

  To avoid this problem, this patch inserts ia64_set_psr_mc() to mask
  INIT on cpus going to be frozen.  This masking have no effect if the
  kdump_cpu_freeze() is called from INIT handler when kdump_on_init == 1,
  because psr.mc is already turned on to 1 before entering OS_INIT.
  I confirmed that weird log like above are disappeared after applying
  this patch.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Haren Myneni <hbabu@us.ibm.com>
Cc: kexec@lists.infradead.org
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2009-09-14 16:17:05 -07:00
..
cpufreq [IA64] improper printk format in acpi-cpufreq 2008-07-17 11:11:17 -07:00
.gitignore [IA64] Cleanup generated file not ignored by .gitignore 2008-08-04 11:06:16 -07:00
acpi-ext.c
acpi-processor.c ACPI: pdc init related memory leak with physical CPU hotplug 2009-06-20 00:50:52 -04:00
acpi.c irq: change ACPI GSI APIs to also take a device argument 2009-04-28 12:21:17 +02:00
asm-offsets.c ia64/pv_ops/xen: paravirtualize read/write ar.itc and ar.itm 2009-03-26 10:50:32 -07:00
audit.c
brl_emu.c
crash_dump.c kdump: make elfcorehdr_addr independent of CONFIG_PROC_VMCORE 2008-10-20 08:52:39 -07:00
crash.c [IA64] kdump: Mask MCA/INIT on frozen cpus 2009-09-14 16:17:05 -07:00
cyclone.c clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
dma-mapping.c [IA64] Fix warning in dma-mapping.c 2009-09-02 09:12:21 -07:00
efi_stub.S
efi.c [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
entry.h
entry.S [IA64] hook up new rt_tgsigqueueinfo syscall 2009-06-16 13:13:41 -07:00
err_inject.c sysdev: Pass the attribute to the low level sysdev show/store function 2008-07-21 21:55:02 -07:00
esi_stub.S
esi.c [IA64] Remove unnecessary semicolons 2009-06-30 14:18:32 -07:00
fsys.S ia64/pv_ops: paravirtualize mov = ar.itc. 2009-03-26 10:50:22 -07:00
fsyscall_gtod_data.h [IA64] generalize attribute of fsyscall_gtod_data 2008-02-04 15:36:36 -08:00
ftrace.c ftrace, ia64: IA64 dynamic ftrace support 2009-01-14 12:11:31 +01:00
gate-data.S
gate.lds.S ia64/pv_ops: gate page paravirtualization. 2009-03-26 10:51:02 -07:00
gate.S ia64/pv_ops: paravirtualize gate.S. 2009-03-26 11:01:46 -07:00
head.S [IA64] kdump: Mask MCA/INIT on frozen cpus 2009-09-14 16:17:05 -07:00
ia64_ksyms.c IA64: includecheck fix: ia64, ia64_ksyms.c 2009-08-11 14:52:10 -07:00
init_task.c mm: consolidate init_mm definition 2009-06-16 19:47:28 -07:00
iosapic.c arch/ia64/kernel/iosapic: missing test after ioremap() 2009-08-11 14:52:11 -07:00
irq_ia64.c [IA64] remove obsolete irq_desc_t typedef 2009-06-15 14:34:31 -07:00
irq_lsapic.c [IA64] remove obsolete hw_interrupt_type 2009-06-15 14:35:10 -07:00
irq.c [IA64] remove obsolete irq_desc_t typedef 2009-06-15 14:34:31 -07:00
ivt.S ia64/pv_ops: paravirtualize mov = ar.itc. 2009-03-26 10:50:22 -07:00
jprobes.S [IA64] Move include/asm-ia64 to arch/ia64/include/asm 2008-08-01 10:21:21 -07:00
kprobes.c kprobes: check CONFIG_FREEZER instead of CONFIG_PM 2009-01-16 14:32:17 -05:00
machine_kexec.c vmcoreinfo: fix the configuration dependencies 2008-02-07 08:42:25 -08:00
machvec.c x86, ia64: convert to use generic dma_map_ops struct 2009-01-06 14:06:57 +01:00
Makefile Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-04-05 11:04:19 -07:00
Makefile.gate ia64/pv_ops: gate page paravirtualization. 2009-03-26 10:51:02 -07:00
mca_asm.S [IA64] kdump: Mask MCA/INIT on frozen cpus 2009-09-14 16:17:05 -07:00
mca_drv_asm.S [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv.c CRED: Wrap task credential accesses in the IA64 arch 2008-11-14 10:38:37 +11:00
mca_drv.h [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca.c Pull for-2.6.31 into release 2009-06-17 09:35:24 -07:00
minstate.h [IA64] pvops: paravirtualize minstate.h. 2008-05-27 15:02:17 -07:00
module.c [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
msi_ia64.c [IA64] msi_ia64.c dmar_msi_type should be static 2009-06-15 14:35:54 -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] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07: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
paravirt.c ia64: remove some warnings. 2009-03-27 11:11:04 -07:00
paravirtentry.S ia64/pv_ops: implement binary patching optimization for native. 2009-03-26 11:02:42 -07:00
patch.c ia64: remove some warnings. 2009-03-27 11:11:04 -07:00
pci-dma.c Bug Fix arch/ia64/kernel/pci-dma.c: fix recursive dma_supported() call in iommu_dma_supported() 2009-08-11 14:52:10 -07:00
pci-swiotlb.c Intel IOMMU Pass Through Support 2009-04-29 06:54:34 +01:00
perfmon_default_smpl.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
perfmon.c [IA64] address compiler warnings perfmon.c/salinfo.c 2009-06-30 14:26:34 -07:00
process.c Simplify copy_thread() 2009-04-02 19:04:51 -07:00
ptrace.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
relocate_kernel.S
sal.c [IA64] Update check_sal_cache_flush to use platform_send_ipi() 2008-06-11 16:40:33 -07:00
salinfo.c [IA64] address compiler warnings perfmon.c/salinfo.c 2009-06-30 14:26:34 -07:00
setup.c [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
sigframe.h
signal.c CRED: Wrap task credential accesses in the IA64 arch 2008-11-14 10:38:37 +11:00
smp.c [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
smpboot.c [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
sys_ia64.c [CVE-2009-0029] Remove __attribute__((weak)) from sys_pipe/sys_pipe2 2009-01-14 14:15:15 +01:00
time.c [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
topology.c ia64/topology.c: exit cache_add_dev when kobject_init_and_add fails 2009-08-11 14:52:11 -07:00
traps.c [IA64] honor notify_die() returning NOTIFY_STOP 2008-02-05 08:26:44 -08:00
unaligned.c [IA64] dump stack on kernel unaligned warnings 2009-01-15 10:38:56 -08:00
uncached.c Pull for-2.6.31 into release 2009-06-17 09:35:24 -07:00
unwind_decoder.c
unwind_i.h
unwind.c [IA64] Do not go beyond ARRAY_SIZE of unw.hash 2009-02-25 11:48:04 -08:00
vmlinux.lds.S Pull pvops into release branch 2009-03-31 14:25:08 -07:00