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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 752FDC5B572 for ; Tue, 11 Aug 2026 14:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J1Z78TEARAUt28Nj5AzN9ZydcmZVT/uTPf+fmKTQyug=; b=4JywukVh4otQAMeFmHVgNG0jSe z/8iB7Mo8frvNHx6RgeJWh7n/V14hTKyiUFg2bB1hIRJjXsctGExJB2eTjVWdZK71ln9jQ3ytrHtm SmYRjbjXXamtDp30WsigCC/XyRfmxjn81fRWrJDenJYGgbUQ2W6zxxpVlF6MbF0CqoibpLkpjYlOF W9k36snCvVoQu1AN4pedwlcfwgCutD2+Yrrcwe9CHY+GrTeIwN2HTXXAWxvXEzLvj+xw4aOI5ZEQD j63+0e3e3BYFfLRQmY7WYHnsc7JP30c+KMi8Ryb38cI0heejB4e1H6cl35Trk2GPUvSdaMTLRMmEo CLBIKSKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wtn3C-0000000E9P4-2ikR; Tue, 11 Aug 2026 14:01:54 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wtn3A-0000000E9O6-1qho for linux-arm-kernel@lists.infradead.org; Tue, 11 Aug 2026 14:01:52 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id D94ED6011F; Tue, 11 Aug 2026 14:01:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3688A1F00A3E; Tue, 11 Aug 2026 14:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786456911; bh=J1Z78TEARAUt28Nj5AzN9ZydcmZVT/uTPf+fmKTQyug=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YY0QBNa2RGTQCg84BKmW/nQ7TCLnm+59uE1OaKQVJ6/YvJvp17mKSmiNEU4pE5BmX Kk2YgyiRm8VWhJkP0qi4ohxXKFRp0d/X+Z130mMH4J2DWHkToZhnfEJy2gMMhvOAXe 71OeoAkWd3bKMVgF3hJUlsYcQ9DfH/bHimvvVyVxPiv4wrO8ZW8LNmO9TxEP/s0ALA erRE1W6ie8EXR4jltfWOZdswE42sMPC2lbpnPWyV5PdaltllgoIcd4B6fieCXNCMIl XwtDdwRJ088LufEI42ZF2e5zDFjsNWbgCrr1HiRD6ftzllfZ6ssI9hgW5jYb/6l3TK tiBeR3YucwTRw== 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 04/12] arm64: lib: Assume a little-endian kernel in custom library routines Date: Tue, 11 Aug 2026 15:01:23 +0100 Message-ID: <20260811140132.22778-5-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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 5276ea17a23c ("lib/crc: arm64: Assume a little-endian kernel") removed all usage of the CPU_LE()/CPU_BE() macros from the arm64 CRC assembly now that big-endian support depends on BROKEN. Do the same for the rest of the custom arm64 library code, as well as removing all usage of the '__LITTLE_ENDIAN' macro. Signed-off-by: Will Deacon --- arch/arm64/lib/csum.c | 17 ----------------- arch/arm64/lib/memchr.S | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/arch/arm64/lib/csum.c b/arch/arm64/lib/csum.c index 2432683e48a6..75db718e5b6a 100644 --- a/arch/arm64/lib/csum.c +++ b/arch/arm64/lib/csum.c @@ -47,11 +47,7 @@ unsigned int __no_sanitize_address do_csum(const unsigned char *buff, int len) */ shift = offset * 8; data = *ptr++; -#ifdef __LITTLE_ENDIAN data = (data >> shift) << shift; -#else - data = (data << shift) >> shift; -#endif /* * Body: straightforward aligned loads from here on (the paired loads @@ -94,13 +90,8 @@ unsigned int __no_sanitize_address do_csum(const unsigned char *buff, int len) len -= 16; ptr += 2; -#ifdef __LITTLE_ENDIAN data = tmp >> 64; sum64 = accumulate(sum64, tmp); -#else - data = tmp; - sum64 = accumulate(sum64, tmp >> 64); -#endif } if (len > 0) { sum64 = accumulate(sum64, data); @@ -112,11 +103,7 @@ unsigned int __no_sanitize_address do_csum(const unsigned char *buff, int len) * preserving odd/even alignment. */ shift = len * -8; -#ifdef __LITTLE_ENDIAN data = (data << shift) >> shift; -#else - data = (data >> shift) << shift; -#endif sum64 = accumulate(sum64, data); /* Finally, folding */ @@ -140,11 +127,7 @@ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, dst = *(const __uint128_t *)daddr->s6_addr; sum += (__force u32)htonl(len); -#ifdef __LITTLE_ENDIAN sum += (u32)proto << 24; -#else - sum += proto; -#endif src += (src >> 64) | (src << 64); dst += (dst >> 64) | (dst << 64); diff --git a/arch/arm64/lib/memchr.S b/arch/arm64/lib/memchr.S index 37a9f2a4f7f4..b14b27cb8419 100644 --- a/arch/arm64/lib/memchr.S +++ b/arch/arm64/lib/memchr.S @@ -63,7 +63,7 @@ L(byte_loop): sub srcin, srcin, #1 ret L(found_word): -CPU_LE( rev tmp, tmp) + rev tmp, tmp clz tmp, tmp sub tmp, tmp, #64 add result, srcin, tmp, asr #3 -- 2.55.0.679.g6767b8d81c-goog