From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBD6DC433F4 for ; Wed, 19 Sep 2018 06:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9983020880 for ; Wed, 19 Sep 2018 06:52:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9983020880 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731106AbeISM3I (ORCPT ); Wed, 19 Sep 2018 08:29:08 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:63098 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731062AbeISM3I (ORCPT ); Wed, 19 Sep 2018 08:29:08 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42FVsx3Rszz9ttG0; Wed, 19 Sep 2018 08:52:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id gRUbHO1cf9HE; Wed, 19 Sep 2018 08:52:37 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42FVsx2rMjz9ttFP; Wed, 19 Sep 2018 08:52:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 651E88B81F; Wed, 19 Sep 2018 08:52:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 8qzgThk6o5jE; Wed, 19 Sep 2018 08:52:37 +0200 (CEST) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2E51F8B776; Wed, 19 Sep 2018 08:52:37 +0200 (CEST) Subject: Re: [PATCH] lib/xz: Fix powerpc build with KERNEL_XZ To: Oliver Cc: Joel Stanley , Krzysztof Kozlowski , linuxppc-dev , Herbert Xu , Linux Kernel Mailing List References: <20180918230756.26035-1-joel@jms.id.au> From: Christophe LEROY Message-ID: <6882aff7-eb33-b53c-3ff4-d4c327d4f589@c-s.fr> Date: Wed, 19 Sep 2018 08:52:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 19/09/2018 à 08:44, Oliver a écrit : > On Wed, Sep 19, 2018 at 3:52 PM, Christophe LEROY > wrote: >> >> >> Le 19/09/2018 à 01:07, Joel Stanley a écrit : >>> >>> This partially reverts faa16bc404d72a5 ("lib: Use existing define with >>> polynomial"). >>> >>> The cleanup added a dependency on include/linux, which broke the PowerPC >>> boot wrapper/decompresser when KERNEL_XZ is enabled: >>> >>> BOOTCC arch/powerpc/boot/decompress.o >>> In file included from >>> arch/powerpc/boot/../../../lib/decompress_unxz.c:233, >>> from arch/powerpc/boot/decompress.c:42: >>> arch/powerpc/boot/../../../lib/xz/xz_crc32.c:18:10: fatal error: >>> linux/crc32poly.h: No such file or directory >>> #include >>> ^~~~~~~~~~~~~~~~~~~ >>> >>> The powerpc decompressor is a hairy corner of the kernel. Even while >>> building >>> a 64-bit kernel it needs to build a 32-bit binary and therefore avoid >>> including >>> files from include/linux. >>> >>> Fixes: faa16bc404d7 ("lib: Use existing define with polynomial") >>> Signed-off-by: Joel Stanley >>> --- >>> We need to clean up the powerpc boot decompresser but that work will be >>> more involved than we would include in a late -rc. Please consider >>> merging this fix for 4.19. Thanks! >>> >>> lib/xz/xz_crc32.c | 3 +-- >>> 1 file changed, 1 insertion(+), 2 deletions(-) >>> >>> diff --git a/lib/xz/xz_crc32.c b/lib/xz/xz_crc32.c >>> index 25a5d87e2e4c..34532d14fd4c 100644 >>> --- a/lib/xz/xz_crc32.c >>> +++ b/lib/xz/xz_crc32.c >>> @@ -15,7 +15,6 @@ >>> * but they are bigger and use more memory for the lookup table. >>> */ >>> -#include >>> #include "xz_private.h" >>> /* >>> @@ -30,7 +29,7 @@ STATIC_RW_DATA uint32_t xz_crc32_table[256]; >>> XZ_EXTERN void xz_crc32_init(void) >>> { >>> - const uint32_t poly = CRC32_POLY_LE; >>> + const uint32_t poly = 0xEDB88320; >> >> >> Maybe avoid capital letters ? >> >> What about adding something like the following in xz_private.h instead: >> >> #define CRC32_POLY_LE 0xedb88320 > > The problem is that it's pulling in linux/crc32poly.h. To support old > systems with a 32bit Open Firmware we boot wrapper we build the boot > wrapper as a 32bit ELF even for a 64 bit kernel. The headers generated > by Kbuild are only valid for the 64bit kernel so we have to avoid > pulling them into the boot wrapper. Yes I understood, hence my proposal to redefine CRC32_POLY_LE in xz_private.h instead of including linux/crc32poly.h It avoids modifying the C code. Christophe > >> Christophe >> >>> uint32_t i; >>> uint32_t j; >>> >>