powerpc/64: option to force run-at-load to test relocation
Nicholas Piggin
reviewerPATCH v2 1/1 powerpc/64: option to force run-at-load to test relocation
This adds a config option that can help exercise the case when the kernel is not running at PAGE_OFFSET.
Signed-off-by Nicholas Piggin <[email protected]>
---
Changes since v1:
- Improved style as suggested by Balbir and Michael
arch/powerpc/Kconfig | 9 +++++++++ arch/powerpc/kernel/head_64.S | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig +9 -0
@@ -478,6 +478,15 @@ config RELOCATABLE setting can still be useful to bootwrappers that need to know the load address of the kernel (eg. u-boot/mkimage). +config RELOCATABLE_TEST + bool "Test relocatable kernel" + depends on (PPC64 && RELOCATABLE) + default n + help + This runs the relocatable kernel at the address it was initially + loaded at, which tends to be non-zero and therefore test the + relocation code. + config CRASH_DUMP bool "Build a kdump crash kernel" depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP)
arch/powerpc/kernel/head_64.S +7 -1
@@ -107,11 +107,17 @@ __secondary_hold_acknowledge: * observing the alignment requirement. */ /* Do not move this variable as kexec-tools knows about it. */ +#ifdef CONFIG_RELOCATABLE_TEST +#define RUN_AT_LOAD_DEFAULT 1 /* Test relocation, do not copy to 0 */ +#else +#define RUN_AT_LOAD_DEFAULT 0x72756e30 /* "run0" -- relocate to 0 by default */ +#endif + . = 0x5c .globl __run_at_load __run_at_load: DEFINE_FIXED_SYMBOL(__run_at_load) - .long 0x72756e30 /* "run0" -- relocate to 0 by default */ + .long RUN_AT_LOAD_DEFAULT #endif . = 0x60
Signature · 1 line
2.9.3
Quoted 5 lines · Nicholas Piggin
This adds a config option that can help exercise the case when the kernel is not running at
PAGE_OFFSET.Signed-off-by Nicholas Piggin <[email protected]>---
Reviewed-by Balbir Singh <[email protected]>
Michael Ellerman
AppliedQuoted 5 lines · Nicholas Piggin
This adds a config option that can help exercise the case when the kernel is not running at
PAGE_OFFSET.Signed-off-by Nicholas Piggin <[email protected]>Reviewed-by Balbir Singh <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/70839d207792aa348f013c733e8853
cheers