From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
linuxppc-dev@lists.ozlabs.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
Paul Mackerras <paulus@samba.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h
Date: Thu, 11 Jul 2019 01:05:29 +1000 (AEST) [thread overview]
Message-ID: <45kMtx2lmXz9sPj@ozlabs.org> (raw)
In-Reply-To: <20190705100144.28785-1-yamada.masahiro@socionext.com>
On Fri, 2019-07-05 at 10:01:43 UTC, Masahiro Yamada wrote:
> 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>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/9e005b761e7ad153dcf40a6cba1d681fe0830ac6
cheers
prev parent reply other threads:[~2019-07-10 15:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-05 10:01 [PATCH v3 1/2] powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h Masahiro Yamada
2019-07-05 10:01 ` [PATCH v3 2/2] powerpc/boot: pass CONFIG options in a simpler and more robust way Masahiro Yamada
2019-07-10 15:05 ` Michael Ellerman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45kMtx2lmXz9sPj@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).