From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCB2D44AB6A for ; Tue, 11 Aug 2026 14:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786456919; cv=none; b=k9t8YS3KcoH5+ief+E1pqaZ4Pwe/T8Hq/x0F5M1ynTcDd6UE+F/sqtVyp4EHuA7fCHDo5I/GdSQdHjTgE5UZwYpRVdqtXdpNGkJE1R0YAU0lHzZ8mF4wO1hpya9rF4cOnruCqRk2mYgCRPvY4Ai4IHwjO1jjvjZe7fsPesiCqTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786456919; c=relaxed/simple; bh=eSXN986EAO4f5Fwy6o1NQC5JvuXyuiuMeSjN9li/yuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KHdFERNfc8ACxTkSWPGg27AhSm7rOjaQvUtyw5Dolj6qBc7HkVVgXFf47ZXMVlWUGWtFGNaKbo+OdXXpb2judy6v2Yjew6eWNx9YakkIkz3dDdSGccgq+qaGGYOFQeTU4aJqZJ1y00wtR5WgANJaaOvEmf2j/d/Y04l9LiPjshk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SpdsE61K; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SpdsE61K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 369A01F00A3A; Tue, 11 Aug 2026 14:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786456917; bh=OVtoFL/X2Cg8V2fpSt9ioOxaBxnq9YunbAkI7H2qxik=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SpdsE61K1u0jLCWh6kUs1baLWdTEdZztiAz2wKLlQ00BASOUNsUVApf1NasS+wcra e+9bAYX0iaUPE3tOXc69ijfVRge67ZBEssLsKc01W223y1huZVK8Cdtyu8SHkSIwM+ RyhlgqpnUgsdMHulcDvrVtUh4KS4VEjpO2IHkNf3HAnxBuXeGR3Jv1yU38uVZSR5lO nUM8TWVsBflIBX0dsO3gIyd5uO3PZKlV0uYYmBl+p2jkuqWIy0mKUu8Uq/PPlfccZy iFLeyn8Fwyxql88EK190MjZWqrbPem2af0oCXjXq1HrmfQtgGSNAGw443+m42MAEJC t9jy0+xxQSttg== From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Will Deacon , Arnd Bergmann , Ard Biesheuvel , Eric Biggers , Daniel Borkmann , Catalin Marinas , Alexei Starovoitov , Oliver Upton , Herbert Xu , Marc Zyngier Subject: [PATCH 06/12] arm64: assembler: Remove endianness helper macros Date: Tue, 11 Aug 2026 15:01:25 +0100 Message-ID: <20260811140132.22778-7-will@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260811140132.22778-1-will@kernel.org> References: <20260811140132.22778-1-will@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The CPU_LE()/CPU_BE() helper macros are only used by head.S. Since big-endian support depends on BROKEN, remove the last users along with the macro definitions. The unused regs_to_64() assembly macro, which somewhat bizarrely behaves differently depend on the endianness, is also removed. Signed-off-by: Will Deacon --- arch/arm64/include/asm/assembler.h | 31 ------------------------------ arch/arm64/kernel/head.S | 3 +-- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index effae53e9739..45279e577ff5 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -133,37 +133,6 @@ lr .req x30 // link register b \label .endm -/* - * Select code when configured for BE. - */ -#ifdef CONFIG_CPU_BIG_ENDIAN -#define CPU_BE(code...) code -#else -#define CPU_BE(code...) -#endif - -/* - * Select code when configured for LE. - */ -#ifdef CONFIG_CPU_BIG_ENDIAN -#define CPU_LE(code...) -#else -#define CPU_LE(code...) code -#endif - -/* - * Define a macro that constructs a 64-bit value by concatenating two - * 32-bit registers. Note that on big endian systems the order of the - * registers is swapped. - */ -#ifndef CONFIG_CPU_BIG_ENDIAN - .macro regs_to_64, rd, lbits, hbits -#else - .macro regs_to_64, rd, hbits, lbits -#endif - orr \rd, \lbits, \hbits, lsl #32 - .endm - /* * Pseudo-ops for PC-relative adr/ldr/str , where * is within the range +/- 4 GB of the PC. diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 87a822e5c4ca..8951ce693552 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -138,8 +138,7 @@ SYM_CODE_START_LOCAL(record_mmu_state) b.ne 0f mrs x19, sctlr_el2 0: -CPU_LE( tbnz x19, #SCTLR_ELx_EE_SHIFT, 1f ) -CPU_BE( tbz x19, #SCTLR_ELx_EE_SHIFT, 1f ) + tbnz x19, #SCTLR_ELx_EE_SHIFT, 1f tst x19, #SCTLR_ELx_C // Z := (C == 0) and x19, x19, #SCTLR_ELx_M // isolate M bit csel x19, xzr, x19, eq // clear x19 if Z -- 2.55.0.679.g6767b8d81c-goog