Age | Commit message (Collapse) | Author |
|
For the allocation, using CRASH_MAX_MEMMAP_NR instead of KEXEC_MAX_SEGMENTS + 1
seems more understandable.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
[horms@verge.net.au: Applied by hand due to conflict]
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
kernel could have that in /proc/iomem, will use it for kdump kernel
for dma32
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
the acpi root table physical address.
Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
If there's no such file or read fail the function will just do nothing.
Tested efi boot Fedora 17 on thinkpad T420.
Some background info for this issue:
http://lists.infradead.org/pipermail/kexec/2010-March/003889.html
[v1 -> v2]:
Address comments from Khalid and Simon
use fgets instead of read(2) to iterate the file
do not add 'noefi' because kexec does not construct EFI signature
in bootloader signature in boot_params, so kexec'd kernel will
disable EFI automatically even without noefi.
Signed-off-by: Dave Young <dyoung@redhat.com>
Reviewed-by: Khalid Aziz <khalid@gonehiking.org>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
get_crash_memory_ranges() is unreliable under Xen. Proper machine
memory map could be obtained under Xen by calling __HYPERVISOR_memory_op
hypercall with XENMEM_machine_memory_map argument. get_crash_memory_ranges_xen()
does that. It is implemented using ioctl() or libxenctrl interface.
This solution is compatible with 3.x and 4.x Xen versions.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Move crash memory ranges logging from get_crash_memory_ranges()
to load_crashdump_segments(). This solution will be used by
fixed Xen kdump support, too.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Get backup area start address and size directly from mem_range.
Under Xen /proc/iomem contains invalid values.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Extract code segregating lowmem region and move it to new
segregate_lowmem_region(). This function will be used by
fixed Xen kdump support, too.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
is_crashkernel_mem_reserved()
Move crash kernel area placement and size detection
from get_crash_memory_ranges() to is_crashkernel_mem_reserved().
Former one will not be used by fixed Xen kdump support.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
kexec-tools package for debian includes a patch that adds a more
descriptive error message when someone tries to laod a crash kernel
and didn't remember to boot up with crashkernel= parameter. This
patch would be of general interest. This patch was originally written
by Alastair McKinstry.
Please apply.
Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Currently the debugging code is under #ifdef DEBUG, which
means when we want to debug, we have to re-compile the source
code with -DDEBUG. This is not convenient, we want to have
a generic --debug option so that we can enable debugging code
without re-compiling.
This patch moves the arch-specific --debug to generic place
and moves code under #ifdef DEBUG to --debug on x86.
BTW, the size of kexec binary increases very little after this patch.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
a) We don't need 'crash_notes' array at all, save some bytes on stack.
b) We forgot to fclose 'fp' before return.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Vivek pointed out that we have duplicated ->backup_src_start
in struct crash_elf_info and struct kexec_info.
This patch removes the ->backup_src_start and ->backup_src_end
from struct crash_elf_info.
I tested it on both i686 and ppc64, and used a test case from
Dave Anderson to confirm the backup region is correct on i686.
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-devel
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Currently we hard-coded the first 640K area as backup area,
however, this is not correct on some system which has reserved
memory area in the first 640K:
BIOS-e820: 0000000000010000 - 0000000000097000 (usable)
BIOS-e820: 0000000000097000 - 00000000000a0000 (reserved)
on such system we still mark all the first 640K as usable
in capture kernel, this will cause kernel panic.
The solution, pointed by Vivek, is that we can get the backup
area dynamically by reading /proc/iomem.
The reporter has tested this patch and it fixes the problem.
Signed-off-by: WANG Cong <amwang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
If the x86_64 arch returns 0 (KEXEC_ARCH_DEFAULT) then following
condition in load_crashdump_segments function will fill 386 as the
machine for the vmcore elf header..
...
if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64)
{
elf_info.machine = EM_X86_64;
} else {
elf_info.machine = EM_386;
elf_info.lowmem_limit = X86_MAXMEM;
elf_info.get_note_info = get_crash_notes;
}
...
ending with kexec-ed kernel failing check for the machine,
and disabling vmcore interface.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Paper bag time. I forgot to double check my changes worked
on x86_64. So I wound up with x86_64 putting i386 crashdump headers
on when it generated a crashdump header. Ouch!
Fix it by using the new KEXEC_ARCH_NATIVE value so we can see what
we are doing.
Change the one remaining arch test of info->kexec_flags to look
at elf_info.machine instead.
memset elf_info to 0 to ensure all of the fields are initialized
to something predictable.
*Sigh* What a landmine getting the arch out of kexec_flags became.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
|
|
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Make certain we are using the same page_offset, paddr, and vaddr
and kernel size that the x86_64 crashdump code is using.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
- Pass the acpi memap to the kernel.
- Port the fix from x86_64 to not truncate the elf
note segment to 16K, to keep large machines happy.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
o Put the debug code under #ifdef DEBUG instead of #if 0.
o Do this to match the x86_64 code.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Build a version of get_crash_memory_ranges that works the same
on both x86_64 and x86. Reorder the calls in load_crashdump_segments
so we have the architectures low memory limit when we call
get_crash_memory_ranges.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Unify the 32bit and the 64bit crashdump headers. Rename
arch specific defintions to arch specific names to be clear.
Update users of the renamed constants.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
In preparation for merging crashdump-x86 and crashdump-x86_64
move elf_info onto the stack and start filling it out dynamically
as appropriate.
Included in this change is only setting lowmem_limit and get_note_info
when we are generating a core file for a 32bit kernel.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Generate the correct crashdump header for x86_64 kernels
when a 32bit kernel is used.
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This fixes the following compiler warning
kexec/arch/i386/crashdump-x86.c: In function 'get_crash_memory_ranges':
kexec/arch/i386/crashdump-x86.c:144: warning: passing argument 1 of \
'fprintf' from incompatible pointer type
kexec/arch/i386/crashdump-x86.c:144: warning: passing argument 2 of \
'fprintf' makes pointer from integer without a cast
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
To support memory backup/restore an option named
--load-preserve-context is added to kexec. When it is specified
toggether with --mem-max, most segments for crash dump support are
loaded, and the memory range between mem_min to mem_max which has no
segments loaded are loaded as backup segments. To support jump back
from kexeced, options named --load-jump-back-helper and --entry are
added to load a helper image with specified entry to jump back.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Jamey Sharp <jamey@thetovacompany.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Removes the machine parameter to proc_iomem() which is no
longer of any use.
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Hi,
This patch fixes the problem that the kexec command cannot determine
ELF32/ELF64 automatically.
On i386 system, the kexec command always determined an ELF32 /proc/vmcore
even if the memory is 4GB or larger, because of referring the outside
of the array "range[]".
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
On ia64 XEN it is sometimes neccessary to use an alternate location for the
information that is usually provided by /proc/iomem. By having the path
returned by a function, which can be overriden on a per-architecture basis,
it is possible for ia64 XEN to make use of existing generic code. Hopefully
other achitectures can use this infastructure as the need arises.
If the machine parameter is zero, then iomem file relating to the currently
running kernel should be returned. If the machine parameter is non-zero
then iomem file, relating to the underlying hypervisor, should be returned.
In the simple case, these will be the same file.
Signed-off-by: Simon Horman <horms@verge.net.au>
kexec/arch/i386/crashdump-x86.c | 4 ++--
kexec/arch/i386/kexec-x86.c | 2 +-
kexec/arch/i386/x86-linux-setup.c | 2 +-
kexec/arch/ia64/crashdump-ia64.c | 9 +++++----
kexec/arch/ia64/kexec-elf-ia64.c | 2 +-
kexec/arch/ia64/kexec-ia64.c | 5 +++--
kexec/arch/ppc/kexec-ppc.c | 2 +-
kexec/arch/s390/kexec-s390.c | 5 +++--
kexec/arch/x86_64/crashdump-x86_64.c | 10 +++++-----
kexec/arch/x86_64/kexec-x86_64.c | 2 +-
kexec/crashdump-xen.c | 6 ++++--
kexec/kexec-iomem.c | 31 +++++++++++++++++++++++--------
kexec/kexec.h | 6 +++---
13 files changed, 53 insertions(+), 33 deletions(-)
9079040b40f643cfc9eb3d425dffa0ca8fd573e1
|
|
On i386, kexec generates ELF64 core headers by default if the user doesn't
override this via a command line option. Because GDB cannot analyse
ELF64 core dumps on 32 bit platforms, it's a bad idea to use ELF64 if it's not
needed.
This patch selects ELF32 if the biggest memory address fits in 32 bit address
space, which should be the case on non PAE systems. If the user specifies
a command line option, that option overrides the detection.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
The recently introduce kexec debug routine dprintf clashes with an existing
libc symbol. Rename dprintf to dbgprintf.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Use the new fprintf macro where possible
Cc: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Keep alignment comment in elf code and use ELF_CORE_HEADER_ALIGN
This patch puts back and extends the alignment comment in crashdump-elf.c
and adds a small check to make sure the arch-specific code aligns properly.
Instead of hardcoding 1024 we introduce ELF_CORE_HEADER_ALIGN.
The idea behind the alignment requirement is explained here:
http://lists.osdl.org/mailman/htdig/fastboot/2006-November/005147.html
Signed-off-by: Magnus Damm <magnus@valinux.co.jp>
Acked-by: Vivek Goyal <vgoyal@in.ibm.com>
Removed trainling whitespace after "kilobytes,"
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
crash_create_XXX_headers assumes that all arhitectures need an alignment of
1024bytes. But on ia64 at least this is not true. This patch adds an
alignment parameter to crash_create_XXX_headers, and calls passes
a value of 1024 for all architectures except ia64, where EFI_PAGE_SIZE (4096)
is passed.
If there are problems with alignment on other architectures hopefully
this facility will work for them too.
Cc: Bernhard Walle <bwalle@suse.de>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Zou, Nanhai <nanhai.zou@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
kexec/arch/i386/crashdump-x86.c | 4 ++--
kexec/arch/ia64/crashdump-ia64.c | 5 +++--
kexec/arch/ppc64/crashdump-ppc64.c | 4 ++--
kexec/arch/x86_64/crashdump-x86_64.c | 2 +-
kexec/crashdump-elf.c | 11 ++---------
kexec/crashdump.h | 6 ++++--
6 files changed, 14 insertions(+), 18 deletions(-)
|
|
kexec-tools: Use generic /proc/iomem code (i386) V2
This patch modifies the i386-specific code to use the new generic code.
Version 2 of this patch uses the newly renamed parse_iomem_single() function.
Signed-off-by: Magnus Damm <magnus@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
kexec-tools: Make use of crash_create_elf32/64_headers() (i386) V2
Use the new functions provided by crashdump-elf.c instead of duplicating the
same functionality twice in prepare_crash_memory_elf32/64_headers().
This version of the patch removes the alignment member from elf_info.
Signed-off-by: Magnus Damm <magnus@valinux.co.jp>
Removed trailing whitespace
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
kexec-tools: Continue instead of returning (i386)
Make the 32-bit code similar to the 64-bit version.
Signed-off-by: Magnus Damm <magnus@valinux.co.jp>
Acked-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
kexec-tools: Add length parameter to get_crash_notes_per_cpu()
Let get_crash_notes_per_cpu() pass both physical base address and length.
Under Xen we export this information from the hypervisor, and it would be
a nice improvement for the kernel to actually export the size too. So let's
change the framework to use both base address and length.
Signed-off-by: Magnus Damm <magnus@valinux.co.jp>
Removed trainling whitespace
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
o fix the regression in -kdump6 due to vmcore copy fix for x86_64 kdump
o Also made similar fix for i386
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
dumps
o Modify bzImage loader to also load kernel core elf headers so that
relocatable bzImage can be used for dump capturing purposes.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Check whether memory for crashkernel is reserved or not by looking for the
entry "Crash kernel" in /proc/iomem.
Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
On Thu, Jul 27, 2006 at 12:32:56PM -0600, Eric W. Biederman wrote:
>
> I have found a couple of moments and have been able to
> catch up with most of the backlog of patches for kexec-tools.
> There are several details I need to follow up on, and there is
> some testing I want to do to make certain everything is working.
>
> The primary kexec-tools archive is:
> git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools.git
>
> An archive to hold versions before 1.101 is at:
> git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-historic.git
>
> So far I have all version in there since 1.0 except 1.9, 1.92, and 1.93
> if someone happens to have a copy point me at it and I will update the
> history.
>
> Patches that hang out in quilt for a while can be annoying to import
> into git because their authorship information is not stored in an
> unambiguous way. git is general is much stricter about the format
> it's meta-data information is stored in.
>
> Maneesh in kdump10 there were two patches in particular that I have
> not sorted out their who wrote them. If you could help me sort that
> out I would appreciate it.
>
> ppc64-initrd-option.patch
> ppc64-kdump-device_tree-sort.patch
>
> Before I make a release here is my list of things I intend to look at:
> - Why we have defined the location of the crash backup region twice.
Hi Eric,
Are you referring to BACKUP_REGION_START and BACKUP_START declarations?
I am not sure why did I do that, may be somehow I thought that purgatory
code is not sharing the header files with main kexec code base.
Please have a look at the patch attached for i386. If this looks
fine, I shall generate the patches for x86_64 and ppc64 too.
Thanks & Regards
Vivek
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
|
|
On Wed, Dec 14, 2005 at 02:50:52PM -0600, Milton Miller wrote:
[..]
> >>(2) why do you stat the files instead of just trying to open them and
> >>check for ENOENT?
> >>
> >>milton
> >>
> >
> >I wanted to differentiate between two cases. One being sysfs not
> >mounted
> >and other being file not being present (Due to kernel bug or cpu not
> >present), hence used stat(). In case of sysfs not being mounted, we
> >simply exit after giving an error message. In other case we continue
> >to loop through other cpus and ignore cpu, which is not present.
> >
>
> Ok, but try to open the file first. IF you want to do this diagnostic
> after the open fails, that is ok. But don't do this check n times (n =
> number of cpus) when the file exists.
>
I have moved the sysfs mounted check in failure condition.
>
> >
> >On Tue, Dec 13, 2005 at 09:36:26AM -0800, Haren Myneni wrote:
> >>Vivek, I believe, we should push this func into arch independent code.
> >>Otherwise, we have to copy it for every platform.
> >>
> >
> >We have reworked the patch and moved this code to architecture
> >independent
> >portion.
> >
>
>
> Only the x86 code has the fallback the old name, not the genric code.
>
Only i386 port of kdump was available when crash_notes was exported
through /sys/kernel/crash_notes. Rest of the architectures see new arch-
independent percpu crash_notes sysfs interface only. Hence thought no
point copying backward compatibility code in generic code.
>
> Also, there are error paths that do not set the address, others that
> zero it.
>
The error paths which do not set address to zero are non return path. They
call die() which inturn calls exit(1) after printing appropriate error
messasge.
> What happens if the base kernel is too old for kexec-panic, where
> neiter file will exist?
>
In that case kexec will fail much earlier. There will be no reserved
memory area for loading second kernel (crashkernel=X&Y) hence attempt to
load the second kernel will fail and control will not reach this place at
all.
Modifed patch appended.
Thanks
Vivek
o This patch moves per cpu interface to retrieve crash_notes address to
architecture independent section. (As suggested by Haren)
o For i386, kernels older than 2.6.15-rc1-mm2 used to export crash_notes
through /sys/kernel/crash_notes. This patch also provides backward
compatibility with older kernel versions.
o Definition of MAX_NOTE_BYTES moved to architecture independent header
file as everybody is using same definition.
o Definition of MAX_LINE moved to architecture independent header file.
Seems to be a better option than defining it in many C files.
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
|
|
o Now kernel does per cpu dynamic allocation of memory for storing per cpu
register states and exports pointers to those memory buffers through
"/sys/devices/system/cpu/cpuX/crash_notes". This patch introduces the
support for the same.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
|