summaryrefslogtreecommitdiff
path: root/purgatory/Makefile
AgeCommit message (Collapse)Author
2017-01-31purgatory: Add purgatory.map and purgatory.ro.sym to clean recipeDaniel Kiper
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com> Signed-off-by: Eric DeVolder <eric.devolder@oracle.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-12-02purgatory: Change default sha256 optimization to -O2Geoff Levand
Change the default purgatory sha256 code optimization from -O0 to -O2, and add a new arch specific makefile variable $(ARCH)_PURGATORY_SHA256_CFLAGS which can over ride this default. Set ia64_PURGATORY_SHA256_CFLAGS to -O0 to retain the previous optimization level for ia64. The purgatory sha256 code needs the be built with -O0 for the ia64 architecture. Currently this code is built with -O0 for all architectures, which slows down the calculations for architectures which could otherwise use -O2. On arm64, it takes around 20 second to verify SHA in purgatory when vmlinuz image is around 13MB and initramfs is around 30M with -O2 enabled. Otherwise, it takes more than 2 minutes. Cc: Pratyush Anand <panand@redhat.com> Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-09-29arm64: Add arm64 kexec supportGeoff Levand
Add kexec reboot support for ARM64 platforms. Signed-off-by: Geoff Levand <geoff@infradead.org> Tested-By: Pratyush Anand <panand@redhat.com> Tested-By: Matthias Brugger <mbrugger@suse.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-04-30purgatory: force PIC/PIE/SSP offMike Frysinger
If the toolchain has these things turned on automatically, then the purgatory code might be miscompiled leading to runtime errors like: Unhandled rela relocation: R_X86_64_GOTPC64 It might look like the problem is with the kernel when in reality, kexec is complaining about the purgatory module. Force off harden features that don't make sense in kernel space. Signed-off-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-03-19purgatory: Generate map fileGeoff Levand
To aid in debugging purgatory and its relocation generate a linker map file when purgatory is built. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-03-19purgatory: Generate symbol fileGeoff Levand
To aid in debugging purgatory update its makefile to generate a stand alone symbol file that can me loaded by a debugger. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-03-19purgatory: Add no-zero-initialized-in-bss flagGeoff Levand
It seems some toolchains will put zero-initialized variables like purgatory's sha256_regions into the BSS section. These symbols cannot be processed by machine_apply_elf_rel() and lead to build errors. To avoid this problem add the compiler flag no-zero-initialized-in-bss to the purgatory CFLAGS. Fixes build errors like these: Symbol: sha256_regions is in a bss section cannot set Reported here: http://lists.infradead.org/pipermail/kexec/2014-November/013052.html Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-10-03purgatory: Fix out-of-source build errorGeoff Levand
The source file config.h is a generated file, so its preprocessor include path must be relative to the build directory. Add that path to the purgatory CPPFLAGS. Fixes build errors like these: purgatory/arch/ppc/misc.S: fatal error: config.h: No such file or directory Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro Signed-off-by: Simon Horman <horms@verge.net.au>
2012-11-21kexec x86_64: Make purgatory relocatable anywhere in the 64bit address space.Eric W. Biederman
Remove kexec/arch/i386/compat_x6_64.S purgatory/arch/i386/linux-entry16.S and purgatory/arch/i386/entry16.S Those were early attempts at entry32-16.S that should have been deleted long ago. Strip the purgatory code of debug symbols. There is no need to carry debug symbols we will never use around in /sbin/kexec. On x86_64 use -mcmodel=large so that the code is built without any 32bit assumptions. -mcmodel=medium and -mcmodel=small result int code that has 32bit relocations against variables that can live anywhere in the address space Modify the assembly in entry64.S and setup-x86_64.S to use %rip relative addressing of variables so no relocates are emitted. Modify entry64-32.S so that it does not have any relocations that can not be processed when purgatory is loaded above 4G. entry64-32.S jumps to a 32bit entry point and can not itself be used above 4G so these changes merely prevent it from being a problem in the other case. eip is modifed to be a 64bit value of which only the low 32bits are exported outside of entry64-32.S The long mode exit code is modified to run with a %cs value whose base address is the address of the symbol entry32. From there all of the 32bit code in entry64-32.S can read variables by reading them through %cs. Until the final jump to the the target address which is made a far jump reloading %cs and the intstruction pointer. Modify entry32-16.S and entry32-16-debug.S to be position independent 32bit code. At their start make a short call to push the current value of %eip on the stack and pop it off. Allowing the calculation of the address of entry16 which the code has always kept in %ebx. Update the pointer to the gdt in the gdt so that lgdt will work. Modify the instructions in entry32-16.S and entry32-16-debug.S so that the 32bit code uses offsets from %ebx which points at entry16. Tested-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2012-09-07kexec: Fix the purgatory Makefile to build arch specific purgatory code.Mahesh Salgaonkar
The latest commit 5e48916 has removed a line from purgatory/Makefile that was responsible for building arch specific purgatory code. This causes kexec -p (loading of panic kernel) to fail. This patch reverts the deleted line. Verified this fix on x86_64 and ppc64. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2012-08-02build: Avoid duplicate files in tarballSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2011-03-30build: Pass --no-undefined as a linker optionSimon Horman
gcc-4.6 does not accept --no-undefined as a compiler option Reported-by: Civil <civil.over@gmail.com> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-09-01Add CFLAGS to compile mips purgatoryMaxim Uvarov
Required in case if "-mabi=64" option was specified to build 64 bit mips application, if not compiler tries to link 64 bit binaries with 32 bit system libraries. Signed-off-by: Maxim Uvarov <muvarov@gmail.com> 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-10-08Only use -fno-zero-initialized-in-bss if it is availableSimon Horman
As pointed out by Edgar E. Iglesias, the -fno-zero-initialized-in-bss option to gcc is not available in the cris 3.2.1 toolchain. Signed-off-by: Simon Horman <horms@verge.net.au>
2008-03-24Use separate CPPFLAGS and LDFLAGS for purgatoryJeremy Kerr
Currently, CPPFLAGS and LDFLAGS can 'leak' into the purgatory build from the main kexec/kexec object. Because of this, the purgatory is build with -lz, but we may not have a zlib present for the architecture of the purgatory object. This change uses fresh CPPFLAGS and LDFLAGS for the purgatory object. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> 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>
2008-03-06kexec-tools: mipsel: Update mipsel port for recent build changesSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2008-02-21Only include needed files in distribution tarballSimon Horman
With the recent build changes a number of unneded files crept into tarballs, including .o and .d files. This patch is farily verbose, but hopefully in the long run this system will be obvious enough to be maintainable. Signed-off-by: Simon Horman <horms@verge.net.au>
2008-02-19kexec: Use target linker for purgatoryGeoff Levand
Pugatory files need to be linked with the target linker, not the build linker. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19make clean cleanupJeremy Kerr
Use a $(clean) variable to store all items that need to be removed on 'make clean' (eg, .o files). Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au> Conflicts: Makefile.in
2007-12-19Use general _SRCS and _OBJS, rather and _C_{SRCS, OBJS} and _S_{SRCS, OBJS}Jeremy Kerr
Since we use the implicit ruls for .c and .S, just colelct all sources in the one variable. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19Build system simplification/standardisationJeremy Kerr
This change makes kexec-tools work more like a standard configure-make- make-install-type project: * Remove $(OBJDIR) stuff. To do an out-of-tree build, just configure from a different directory. * Use the implicit Makefile rules more, and just edit the compiler flags for specific targets. * Simplify compiler/linker flags - no need for EXTRA_* * Add TARGET_CC, and improve checks for BUILD_CC too. * Set arch-specific flags in arch-specific makefiles, not conditional on $(ARCH). * Generate dependency files in the main compile, rather than as a separate step. * Don't #include sha256.c, but re-build it into the purgatory. Still a work-in-progress. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2006-10-06build-cpp-and-ld-flagsSimon Horman
[BUILD] CPPFLAGS, CFLAGS and LDFLAGS fixes * Set internal CPPFLAGS as EXTRA_CPPFLAGS, CFLAGS as EXTRA_CFLAGS, and LDFLAGS as EXTRA_LDFLAGS - Don't overwrite CPPFLAGS, LDLFAGS or CFLAGS from the environment - They are irrelevant for BUILD_CC - When cross-compiling for a ppc64 host on a non-ppc64 host, EXTRA_CFLAGS, which is included in BUILD_CPPFLAGS contains -mcall-aixdesc, which does not work on i386 at least * Use LDFLAGS when linking kexec - Append rather than overwrite in purgatory/Makefile The purpose of these changes is three-fold. * CPPFLAGS, CFLAGS and LDFLAGS from the environment really ought to be honoured. For one thing; * Without these changes, the confgiure taget in the toplevel makefile can't work * Without these changes, cross compiling does not work - well, I can't work out how to get it to work anyway. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-07-27ppc64 kdump purgatory backup supportR Sharada
This patch implements the purgatory support to take backup of the first 32KB of the first kernel - Modified the v2wrap code to make the secondary cpus spin directly in the v2wrap after pulling them out of kexec_wait - Use the elf_rel function support to set the various symbols used in purgatory - load device-tree as a separate segment - other miscellaneous compiler warnings cleanup - add purgatory code support for backup - build purgatory as relocatable for ppc64 Signed-off-by: R Sharada <sharada@in.ibm.com> Signed-off-by: Mohan Kumar M <mohan@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
2006-07-27build v2wrap from purgatoryR Sharada
This patch builds v2wrap from within purgatory Signed-off-by: Mohan Kumar <mohan@in.ibm.com> Signed-off-by: R Sharada <sharada@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