summaryrefslogtreecommitdiff
path: root/kexec/arch/mips
AgeCommit message (Collapse)Author
2017-10-18kexec-tools: mips: Use proper page_offset for OCTEON CPUs.David Daney
The OCTEON family of MIPS64 CPUs uses a PAGE_OFFSET of 0x8000000000000000ULL, which is differs from other CPUs. Scan /proc/cpuinfo to see if the current system is "Octeon", if so, patch the page_offset so that usable kdump core files are produced. Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2017-10-18kexec-tools: mips: Merge adjacent memory ranges.David Daney
Some kernel versions running on MIPS split the System RAM memory regions reported in /proc/iomem. This may cause loading of the kexec kernel to fail if it crosses one of the splits. Fix by merging adjacent memory ranges that have the same type. Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2017-10-16kexec-tools: mips: Try to include bss in kernel vmcore file.David Daney
The kernel message buffers, as well as a lot of other useful data reside in the bss section. Without this vmcore-dmesg cannot work, and debugging with a core dump is much more difficult. Try to add the /proc/iomem "Kernel bss" section to vmcore. If it is not found, just do what we used to do and use "Kernel data" instead. Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2017-10-16kexec-tools: mips: Don't set lowmem_limit to 2G for 64-bit systems.David Daney
The 64-bit MIPS architecture doesn't have the same 2G limit the 32-bit version has. Set MAXMEM and lowmem_limit to 0 for 64-bit MIPS so that memory above 2G is usable in the kdump core files. Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2017-03-14Don't use %L width specifier with integer valuesPhilip Prindeville
MUSL doesn't support %L except for floating-point arguments; therefore, %ll must be used instead with integer arguments. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2017-03-02crashdump/mips: Add get_crash_kernel_load_range() functionDaniel Kiper
Implement get_crash_kernel_load_range() in support of print crash kernel region size option. Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com> Signed-off-by: Eric DeVolder <eric.devolder@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-12-09mips: add option to load initrd from a specified fileMarcin Nowakowski
Use kexec's existing infrastrucutre for supporting initrd loading. The initrd image is loaded into a buffer after the dtb and its details passed through the device tree, so it's supported on newer platforms that make use of the device tree passed from kexec. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Signed-off-by: Simon Horman <horms@verge.net.au>
2016-12-09mips: add dtb loading supportMarcin Nowakowski
Kexec for MIPS currently does not support loading devicetrees, unless they are embedded in the kernel elf file. Add an option to either pass a new dtb file or - if not specified - to be generated from existing device tree on the device. As new generic platforms require a dtb to be passed separately this is required for such platforms and will be ignored by the kernel otherwise. Generic kexec infrastructure for dtb support is used. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Signed-off-by: Simon Horman <horms@verge.net.au>
2016-12-09mips: crashdump: add little-endian supportMarcin Nowakowski
Elf header for crashdump has until now been hardcoded as big-endian. Change that to use the native endianness for the compile target so that the crashdumps are generated properly for each CPU type. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-12-09mips: move arch option parsing from elf loader to common arch codeMarcin Nowakowski
At the moment only commandline handling is implemented and there is nothing elf-specific about it, so all of the commandline parsing logic can be moved to common arch code. getopt() options are moved to KEXEC_ARCH_OPTIONS macro (as many platforms currently do) to avoid unnecessary duplication. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-12-09mips: use arch_options for both 32 and 64 bit variantsMarcin Nowakowski
At the moment arch_options structure is defined for 64-bit only and is used exclusively in ifdef'ed code. Remove the ifdefs around the uses of the structure and define it for all code variants as it will be used for passing more arch options in the followup commits. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-12-09mips: remove incorrect arch_usage stringMarcin Nowakowski
arch_usage shows '--elf32-core-headers' as an option, but this is not implemented. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-03-24Pass struct mem_sym into machine_apply_elf_rel()Anton Blanchard
On PowerPC64 ABIv2 we need to look at the symbol to determine if it has a local entry point. Pass struct mem_sym into machine_apply_elf_rel() so we can. Signed-off-by: Anton Blanchard <anton@samba.org> Tested-by: Dave Young <dyoung@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-02-11mips: remove unused variable.Yousong Zhou
Fixes the following compilation warning. kexec/arch/mips/crashdump-mips.c:151:6: warning: unused variable 'i' [-Wunused-variable] Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-02-12mips: fix warning about implicit type conversion.Yousong Zhou
Fixes the following warning. kexec/arch/mips/kexec-elf-mips.c:161:16: warning: assignment makes integer from pointer without a cast [enabled by default] Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-02-12mips: fix compiler warning on printing 64-bit integer.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> 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-09-19cris/mips: Remove unused setup_simple_* declarationsGeert Uytterhoeven
Presumably these had been copied from ppc. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-06-10kexec-tools: mips: Remove saved_max_memZhang Yanfei
saved_max_mem is used to calculate the amount of memory that the previous kernel used. And passed to the dump-capture kernel by kernel commandline parameter "savemaxmem=". But in the dump-capture kernel, we never use this parameter now, so remove saved_max_mem and don't add "savemaxmem=" to new kernel commandline. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-03-14kexec: mips: 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>
2012-12-03kexec: Fix compile errors in crashdump-mips.cDavid Daney
When building configured as '--host=mips64-octeon-linux-gnu' using GCC-4.7.0 there are two compile errors, fix them. Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2012-03-29mips: move DEBUG code to --debugCong Wang
Like patch 1/5, this one moves code under #if DEBUG to --debug on mips arch. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2011-04-29kexec: remove duplicated backup_src_start field from struct crash_elf_infoCong Wang
Signed-off-by: WANG Cong <amwang@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2011-04-27kexec: remove duplicated backup_src_start field from struct crash_elf_infoAmerigo Wang
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>
2010-12-21mips: Use 32bit constant for 32bit elf kern_vaddr_startSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-12-21mips: kern_vaddr_start is now in crash_elf_infoSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-11-18Patch adds kernel data section to final vmcore. This forces gdb read kernelMaxim Uvarov
static data from dump instead of not initialized values from vmlinux. Signed-off-by: Maxim Uvarov <muvarov@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-09-06mips/crashdump put cmdline after the latest segmentMaxim Uvarov
Move cmdline from just after .bss segment to the just after the latest segment to avoid segments overlap while loading crashdump kernel. (new mips vmlinux has additional segments after .bss). Signed-off-by: Maxim Uvarov <muvarov@gmail.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-05-13kexec-tools: remove unused code from arch_process_options (arm, cris, ia64, ↵Matt Evans
mips, ppc) These architectures don't have any architecture-specific options (note: distinct from loader options, which are more specific), yet their arch_process_options() functions contain getopts_long() calls followed by no argument processing. The code doesn't do anything, so this patch removes it. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-05-12build: Don't modify CFLAGS in kexec/arch/mips/MakefileSimon Horman
Revert this portion of recent MIPS changes as it actually effects the CFLAGS for all architectures. Moreover I'm somewhat dubious about defaulting to -Werror for any architecture. Signed-off-by: Simon Horman <horms@verge.net.au>
2010-03-08some kexec MIPS improvementsMaxim Uvarov
- using simple mips* ) in configure.ac to make it compilable on mips2 and mips64 - remove kexec/arch/mips/mips-setup-simple.S which prepares cmdline for new kernel, it is better to move this work to kernel code. BTW this code was compilable only on o32 because of t4 is not defined on 64-64 or n32 MIPS ABIs. - simple put cmdline as string, kernel code should catch cmdline like this int board_kexec_prepare(struct kimage *image) { int i; char *bootloader = "kexec"; board_boot_desc_ptr->argc = 0; for(i=0;i<image->nr_segments;i++) { printk("segment %d if (!strncmp(bootloader, (char*)image->segment[i].buf, strlen(bootloader))) { /* * convert command line string to array * of parameters (as bootloader does). */ int argc = 0, offt; char *str = (char *)image->segment[i].buf; char *ptr = strchr(str, ' '); while (ptr && (ARGV_MAX_ARGS > argc)) { *ptr = '\0'; if (ptr[1] != ' ') { offt = (int)(ptr - str + 1); boot_desc_ptr->argv[argc] = image->segment[i].mem + offt; argc++; } ptr = strchr(ptr + 1, ' '); } boot_desc_ptr->argc = argc; break; } } Keep it as string make code simple and more readable. - add crashdump support - do not redefine syscalls numbers if they defined in system remove fixups for /proc/iomem. If your board provides wrong /proc/iomem please fix kernel, or at least you local version of kexec. No need to support it in main line. At least add option --fake-iomem - some minor fixes Signed-off-by: Maxim Uvarov <muvarov@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Use C99 initialisersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Mark unused parametersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2008-05-21Factor uname-based native architecture detection into a common function.Jamey Sharp
This code was copy-pasted into every architecture and was basically identical. Besides producing a nice net reduction in code, this factors a portability challenge into a single function that can be easily replaced at build-time. Signed-off-by: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-04-24Replace weak definitions with source filename overriding.Jamey Sharp
This reduces the kexec-tools' demands on the capabilities of the toolchain, and improves standards conformance, without really changing maintenance complexity. Signed-off-by: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-04-24<sys/mman.h> is not needed by any kexec/ sourceSimon Horman
This continues the work that Jamey Sharp did on i386 to cover all other architectures. Cc: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-03-18kexec-tools: mips: support big-endian mips (repost)Simon Horman
[ Reposted with correct linux-mips address ] Hi, this patch switches the mips support in kexec-tools around a little bit. All the files and directories containing "mipsel" have been renamed to contain "mips" instead. This is kind of consistent with the way that ARCH=mips in the kernel works for both big and little endian. After a small amount of tweaking, which is also included in this patch, the code compiles and works fine for big endian mips as well as small endian mips. All you need to do is compile using an appropriate compiler. That is to say, kexec-tools's build system doesn't need to be told about which endienness the code is being compiled for. I have added kept mipsel as a supported "architecture" via ./configure, though its just an alias for mips now. This is consistent with how other architectures such as sh are treated. But I'm happy to remove mipsel from ./configure if the mips people want that. I tested this patch using qemu and the 2.6.24.3 tag of the mips-2.6 git tree compiled for the qemu machine type for both big and little endian. The qemu machine type has subsequently been removed, and kexec-tools needs some work in order to function with qemu - as far as I understand the way the boot parameters are passed needs to be fixed, likely in purgatory. However, this is not related to the changes introduced in this patch. I intend to merge this patch into kexec-tools-testing if no alarm bells are sounded. Signed-off-by: Simon Horman <horms@verge.net.au>