]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/64: Add an option to force run-at-load to test relocation
authorNicholas Piggin <npiggin@gmail.com>
Fri, 14 Oct 2016 07:31:33 +0000 (18:31 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 14 Nov 2016 00:11:51 +0000 (11:11 +1100)
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 <npiggin@gmail.com>
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/Kconfig
arch/powerpc/kernel/head_64.S

index 8567c68092405c593545b351b9189b4d2bcc6fd8..b49062b060d2027d1af658fff0f81e0a8649c697 100644 (file)
@@ -479,6 +479,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)
index 04c546e20cc05e2db9c3f3022efcc4d2b9a91ee7..451a8e1cf57b649df84561798279e3f3749a7a19 100644 (file)
@@ -107,12 +107,19 @@ __secondary_hold_acknowledge:
         * crash_kernel region.  The loader is responsible for
         * observing the alignment requirement.
         */
+
+#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
+
        /* Do not move this variable as kexec-tools knows about it. */
        . = 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