From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380545; b=pWfi35SJQRxj/uFrDRJUMAGQGL/wJsMwci1FClFsXFbnjyze5c6fntgzbpJvLjDCMuVB Nt3AIJnLpVYzR3Yr9Q0PX6jnBVy2SD+UtXYaaElb4K3eNpURWA0IQQGEWOmOsVxix+ltl rQ4wu/nt6GsBuWkIB+zSjZz2BhZt1gU1f0n4u4UP/0zOsWGcTX+51P1ijUNBb042gtXw3 5zyeHFfjvcZoaSuB3PE7GD7Jnb7qkWGsZZKTS5zTww+d3lffcW/TJs+f6x69RGIf37FrS 4tqu00n+xZJ8UHpQ3kq6GRIJWkUimfTF2NYI8hMI72nXq7qU5w5nvjdgbF++mNYegig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380545; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=jlYu6i4wz9cUGB6DMngb4I/j8+PeaQPbOFTQWUjLVoo=; b=Oiz4mjgC0RI16MHZmWFk2eSQd8G9bNpBO7RzIzoUJSrvbUoGqJiC+lxMVQHcrgpd85Jx dtvxnPgX3nNJb8zxBw2k/BCM4m7oFheVHZPOcU5e3oDHOXi1Aro/eSFE7q6vnZ7YsgAdh MRR2TIXjzlGRnEE4dbZHnObYMGWHQuXqnZwq8gZgAL5GQ0gviu6F08e+pSiALYdG1UgcD o9q2DNGDhbA1bZxdM8BuVk3CAx/icRUZf9b6pWSUNThreDBKqIcaF1VwOo6fRK2kXZKTc xvAzPpFVFPyZEStyrsy0eu3G/baKdzbJAcqLU+lxFc3GrzzA100JmTuvX07KhmNX1cA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="fXaDF/Sj"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 630B6606A681; Fri, 4 Dec 2026 10:35:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fXaDF/Sj Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDA791F0092C; Fri, 4 Dec 2026 10:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380545; bh=jlYu6i4wz9cUGB6DMngb4I/j8+PeaQPbOFTQWUjLVoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fXaDF/SjzHX3Pwb0KSKsmRWZKuHIjBgUqaZrPHmYWKvgU+jF50OjG1SG8kzELVlPv jGE2AiKpg1Zz5zf/t+NeXCxxWdEiYy548Go861VXXfyL/7O6j3wwTwnfQIc9x0nke9 2D12IzF/4ItLLlmVwOYGH5sjwmkMnPTX7Zz0J3jE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Antipov , kernel test robot , Ard Biesheuvel , Sasha Levin Subject: [PATCH 7.3 321/742] efi/libstub: loongarch: Provide 64-bit integer shift helpers for 32-bit Date: Fri, 4 Dec 2026 19:03:05 +0900 Message-ID: <20261204100643.551548737@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ard Biesheuvel [ Upstream commit fe57062e09bc162be9133695d5f1459c1c0e46c0 ] The EFI stub's copy of lib/cmdline.c performs 64-bit shifts in memparse() [which is never actually called from the stub], and so it needs library routines when running on 32-bit CPUs that lack native instructions for this. The LoongArch 32-bit EFI stub build already pulls in the library helpers that are needed for this, but only when CONFIG_EFI_ZBOOT=y, which is not sufficient, given that the same helpers will be needed in the vmlinux build for the builtin copy of the EFI stub. On other architectures, the builtin copy will call vmlinux's versions of those routines, which are exposed to the stub via aliases in the linker script. However, on LoongArch, those are C implementations that may be instrumented and therefore unsuitable for use in the EFI stub. Reported-by: Dmitry Antipov Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/20261122125352.gAcg5yLx-lkp@intel.com/ Fixes: 3d9aba6618d1 ("LoongArch: Adjust build infrastructure for 32BIT/64BIT") Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin --- drivers/firmware/efi/libstub/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 48982d05c441e..9d4c28857457a 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -86,7 +86,9 @@ lib-$(CONFIG_ARM64) += kaslr.o arm64.o arm64-stub.o smbios.o lib-$(CONFIG_X86) += x86-stub.o smbios.o lib-$(CONFIG_X86_64) += x86-5lvl.o lib-$(CONFIG_RISCV) += kaslr.o riscv.o riscv-stub.o -lib-$(CONFIG_LOONGARCH) += loongarch.o loongarch-stub.o +lib-loongarch-$(CONFIG_32BIT) += lib-ashldi3.o lib-lshrdi3.o +lib-$(CONFIG_LOONGARCH) += loongarch.o loongarch-stub.o \ + $(lib-loongarch-y) CFLAGS_arm32-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) @@ -97,8 +99,7 @@ CFLAGS_zboot-decompress-zstd.o += -I$(srctree)/lib/zstd zboot-riscv-obj-$(CONFIG_32BIT) := lib-ashldi3.o lib-lshrdi3.o zboot-obj-$(CONFIG_RISCV) += lib-clz_ctz.o $(zboot-riscv-obj-y) -zboot-loongarch-obj-$(CONFIG_32BIT) := lib-ashldi3.o lib-lshrdi3.o -zboot-obj-$(CONFIG_LOONGARCH) += lib-clz_ctz.o $(zboot-loongarch-obj-y) +zboot-obj-$(CONFIG_LOONGARCH) += lib-clz_ctz.o lib-$(CONFIG_EFI_ZBOOT) += zboot.o $(zboot-obj-y) lib-$(CONFIG_UNACCEPTED_MEMORY) += unaccepted_memory.o bitmap.o find.o -- 2.53.0