1. 15 9月, 2009 5 次提交
    • H
      [IA64] kdump: Short path to freeze CPUs · 0cced40e
      Hidetoshi Seto 提交于
      Setting monarch_cpu = -1 to let slaves frozen might not work, because
      there might be slaves being late, not entered the rendezvous yet.
      Such slaves might be caught in while (monarch_cpu == -1) loop.
      
      Use kdump_in_progress instead of monarch_cpus to break INIT rendezvous
      and let all slaves enter DIE_INIT_SLAVE_LEAVE smoothly.
      
      And monarch no longer need to manage rendezvous if once kdump_in_progress
      is set, catch the monarch in DIE_INIT_MONARCH_ENTER then.
      Signed-off-by: NHidetoshi 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: NFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      0cced40e
    • H
      [IA64] kdump: Try INIT regardless of · 5959906e
      Hidetoshi Seto 提交于
      kdump_on_init
      
      CPUs should be frozen if possible, otherwise it might hinder kdump.
      So if there are CPUs not respond to IPI, try INIT to stop them.
      Signed-off-by: NHidetoshi 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: NFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      5959906e
    • H
      [IA64] kdump: Mask INIT first in panic-kdump path · 1726b088
      Hidetoshi Seto 提交于
      Summary:
      
        Asserting INIT might block kdump if the system is already going to
        start kdump via panic.
      
      Description:
      
        INIT can interrupt anywhere in panic path, so it can interrupt in
        middle of kdump kicked by panic.  Therefore there is a race if kdump
        is kicked concurrently, via Panic and via INIT.
      
        INIT could fail to invoke kdump if the system is already going to
        start kdump via panic.  It could not restart kdump from INIT handler
        if some of cpus are already playing dead with INIT masked.  It also
        means that INIT could block kdump's progress if no monarch is entered
        in the INIT rendezvous.
      
        Panic+INIT is a rare, but possible situation since it can be assumed
        that the kernel or an internal agent decides to panic the unstable
        system while another external agent decides to send an INIT to the
        system at same time.
      
      How to reproduce:
      
        Assert INIT just after panic, before all other cpus have frozen
      
      Expected results:
      
        continue kdump invoked by panic, or restart kdump from INIT
      
      Actual results:
      
        might be hang, crashdump not retrieved
      
      Proposed Fix:
      
        This patch masks INIT first in panic path to take the initiative on
        kdump, and reuse atomic value kdump_in_progress to make sure there is
        only one initiator of kdump.  All INITs asserted later should be used
        only for freezing all other cpus.
      
        This mask will be removed soon by rfi in relocate_kernel.S, before jump
        into kdump kernel, after all cpus are frozen and no-op INIT handler is
        registered.  So if INIT was in the interval while it is masked, it will
        pend on the system and will received just after the rfi, and handled by
        the no-op handler.
      
        If there was a MCA event while psr.mc is 1, in theory the event will
        pend on the system and will received just after the rfi same as above.
        MCA handler is unregistered here at the time, so received MCA will not
        reach to OS_MCA and will result in warmboot by SAL.
      
        Note that codes in this masked interval are relatively simpler than
        that in MCA/INIT handler which also executed with the mask.  So it can
        be said that probability of error in this interval is supposed not so
        higher than that in MCA/INIT handler.
      Signed-off-by: NHidetoshi 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: NFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      1726b088
    • H
      [IA64] kdump: Don't return APs to SAL from kdump · 68cb14c7
      Hidetoshi Seto 提交于
      Summary:
      
        Asserting INIT on cpu going to be offline will result in unexpected
        behavior.  It will be a real problem in kdump cases where INIT might
        be asserted to unstable APs going to be offline by returning to SAL.
      
      Description:
      
        Since psr.mc is cleared when bits in psr are set to SAL_PSR_BITS_TO_SET
        in ia64_jump_to_sal(), there is a small window (~few msecs) that the
        cpu can receive INIT even if the cpu enter there via INIT handler.
        In this window we do restore of registers for SAL, so INIT asserted
        here will not work properly.
      
        It is hard to remove this window by masking INIT (i.e. setting psr.mc)
        because we have to unmask it later in OS, because we have to use branch
        instruction (br.ret, not rfi) to return SAL, due to OS_BOOT_RENDEZ to
        SAL return convention.
      
        I suppose this window will not be a real problem on cpu offline if we
        can educate people not to push INIT button during hotplug operation.
        However, only exception is a race in kdump and INIT.  Now kdump returns
        APs to SAL before processing dump, but the kernel might receive INIT at
        that point in time.  Such INIT might be asserted by kdump itself if an
        AP doesn't react IPI soon and kdump decided to use INIT to stop the AP.
        Or it might be asserted by operator or an external agent to start dump
        on the unstable system.
      
        Such panic+INIT or INIT+INIT cases should be rare, but it will be happy
        if we can retrieve crashdump even in such cases.
      
      How to reproduce:
      
        panic+INIT or INIT+INIT, with kdump configured
      
      Expected results:
      
        crashdump is retrieved anyway
      
      Actual results:
      
        panic, hang etc. (unexpected)
      
      Proposed fix
      
        To avoid the window on the way to SAL, this patch stops returning APs
        to SAL in case of kdump.  In other words, this patch makes APs spin
        in OS instead of spinning in SAL.
      
        (* Note: What impact would be there?  If a cpu is spinning in SAL,
         the cpu is in BOOT_RENDEZ loop, as same as offlined cpu.
         In theory if an INIT is asserted there, cpus in the BOOT_RENDEZ loop
         should not invoke OS_INIT on it.  So in either way, no matter where
         the cpu is spinning actually in, once cpu starts spin and act as
         "frozen," INIT on the cpu have no effects.
         From another point of view, all debug information on the cpu should
         have stored to memory before the cpu start to be frozen.  So no more
         action on the cpu is required.)
      
        I confirmed that the kdump sometime hangs by concurrent INITs (another
        INIT after an INIT), and it doesn't hang after applying this patch.
      Signed-off-by: NHidetoshi 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: NFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      68cb14c7
    • H
      [IA64] kdump: Mask MCA/INIT on frozen cpus · 4295ab34
      Hidetoshi Seto 提交于
      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: NHidetoshi 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: NFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      4295ab34
  2. 22 4月, 2008 1 次提交
  3. 16 4月, 2008 1 次提交
    • T
      [IA64] kdump: Add crash_save_vmcoreinfo for INIT · 072f042d
      Takao Indoh 提交于
      This patch fixes the problem that kdump by INIT does not work if we use
      makedumpfile. The problem is that after INIT is issued, 2nd kernel
      starts and makedumpfile fails with the following error message.
      
      /proc/vmcore doesn't contain vmcoreinfo.
      '-x' or '-i' must be specified.
      
      makedumpfile Failed.
      
      The cause of this problem is that kernel does not call
      crash_save_vmcoreinfo. When kdump starts by panic or sysrq-trigger,
      crash_save_vmcoreinfo is called by crash_kexec. But this function is not
      called when kdump starts by INIT. The Attached patch fixes this.
      
      This patch just adds crash_save_vmcoreinfo into machine_kdump_on_init so
      that crash_save_vmcoreinfo can be called when kdump starts by INIT.
      I tested this patch with linux-2.6.25-rc9 and I confirmed it worked.
      Signed-off-by: NTakao Indoh <indou.takao@jp.fujitsu.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      072f042d
  4. 10 4月, 2008 2 次提交
  5. 07 3月, 2008 1 次提交
  6. 13 10月, 2007 2 次提交
  7. 15 5月, 2007 1 次提交
    • J
      [IA64] kdump on INIT needs multi-nodes sync-up (v.2) · 311f594d
      Jay Lan 提交于
      The current implementation of kdump on INIT events would enter
      kdump processing on DIE_INIT_MONARCH_ENTER and DIE_INIT_SLAVE_ENTER
      events. Thus, the monarch cpu would go ahead and boot up the kdump
      
      On SN shub2 systems, this out-of-sync situation causes some slave
      cpus on different nodes to enter POD.
      
      This patch moves kdump entry points to DIE_INIT_MONARCH_LEAVE and
      DIE_INIT_SLAVE_LEAVE. It also sets kdump_in_progress variable in
      the DIE_INIT_MONARCH_PROCESS event to not dump all active stack
      traces to the console in the case of kdump.
      
      I have tested this patch on an SN machine and a HP RX2600.
      Signed-off-by: NJay Lan <jlan@sgi.com>
      Acked-by: NZou Nan hai <nanhai.zou@intel.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      311f594d
  8. 12 5月, 2007 1 次提交
  9. 09 5月, 2007 2 次提交
    • S
      kdump/kexec: calculate note size at compile time · 6672f76a
      Simon Horman 提交于
      Currently the size of the per-cpu region reserved to save crash notes is
      set by the per-architecture value MAX_NOTE_BYTES.  Which in turn is
      currently set to 1024 on all supported architectures.
      
      While testing ia64 I recently discovered that this value is in fact too
      small.  The particular setup I was using actually needs 1172 bytes.  This
      lead to very tedious failure mode where the tail of one elf note would
      overwrite the head of another if they ended up being alocated sequentially
      by kmalloc, which was often the case.
      
      It seems to me that a far better approach is to caclculate the size that
      the area needs to be.  This patch does just that.
      
      If a simpler stop-gap patch for ia64 to be squeezed into 2.6.21(.X) is
      needed then this should be as easy as making MAX_NOTE_BYTES larger in
      arch/asm-ia64/kexec.h.  Perhaps 2048 would be a good choice.  However, I
      think that the approach in this patch is a much more robust idea.
      Acked-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6672f76a
    • C
      move die notifier handling to common code · 1eeb66a1
      Christoph Hellwig 提交于
      This patch moves the die notifier handling to common code.  Previous
      various architectures had exactly the same code for it.  Note that the new
      code is compiled unconditionally, this should be understood as an appel to
      the other architecture maintainer to implement support for it aswell (aka
      sprinkling a notify_die or two in the proper place)
      
      arm had a notifiy_die that did something totally different, I renamed it to
      arm_notify_die as part of the patch and made it static to the file it's
      declared and used at.  avr32 used to pass slightly less information through
      this interface and I brought it into line with the other architectures.
      
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix vmalloc_sync_all bustage]
      [bryan.wu@analog.com: fix vmalloc_sync_all in nommu]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: <linux-arch@vger.kernel.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NBryan Wu <bryan.wu@analog.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1eeb66a1
  10. 21 3月, 2007 1 次提交
  11. 09 3月, 2007 1 次提交
  12. 15 2月, 2007 1 次提交
    • E
      [PATCH] sysctl: remove insert_at_head from register_sysctl · 0b4d4147
      Eric W. Biederman 提交于
      The semantic effect of insert_at_head is that it would allow new registered
      sysctl entries to override existing sysctl entries of the same name.  Which is
      pain for caching and the proc interface never implemented.
      
      I have done an audit and discovered that none of the current users of
      register_sysctl care as (excpet for directories) they do not register
      duplicate sysctl entries.
      
      So this patch simply removes the support for overriding existing entries in
      the sys_sysctl interface since no one uses it or cares and it makes future
      enhancments harder.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: David Howells <dhowells@redhat.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: "John W. Linville" <linville@tuxdriver.com>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Cc: Jan Kara <jack@ucw.cz>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Mark Fasheh <mark.fasheh@oracle.com>
      Cc: David Chinner <dgc@sgi.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0b4d4147
  13. 10 2月, 2007 1 次提交
  14. 06 2月, 2007 2 次提交
  15. 13 12月, 2006 1 次提交
    • H
      [IA64] CONFIG_KEXEC/CONFIG_CRASH_DUMP permutations · 45a98fc6
      Horms 提交于
      Actually, on reflection I think that there is a good case for
      keeping the options separate. I am thinking particularly of people
      who want a very small crashdump kernel and thus don't want to compile
      in kexec.
      
      The patch below should fix things up so that all valid combinations of
      KEXEC, CRASH_DUMP and VMCORE compile cleanly - VMCORE depends on
      CRASH_DUMP which is why I said valid combinations. In a nutshell
      it just untangles unrelated code and switches around a few defines.
      
      Please note that it creats a new file, arch/ia64/kernel/crash_dump.c
      This is in keeping with the i386 implementation.
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      45a98fc6
  16. 08 12月, 2006 1 次提交
    • Z
      [IA64] IA64 Kexec/kdump · a7956113
      Zou Nan hai 提交于
      Changes and updates.
      
      1. Remove fake rendz path and related code according to discuss with Khalid Aziz.
      2. fc.i offset fix in relocate_kernel.S.
      3. iospic shutdown code eoi and mask race fix from Fujitsu.
      4. Warm boot hook in machine_kexec to SN SAL code from Jack Steiner.
      5. Send slave to SAL slave loop patch from Jay Lan.
      6. Kdump on non-recoverable MCA event patch from Jay Lan
      7. Use CTL_UNNUMBERED in kdump_on_init sysctl.
      Signed-off-by: NZou Nan hai <nanhai.zou@intel.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      a7956113