summaryrefslogtreecommitdiff
path: root/kexec/arch/i386/kexec-multiboot-x86.c
AgeCommit message (Collapse)Author
2016-10-07multiboot: Use the "reserved" type for non-ram zonesSylvain Munaut
Seems that Xen actually checks for some zones to be 'reserved' and complains if they are not. This also matches what the bios uses at boot. Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-10-07multiboot: Fix length computation for the memory zonesSylvain Munaut
Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-02-12multiboot: fix crash on NULL kernel command lineAmeya Palande
If "--command-line" option is not specified, then kexec segfaults while dereferencing NULL command line string pointer. While we are at it, also fix indentation and use '{' and '}' consistently. Signed-off-by: Ameya Palande <2ameya@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2014-01-16Fix value of mbi->mem_lower for multiboot-x86Peter Chubb
In the multiboot header, there is a field, `mem_lower' that is meant to contain the size of memory starting at zero and ending below 640k. If your kernel is compiled with CONFIG_X86_RESERVE_LOW non zero (the usual case), then a hole is inserted into kernel's physical memory map at zero, so the test to find the size of this region in kexec/arch/i386/kexec-multiboot-x86.c never succeeds, so the value is always zero. On a PC99 architecture, there is always memory at physycal address zero; assume that a region that starts below 64k actually starts at zero, and use it for the mem_lower variable. Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-10-03kexec: Remove unused -? option handlingGeoff Levand
The main kexec option code handles the -? option. Remove all the duplicate -? handlers in the arch code which are never used. Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro Signed-off-by: Simon Horman <horms@verge.net.au>
2013-03-27kexec: i386: multiboot: fix memory leak caused by get_command_lineZhang Yanfei
Since get_command_line returns dynamically allocated memory, it is easy for the caller to forget freeing the memory. Here fixes a memory leak caused by this function. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-03-27kexec: i386: multiboot: fix possible memory leak in multiboot_x86_loadZhang Yanfei
In multiboot_x86_load, allocated memory may not be free'd if the code exits abnormally, by calling return. So the patch fixes the possible memory leak. Besides, remove some extra blank lines. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-03-14kexec: i386: use _ALIGN* to make the logic clearZhang Yanfei
By replacing all the explicit align opertion with marco _ALIGN*, the code logic could be more clear. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-01-30kexec,x86: remove duplicate get_memory_rangesZhang Yanfei
At first, we have already filled the kexec_info.memory_ranges by calling my_load() -> get_memory_ranges(). So if we want to get the memory information, we could just use the existing one instead of calling get_memory_ranges again. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-05-19kexec-tools: Fix option/argument parsingMatt Evans
The argument parsing is currently a bit broken as main()'s getopt_long() knows nothing about either the architecture-specific options or, even more specifically, the architecture-and-loader-specific options. This patch introduces new #defines for all architectures, KEXEC_ALL_OPTIONS and KEXEC_ALL_OPT_STR. These contain all possible options for a given build, and the getopt_long() passes in main() and arch_process_options() will now recognise arch- and loader-specific options; these will not be re-ordered in argv[], there is no confusion over which argv[] entry is the kernel filename, and using '--opt=foo' and '--opt foo' both work. All architectures have command line options (and #define OPT_BLAHs) consolidated into their include/arch/option.h files. x86_64 builds parts of i386/ as well, so now both share a single option.h file (with a symlink). Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Make purgatory a signed char bufferSimon Horman
The consumer of the purgatory buffer, elf_rel_build_load() expects a signed char buffer. Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Avoid possible overflows from signed/unsigned comparisonsSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02don't leak in concat_cmdlineSimon Horman
Cc: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Fix --reuse-cmdline so it is usable.Eric W. Biederman
A colleague of mine implemented kdump and it used --reuse-cmdline with some rather interesting and unexpected results. Update the getopt specification so that --reuse-cmdline does not attempt to take an argument that it will not use. Update the processing of --append so that --reuse-cmdline followed by --append actually appends the parameters specified by --reuse-cmdline. Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
2008-05-21Add --reuse-cmdlineBernhard Walle
This patch adds an option "--reuse-cmdline" for people that are lazy in typing --append="$(cat /proc/cmdline)". The advantage of "--reuse-cmdline" is also that it strips off BOOT_IMAGE (since it may not be correct any more) from lilo and other boot loaders, and, more important, the crashkernel option in case a panic kernel is loaded. If you like the option I can also add it for really all architectures. Tested only with x86-bzImage both the kexec and kdump case. Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-04-24<sys/mman.h> is not needed by any kexec/ source, at least on i386.Jamey Sharp
Other architectures also include sys/mman.h and likely don't need to, but I can't easily test that. Signed-off-by: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-04-24Fix all gcc warnings for ARCH=i386 builds.Jamey Sharp
Signed-off-by: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19Consolidate BOOTLOADER definesJeremy Kerr
The BOOTLOADER and BOOTLOADER_VERSION #defines are repeated in multiple files. This change removes the unnecessary definition of these, and keeps the kexec/kexec.h as the main source. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-02-27kexec-tools : fix compile time error on x86-64Sachin P. Sant
On x86_64 machines running kernels having relocatale kernel patches compilation of kexec tools fails with following error. kexec/arch/i386/kexec-multiboot-x86.c:347: warning: implicit declaration of function ‘_AC’ kexec/arch/i386/kexec-multiboot-x86.c:347: error: ‘UL’ undeclared (first use in this function) kexec/arch/i386/kexec-multiboot-x86.c:347: error: (Each undeclared identifier is reported only once kexec/arch/i386/kexec-multiboot-x86.c:347: error: for each function it appears in.) The error is bacause of the use of PAGE_SIZE macro in the above file. On x86_64 arch PAGE_SIZE is defined as #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) and hence fails to find definitation for _AC(). The correct way to fix this is to use getpagesize() function instead of PAGE_SIZE macro. Signed-off-by : Sachin Sant <sachinp@in.ibm.com> Acked-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by : Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: i386 fix compilation issues due to new parameterVivek Goyal
o Fix i386 compilation issues. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2006-07-27crashdump backup region handlingVivek Goyal
o This patch adds support for reserving space for backup region. Also adds code in purgatory to copy the first 640K to backup region. o Moved kexec_flags inside kexec_info structure. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
2006-07-27kexec-tools-1.101Eric W. Biederman
- Initial import into git - initial nbi image formage support - ppc32 initial register setting fixes. - gzipped multiboot file support