Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xtensa: fix default kernel load address

Make default kernel load address 0xd0003000 for MMUv2 cores and
0x60003000 for noMMU cores. Don't initialize MMU inside vmlinux for
predefined MMUv2 cores (it's noop anyway).

This fixes the following defconfig build error:
arch/xtensa/kernel/built-in.o: In function `fast_alloca':
(.text+0x99a): dangerous relocation: j: cannot encode: _WindowUnderflow12
arch/xtensa/kernel/built-in.o: In function `fast_alloca':
(.text+0x99d): dangerous relocation: j: cannot encode: _WindowUnderflow8
arch/xtensa/kernel/built-in.o: In function `fast_alloca':
(.text+0x9a0): dangerous relocation: j: cannot encode: _WindowUnderflow4
arch/xtensa/kernel/built-in.o: In function `window_overflow_restore_a0_fixup':
(.text+0x23a3): dangerous relocation: j: cannot encode: (.DoubleExceptionVector.text+0x104)
arch/xtensa/kernel/built-in.o: In function `window_overflow_restore_a0_fixup':
(.text+0x23c1): dangerous relocation: j: cannot encode: (.DoubleExceptionVector.text+0x104)
arch/xtensa/kernel/built-in.o: In function `window_overflow_restore_a0_fixup':
(.text+0x23dd): dangerous relocation: j: cannot encode: (.DoubleExceptionVector.text+0x104)

With this change all xtensa defconfigs build correctly.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

+4 -2
+4 -2
arch/xtensa/Kconfig
··· 212 212 213 213 config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX 214 214 bool "Initialize Xtensa MMU inside the Linux kernel code" 215 - default y 215 + default y if XTENSA_VARIANT_DC233C || XTENSA_VARIANT_CUSTOM 216 216 help 217 217 Earlier version initialized the MMU in the exception vector 218 218 before jumping to _startup in head.S and had an advantage that ··· 254 254 255 255 config KERNEL_LOAD_ADDRESS 256 256 hex "Kernel load address" 257 - default 0x00003000 257 + default 0x60003000 if !MMU 258 + default 0x00003000 if MMU && INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX 259 + default 0xd0003000 if MMU && !INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX 258 260 help 259 261 This is the address where the kernel is loaded. 260 262 It is virtual address for MMUv2 configurations and physical address