[PATCH 10/12] arm64: Remove all usage of __AARCH64EB__
From: Will Deacon
Date: Tue Aug 11 2026 - 10:21:34 EST
Big-endian support on arm64 depends on BROKEN. In preparation for
removing the dead code altogether, remove all usage of
__AARCH64EB__ from the arm64 kernel port.
Signed-off-by: Will Deacon <will@xxxxxxxxxx>
---
arch/arm64/include/asm/compat.h | 14 --------------
arch/arm64/include/asm/elf.h | 12 ------------
arch/arm64/include/asm/word-at-a-time.h | 6 ------
arch/arm64/include/uapi/asm/byteorder.h | 4 ----
arch/arm64/kernel/signal32.c | 10 ----------
arch/arm64/mm/extable.c | 5 -----
6 files changed, 51 deletions(-)
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index ae904a1ad529..5e4cc4d2f872 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -28,34 +28,20 @@ typedef u16 compat_ipc_pid_t;
#include <linux/sched.h>
#include <linux/sched/task_stack.h>
-#ifdef __AARCH64EB__
-#define COMPAT_UTS_MACHINE "armv8b\0\0"
-#else
#define COMPAT_UTS_MACHINE "armv8l\0\0"
-#endif
typedef u16 __compat_uid16_t;
typedef u16 __compat_gid16_t;
typedef s32 compat_nlink_t;
struct compat_stat {
-#ifdef __AARCH64EB__
- short st_dev;
- short __pad1;
-#else
compat_dev_t st_dev;
-#endif
compat_ino_t st_ino;
compat_mode_t st_mode;
compat_ushort_t st_nlink;
__compat_uid16_t st_uid;
__compat_gid16_t st_gid;
-#ifdef __AARCH64EB__
- short st_rdev;
- short __pad2;
-#else
compat_dev_t st_rdev;
-#endif
compat_off_t st_size;
compat_off_t st_blksize;
compat_off_t st_blocks;
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index d2779d604c7b..5a0bd3d38b1a 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -72,11 +72,7 @@
* These are used to set parameters in the core dumps.
*/
#define ELF_CLASS ELFCLASS64
-#ifdef __AARCH64EB__
-#define ELF_DATA ELFDATA2MSB
-#else
#define ELF_DATA ELFDATA2LSB
-#endif
#define ELF_ARCH EM_AARCH64
/*
@@ -85,11 +81,7 @@
* intent than poking at uname or /proc/cpuinfo.
*/
#define ELF_PLATFORM_SIZE 16
-#ifdef __AARCH64EB__
-#define ELF_PLATFORM ("aarch64_be")
-#else
#define ELF_PLATFORM ("aarch64")
-#endif
/*
* This is used to ensure we don't load something for the wrong architecture.
@@ -195,11 +187,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
#define STACK_RND_MASK (0x3ffff >> (PAGE_SHIFT - 12))
#endif
-#ifdef __AARCH64EB__
-#define COMPAT_ELF_PLATFORM ("v8b")
-#else
#define COMPAT_ELF_PLATFORM ("v8l")
-#endif
/* AArch32 registers. */
#define COMPAT_ELF_NGREG 18
diff --git a/arch/arm64/include/asm/word-at-a-time.h b/arch/arm64/include/asm/word-at-a-time.h
index 824ca6987a51..d7a3b69dc8c6 100644
--- a/arch/arm64/include/asm/word-at-a-time.h
+++ b/arch/arm64/include/asm/word-at-a-time.h
@@ -7,8 +7,6 @@
#include <linux/uaccess.h>
-#ifndef __AARCH64EB__
-
#include <linux/bitops.h>
#include <linux/wordpart.h>
@@ -36,10 +34,6 @@ static inline unsigned long zero_bytemask(unsigned long bits)
return bits >> 7;
}
-#else /* __AARCH64EB__ */
-#include <asm-generic/word-at-a-time.h>
-#endif
-
/*
* Load an unaligned word from kernel space.
*
diff --git a/arch/arm64/include/uapi/asm/byteorder.h b/arch/arm64/include/uapi/asm/byteorder.h
index ca9cfdab33fc..b078e60f0506 100644
--- a/arch/arm64/include/uapi/asm/byteorder.h
+++ b/arch/arm64/include/uapi/asm/byteorder.h
@@ -17,10 +17,6 @@
#ifndef __ASM_BYTEORDER_H
#define __ASM_BYTEORDER_H
-#ifdef __AARCH64EB__
-#include <linux/byteorder/big_endian.h>
-#else
#include <linux/byteorder/little_endian.h>
-#endif
#endif /* __ASM_BYTEORDER_H */
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c
index 5edcab50f753..3e1ce0b00a68 100644
--- a/arch/arm64/kernel/signal32.c
+++ b/arch/arm64/kernel/signal32.c
@@ -70,22 +70,12 @@ static inline int get_sigset_t(sigset_t *set,
/*
* VFP save/restore code.
- *
- * We have to be careful with endianness, since the fpsimd context-switch
- * code operates on 128-bit (Q) register values whereas the compat ABI
- * uses an array of 64-bit (D) registers. Consequently, we need to swap
- * the two halves of each Q register when running on a big-endian CPU.
*/
union __fpsimd_vreg {
__uint128_t raw;
struct {
-#ifdef __AARCH64EB__
- u64 hi;
- u64 lo;
-#else
u64 lo;
u64 hi;
-#endif
};
};
diff --git a/arch/arm64/mm/extable.c b/arch/arm64/mm/extable.c
index 6e0528831cd3..299a244f68e6 100644
--- a/arch/arm64/mm/extable.c
+++ b/arch/arm64/mm/extable.c
@@ -79,12 +79,7 @@ ex_handler_load_unaligned_zeropad(const struct exception_table_entry *ex,
addr &= ~0x7UL;
data = *(unsigned long*)addr;
-
-#ifndef __AARCH64EB__
data >>= 8 * offset;
-#else
- data <<= 8 * offset;
-#endif
pt_regs_write_reg(regs, reg_data, data);
--
2.55.0.679.g6767b8d81c-goog