linux/arch/powerpc
Masahiro Yamada 9e005b761e powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h
The next commit will make the way of passing CONFIG options more robust.
Unfortunately, it would uncover another hidden issue; without this
commit, skiroot_defconfig would be broken like this:

|   WRAP    arch/powerpc/boot/zImage.pseries
| arch/powerpc/boot/wrapper.a(decompress.o): In function `bcj_powerpc.isra.10':
| decompress.c:(.text+0x720): undefined reference to `get_unaligned_be32'
| decompress.c:(.text+0x7a8): undefined reference to `put_unaligned_be32'
| make[1]: *** [arch/powerpc/boot/Makefile;383: arch/powerpc/boot/zImage.pseries] Error 1
| make: *** [arch/powerpc/Makefile;295: zImage] Error 2

skiroot_defconfig is the only defconfig that enables CONFIG_KERNEL_XZ
for ppc, which has never been correctly built before.

I figured out the root cause in lib/decompress_unxz.c:

| #ifdef CONFIG_PPC
| #      define XZ_DEC_POWERPC
| #endif

CONFIG_PPC is undefined here in the ppc bootwrapper because autoconf.h
is not included except by arch/powerpc/boot/serial.c

XZ_DEC_POWERPC is not defined, therefore, bcj_powerpc() is not compiled
for the bootwrapper.

With the next commit passing CONFIG_PPC correctly, we would realize that
{get,put}_unaligned_be32 was missing.

Unlike the other decompressors, the ppc bootwrapper duplicates all the
necessary helpers in arch/powerpc/boot/.

The other architectures define __KERNEL__ and pull in helpers for
building the decompressors.

If ppc bootwrapper had defined __KERNEL__, lib/xz/xz_private.h would
have included <asm/unaligned.h>:

| #ifdef __KERNEL__
| #       include <linux/xz.h>
| #       include <linux/kernel.h>
| #       include <asm/unaligned.h>

However, doing so would cause tons of definition conflicts since the
bootwrapper has duplicated everything.

I just added copies of {get,put}_unaligned_be32, following the
bootwrapper coding convention.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190705100144.28785-1-yamada.masahiro@socionext.com
2019-07-10 13:20:44 +10:00
..
boot powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h 2019-07-10 13:20:44 +10:00
configs powerpc: Enable CONFIG_IPV6 in ppc64_defconfig 2019-07-04 21:04:06 +10:00
crypto treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
include powerpc: Move PPC_HA() PPC_HI() and PPC_LO() to ppc-opcode.h 2019-07-06 00:29:50 +10:00
kernel powerpc/irq: Don't WARN continuously in arch_local_irq_restore() 2019-07-10 13:20:43 +10:00
kvm powerpc/book3s: Use config independent helpers for page table walk 2019-07-05 00:43:50 +10:00
lib powerpc/64: flush_inval_dcache_range() becomes flush_dcache_range() 2019-07-05 01:35:10 +10:00
math-emu powerpc: math-emu: remove unneeded header search paths 2019-01-14 20:39:27 +11:00
mm powerpc/64: flush_inval_dcache_range() becomes flush_dcache_range() 2019-07-05 01:35:10 +10:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2019-03-16 12:20:08 -07:00
oprofile Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
perf powerpc/perf/24x7: use rb_entry 2019-07-04 17:09:37 +10:00
platforms powerpc/8xx: Add microcode patch to move SMC parameter RAM. 2019-07-05 02:06:38 +10:00
purgatory powerpc: disable KASAN instrumentation on early/critical files. 2019-05-03 01:20:26 +10:00
sysdev powerpc/8xx: move CPM1 related files from sysdev/ to platforms/8xx 2019-07-05 02:06:37 +10:00
tools powerpc/tools/checkpatch: Ignore DT_SPLIT_BINDING_PATCH 2018-12-04 19:45:01 +11:00
xmon powerpc/book3s: Use config independent helpers for page table walk 2019-07-05 00:43:50 +10:00
Kbuild powerpc: Add -Werror at arch/powerpc level 2018-10-19 00:56:17 +11:00
Kconfig powerpc/boot: Add lzo support for uImage 2019-07-05 02:06:38 +10:00
Kconfig.debug powerpc/xmon: add read-only mode 2019-05-03 02:54:57 +10:00
Makefile treewide: prefix header search paths with $(srctree)/ 2019-05-18 11:49:57 +09:00
Makefile.postlink