From patchwork Mon Jul 19 14:54:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 480014 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4280880jao; Mon, 19 Jul 2021 09:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw0l5V3zPE6yJQgMSb3IPtWx9+QS5JtbM7fHKClEdPMFP12yFIkLLk7qW6IWJPujJHGA0A X-Received: by 2002:aa7:d84f:: with SMTP id f15mr29539441eds.216.1626711776392; Mon, 19 Jul 2021 09:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626711776; cv=none; d=google.com; s=arc-20160816; b=lXO5T6kLS7s16b9xP61lFag+ohFEhqbYSVPPdzX7mIO1rXn2Z/C9/fIf5Yj5VCoqqv Lova7WXvZqFRjj0bMA9lcjO121gObv+Xzx7XTpZ/n8tFL0SB05BsR/99b6XnyLi6kg+g BMVvMhRJUGKOX1Agrmp6ZpNu/MzxaUkcu5pfQudBR1AFqutSzXBuos9MZby1N/tgsHZ/ 5egq4hziQHas2Pqrsi4uWXOoArC+8BGn2BJOTXSvA7y3TJKHff/v9pGYU/3FzIFpu+9n rPZh3zBDNmTiRb+OIl3U7PSk4tw8TooG7I1z8u3uBCtsjOwlKqHGNYLRphQLxEwaveNI Jo4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DiVER1TA80LljV48Rh3KM6VDlgDeciCVH9zVZdYS+m8=; b=dWmUvdyj8JyG9KU0+hlcJS1V8ZQhNkJGqt+vs54JzMyjHXxWIcV/7HDueWOuvEq6fd Q+NrdsPTrN9siL9h65Yj/9axinbcpIfMsgizkbtSWJpHLfsOx4ArchkAzfaXFP6qwx9X x0UnvSwBTRI1rlYvqaKhSp0zojzVi8u5hIkl+0gAAsO6UnUe8MBwR+PW4Ab2+AmyqOLu eeDr2YwvyAB3k6h1wPx6xPrzUIq6EW60IxgZblsrbTmMDMaxDQXjMzuOtL0dOM+GscPt exMRvbxqLIIkLhrcMmmy9P6xMNOFJ9bDWAE7D0VofYuWSmMLc+WrWMkmWE6fCXGGin8t WYBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BKx5/Zzk"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la14si22045543ejc.142.2021.07.19.09.22.56; Mon, 19 Jul 2021 09:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BKx5/Zzk"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346438AbhGSPk2 (ORCPT + 12 others); Mon, 19 Jul 2021 11:40:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:33486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349748AbhGSPgL (ORCPT ); Mon, 19 Jul 2021 11:36:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C4C560E0C; Mon, 19 Jul 2021 16:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711409; bh=mJFotw5b5sRxe//OhAGzSEhfZWxiZqOXxpSEmTOA7+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BKx5/ZzkHaNlDQ/0WkP53XlJ8pBLBxZgB4Jz4uD5rgpivu17rkrLADODpNcfolHJN EXIZ7E/DhcXo3TGPXKRjOXcYhEcXsQ1r6Za28KxPY4olsT4/16FAXyRscKGy3y8gE8 kCJzEKrhmH0hiOugRnJTKD/bGO1BMZp8AftS9mM4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.13 342/351] mips: always link byteswap helpers into decompressor Date: Mon, 19 Jul 2021 16:54:48 +0200 Message-Id: <20210719144956.383180893@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144944.537151528@linuxfoundation.org> References: <20210719144944.537151528@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit cddc40f5617e53f97ef019d5b29c1bd6cbb031ec ] My series to clean up the unaligned access implementation across architectures caused some mips randconfig builds to fail with: mips64-linux-ld: arch/mips/boot/compressed/decompress.o: in function `decompress_kernel': decompress.c:(.text.decompress_kernel+0x54): undefined reference to `__bswapsi2' It turns out that this problem has already been fixed for the XZ decompressor but now it also shows up in (at least) LZO and LZ4. From my analysis I concluded that the compiler could always have emitted those calls, but the different implementation allowed it to make otherwise better decisions about not inlining the byteswap, which results in the link error when the out-of-line code is missing. While it could be addressed by adding it to the two decompressor implementations that are known to be affected, but as this only adds 112 bytes to the kernel, the safer choice is to always add them. Fixes: c50ec6787536 ("MIPS: zboot: Fix the build with XZ compression on older GCC versions") Fixes: 0652035a5794 ("asm-generic: unaligned: remove byteshift helpers") Link: https://lore.kernel.org/linux-mm/202106301304.gz2wVY9w-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202106260659.TyMe8mjr-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202106172016.onWT6Tza-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202105231743.JJcALnhS-lkp@intel.com/ Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/boot/compressed/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index e4b7839293e1..3548b3b45269 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -40,7 +40,7 @@ GCOV_PROFILE := n UBSAN_SANITIZE := n # decompressor objects (linked with vmlinuz) -vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o +vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o ifdef CONFIG_DEBUG_ZBOOT vmlinuzobjs-$(CONFIG_DEBUG_ZBOOT) += $(obj)/dbg.o @@ -54,7 +54,7 @@ extra-y += uart-ath79.c $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c $(call cmd,shipped) -vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o +vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o extra-y += ashldi3.c $(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE