hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8S6IA
-------------------------------------------------
This patch fix the following compilation errors with ILP32 support using openeuler_defcofig.
When ILP32 support is enabled, compilation on ARM64 would complain about an undeclared __NR_compat_syscalls, since commit b16c8a680a2b ("arm64: ilp32: introduce syscall table for ILP32") changes the config that __NR_compat_syscalls depends on but commit dbece8b041f3 ("arm64: rename COMPAT to AARCH32_EL0") ignores it for __NR_compat_syscalls. Modify the config for SECCOMP_ARCH_COMPAT_NR accordingly.
And commit dbece8b041f3 ("arm64: rename COMPAT to AARCH32_EL0") ignores ARM64_ERRATU_1742098 which only depends on AARCH32_EL0 but not ARM64_ILP32.
./arch/arm64/include/asm/seccomp.h:57:33: error: ‘__NR_compat_syscalls’ undeclared here (not in a function); did you mean ‘in_compat_syscall’? 57 | # define SECCOMP_ARCH_COMPAT_NR __NR_compat_syscalls
./arch/arm64/kernel/cpufeature.c:2200:17: error: ‘a32_elf_hwcap2’ undeclared (first use in this function); did you mean ‘elf_hwcap’? 2200 | a32_elf_hwcap2 &= ~COMPAT_HWCAP2_AES; | ^~~~~~~~~~~~~~ | elf_hwcap
Fixes: dbece8b041f3 ("arm64: rename COMPAT to AARCH32_EL0") Signed-off-by: Jinjie Ruan ruanjinjie@huawei.com --- arch/arm64/Kconfig | 2 +- arch/arm64/include/asm/seccomp.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 42079bfdf40a..42f31d37ce23 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -568,7 +568,7 @@ config ARM64_ERRATUM_834220
config ARM64_ERRATUM_1742098 bool "Cortex-A57/A72: 1742098: ELR recorded incorrectly on interrupt taken between cryptographic instructions in a sequence" - depends on COMPAT + depends on AARCH32_EL0 default y help This option removes the AES hwcap for aarch32 user-space to diff --git a/arch/arm64/include/asm/seccomp.h b/arch/arm64/include/asm/seccomp.h index a6be48b9225a..bc3ab2468f03 100644 --- a/arch/arm64/include/asm/seccomp.h +++ b/arch/arm64/include/asm/seccomp.h @@ -52,10 +52,10 @@ static inline const int *get_compat_mode1_syscalls(void) #define SECCOMP_ARCH_NATIVE AUDIT_ARCH_AARCH64 #define SECCOMP_ARCH_NATIVE_NR NR_syscalls #define SECCOMP_ARCH_NATIVE_NAME "aarch64" -#ifdef CONFIG_COMPAT +#ifdef CONFIG_AARCH32_EL0 # define SECCOMP_ARCH_COMPAT AUDIT_ARCH_ARM # define SECCOMP_ARCH_COMPAT_NR __NR_compat_syscalls # define SECCOMP_ARCH_COMPAT_NAME "arm" -#endif +#endif /* CONFIG_AARCH32_EL0 */
#endif /* _ASM_SECCOMP_H */