09 May, 2007

1 commit

  • 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: Vivek Goyal
    Signed-off-by: Simon Horman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Simon Horman
     

26 Sep, 2006

1 commit

  • kexec: Avoid overwriting the current pgd (V4, x86_64)

    This patch upgrades the x86_64-specific kexec code to avoid overwriting the
    current pgd. Overwriting the current pgd is bad when CONFIG_CRASH_DUMP is used
    to start a secondary kernel that dumps the memory of the previous kernel.

    The code introduces a new set of page tables. These tables are used to provide
    an executable identity mapping without overwriting the current pgd.

    Signed-off-by: Magnus Damm
    Signed-off-by: Andi Kleen

    Magnus Damm
     

04 Feb, 2006

1 commit


11 Jan, 2006

2 commits

  • - Saving the cpu registers of all cpus before booting in to the crash
    kernel.

    - crash_setup_regs will save the registers of the cpu on which panic has
    occured. One of the concerns ppc64 folks raised is that after capturing the
    register states, one should not pop the current call frame and push new one.
    Hence it has been inlined. More call frames later get pushed on to stack
    (machine_crash_shutdown() and machine_kexec()), but one will not want to
    backtrace those.

    - Not very sure about the CFI annotations. With this patch I am getting
    decent backtrace with gdb. Assuming, compiler has generated enough
    debugging information for crash_kexec(). Coding crash_setup_regs() in pure
    assembly makes it tricky because then it can not be inlined and we don't
    want to return back after capturing register states we don't want to pop
    this call frame.

    - Saving the non-panicing cpus registers will be done in the NMI handler
    while shooting down them in machine_crash_shutdown.

    - Introducing CRASH_DUMP option in Kconfig for x86_64.

    Signed-off-by: Murali M Chakravarthy
    Signed-off-by: Vivek Goyal
    Cc: Andi Kleen
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vivek Goyal
     
  • - In case of system crash, current state of cpu registers is saved in memory
    in elf note format. So far memory for storing elf notes was being allocated
    statically for NR_CPUS.

    - This patch introduces dynamic allocation of memory for storing elf notes.
    It uses alloc_percpu() interface. This should lead to better memory usage.

    - Introduced based on Andi Kleen's and Eric W. Biederman's suggestions.

    - This patch also moves memory allocation for elf notes from architecture
    dependent portion to architecture independent portion. Now crash_notes is
    architecture independent. The whole idea is that size of memory to be
    allocated per cpu (MAX_NOTE_BYTES) can be architecture dependent and
    allocation of this memory can be architecture independent.

    Signed-off-by: Vivek Goyal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vivek Goyal
     

26 Jun, 2005

2 commits