Commit dbece8b0 authored by Andrew Pinski's avatar Andrew Pinski Committed by Jinjie Ruan
Browse files

arm64: rename COMPAT to AARCH32_EL0

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8JVJ3
CVE: NA

Reference: https://github.com/norov/linux/commits/ilp32-5.2



--------------------------------

In this patchset ILP32 ABI support is added. Additionally to AARCH32,
which is binary-compatible with ARM, ILP32 is (mostly) ABI-compatible.

From now, AARCH32_EL0 (former COMPAT) config option means the support of
AARCH32 userspace, and ARM64_ILP32 - support of ILP32 ABI (see following
patches). COMPAT indicates that one of them or both is enabled.

Where needed, CONFIG_COMPAT is changed over to use CONFIG_AARCH32_EL0
instead.

Reviewed-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Signed-off-by: default avatarAndrew Pinski <Andrew.Pinski@caviumnetworks.com>
Signed-off-by: default avatarYury Norov <ynorov@caviumnetworks.com>
Signed-off-by: default avatarPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: default avatarChristoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: default avatarBamvor Jian Zhang <bamv2005@gmail.com>
Signed-off-by: default avatarYury Norov <ynorov@marvell.com>
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarChen Jiahao <chenjiahao16@huawei.com>

Conflicts:
	arch/arm64/Kconfig
	arch/arm64/kernel/Makefile
	arch/arm64/kernel/cpuinfo.c
[ruanjinjie: simple context conflicts]

Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent e1206536
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -583,7 +583,7 @@ config ARM64_ERRATUM_1742098

config ARM64_ERRATUM_845719
	bool "Cortex-A53: 845719: a load might read incorrect data"
	depends on COMPAT
	depends on AARCH32_EL0
	default y
	help
	  This option adds an alternative code sequence to work around ARM
@@ -1595,7 +1595,7 @@ config ARM64_TAGGED_ADDR_ABI
	  to system calls as pointer arguments. For details, see
	  Documentation/arch/arm64/tagged-address-abi.rst.

menuconfig COMPAT
menuconfig AARCH32_EL0
	bool "Kernel support for 32-bit EL0"
	depends on ARM64_4K_PAGES || EXPERT
	select HAVE_UID16
@@ -1613,7 +1613,7 @@ menuconfig COMPAT

	  If you want to execute 32-bit userspace applications, say Y.

if COMPAT
if AARCH32_EL0

config KUSER_HELPERS
	bool "Enable kuser helpers page for 32-bit applications"
@@ -1669,6 +1669,7 @@ config COMPAT_ALIGNMENT_FIXUPS

menuconfig ARMV8_DEPRECATED
	bool "Emulate deprecated/obsolete ARMv8 instructions"
	depends on AARCH32_EL0
	depends on SYSCTL
	help
	  Legacy software support may require certain instructions
@@ -2285,6 +2286,10 @@ config DMI

endmenu # "Boot options"

config COMPAT
	def_bool y
	depends on AARCH32_EL0

menu "Power management options"

source "kernel/power/Kconfig"
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ static inline int arch_timer_arch_init(void)
static inline void arch_timer_set_evtstrm_feature(void)
{
	cpu_set_named_feature(EVTSTRM);
#ifdef CONFIG_COMPAT
#ifdef CONFIG_AARCH32_EL0
	compat_elf_hwcap |= COMPAT_HWCAP_EVTSTRM;
#endif
}
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <linux/stddef.h>
#include <linux/types.h>

#ifdef CONFIG_COMPAT
#ifdef CONFIG_AARCH32_EL0
/* Masks for extracting the FPSR and FPCR from the FPSCR */
#define VFP_FPSCR_STAT_MASK	0xf800009f
#define VFP_FPSCR_CTRL_MASK	0x07f79f00
+2 −2
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@
#define ELF_HWCAP		cpu_get_elf_hwcap()
#define ELF_HWCAP2		cpu_get_elf_hwcap2()

#ifdef CONFIG_COMPAT
#ifdef CONFIG_AARCH32_EL0
#define COMPAT_ELF_HWCAP	(compat_elf_hwcap)
#define COMPAT_ELF_HWCAP2	(compat_elf_hwcap2)
extern unsigned int compat_elf_hwcap, compat_elf_hwcap2;
@@ -155,7 +155,7 @@ extern unsigned int compat_elf_hwcap, compat_elf_hwcap2;

enum {
	CAP_HWCAP = 1,
#ifdef CONFIG_COMPAT
#ifdef CONFIG_AARCH32_EL0
	CAP_COMPAT_HWCAP,
	CAP_COMPAT_HWCAP2,
#endif
+2 −2
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset,
	*size = sizeof_field(struct thread_struct, uw);
}

#ifdef CONFIG_COMPAT
#ifdef CONFIG_AARCH32_EL0
#define task_user_tls(t)						\
({									\
	unsigned long *__tls;						\
@@ -297,7 +297,7 @@ static inline void start_thread(struct pt_regs *regs, unsigned long pc,
	regs->sp = sp;
}

#ifdef CONFIG_COMPAT
#ifdef CONFIG_AARCH32_EL0
static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
				       unsigned long sp)
{
Loading