Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9309130ybi; Wed, 10 Jul 2019 08:08:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdgMHCUZlabWD/GcyI4iTFgny5a0L9mWgBafqg6+rVt8OSGsckVdDGPkr3HVGy/sN/b3Cm X-Received: by 2002:a17:902:9897:: with SMTP id s23mr39241002plp.47.1562771295204; Wed, 10 Jul 2019 08:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562771295; cv=none; d=google.com; s=arc-20160816; b=VqDB4C3Iu+YCSfRSCZU2PsDD1wD+jRTm+brZAU5gNhBBKZbJmn528Umlx5r/TixtPj xYnqDI4wBgoS9wW702BH7DH5BxHYiaDAiJpeT0rwd3rD+v5ZK6US/Ri7zLNdxgU05p8I ghakD9F0AH0MFKwscUrKB+11aeA/PaiBFNkbz/pigA6sr8UK6S++Ci0MFBrHPKIhg1mf CwO74zWD2iWDk6AawUxcSrW7Y7FGv1DHAUK+xKi2FHrd+vMtN1qmGQpnoraDyDX1/VA5 nNY3AA/eHR8yiFr3GjDWWxBD2OWQS6zvvEFex0M6K8krzWMazkwYQSd77da3eqd2S0y9 B/2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to; bh=6B/OE4ieqjHtagFl4HQ2Qu/STUMCcmDBQjdZVm7FZYc=; b=Jdceu4S2Q8wxqKm7CLOahRPS6wCbl1otoVGB4nLlXohgwjRJwGqXTgZ/cZyQYcJOLe BPk4QLwewTafhWjcUIP8VjkySuIWWoA/d96qeRmGBvMRpg25J5B8jRKLi5yvD4L+hrRf u4wW4iqQCozo9OFURd2Y8UaJgqnhGuqEgesZ+OJjLoy4WvEgepz1j3i9NJLi+y6lx1br EZ/jitlp2uxu5wJaeDat52P753jxTkGwfkj4bRUfsM6bfVGcu2+4ymVmXBRT+kPMX57v /JqOtPISrl8uHwb5AvW+MdFW2PZdT5Yik9rxnSOvzcTR1oGWkJB4vwVKR6Qv2sDmX039 SJIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si2326122pfi.139.2019.07.10.08.07.59; Wed, 10 Jul 2019 08:08:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728454AbfGJPFf (ORCPT + 99 others); Wed, 10 Jul 2019 11:05:35 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:35147 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728254AbfGJPFb (ORCPT ); Wed, 10 Jul 2019 11:05:31 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 45kMtx2lmXz9sPj; Thu, 11 Jul 2019 01:05:29 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 9e005b761e7ad153dcf40a6cba1d681fe0830ac6 In-Reply-To: <20190705100144.28785-1-yamada.masahiro@socionext.com> To: Masahiro Yamada , linuxppc-dev@lists.ozlabs.org From: Michael Ellerman Cc: Masahiro Yamada , Paul Mackerras , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h Message-Id: <45kMtx2lmXz9sPj@ozlabs.org> Date: Thu, 11 Jul 2019 01:05:29 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 : > > | #ifdef __KERNEL__ > | # include > | # include > | # include > > 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 Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/9e005b761e7ad153dcf40a6cba1d681fe0830ac6 cheers