Skip to content
This repository was archived by the owner on Oct 5, 2018. It is now read-only.

Commit 9a89d44

Browse files
committed
Merge branch 'base/hikey' into hikey
2 parents c87bedf + 96e19ee commit 9a89d44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+86
-989
lines changed

Documentation/arm64/ilp32.txt

Lines changed: 0 additions & 57 deletions
This file was deleted.

arch/arm64/Kconfig

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,9 @@ menu "Userspace binary formats"
422422
source "fs/Kconfig.binfmt"
423423

424424
config COMPAT
425-
def_bool y
426-
depends on AARCH32_EL0 || ARM64_ILP32
427-
select COMPAT_BINFMT_ELF
428-
429-
config AARCH32_EL0
430425
bool "Kernel support for 32-bit EL0"
431426
depends on !ARM64_64K_PAGES
427+
select COMPAT_BINFMT_ELF
432428
select HAVE_UID16
433429
select OLD_SIGSUSPEND3
434430
select COMPAT_OLD_SIGACTION
@@ -440,16 +436,9 @@ config AARCH32_EL0
440436

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

443-
config ARM64_ILP32
444-
bool "Kernel support for ILP32"
445-
help
446-
This option enables support for AArch64 ILP32 user space. ILP32
447-
is an ABI where long and pointers are 32bits but it uses the AARCH64
448-
instruction set.
449-
450439
config SYSVIPC_COMPAT
451440
def_bool y
452-
depends on AARCH32_EL0 && SYSVIPC
441+
depends on COMPAT && SYSVIPC
453442

454443
endmenu
455444

arch/arm64/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@ GZFLAGS :=-9
1818
KBUILD_DEFCONFIG := defconfig
1919

2020
KBUILD_CFLAGS += -mgeneral-regs-only
21-
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
22-
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
2321
ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
2422
KBUILD_CPPFLAGS += -mbig-endian
2523
AS += -EB
2624
LD += -EB
27-
LDFLAGS += -maarch64linuxb
2825
else
2926
KBUILD_CPPFLAGS += -mlittle-endian
3027
AS += -EL
3128
LD += -EL
32-
LDFLAGS += -maarch64linux
3329
endif
3430

3531
CHECKFLAGS += -D__aarch64__

arch/arm64/include/asm/compat.h

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ struct compat_timeval {
7676
s32 tv_usec;
7777
};
7878

79-
/* ILP32 uses 64bit time_t and not the above compat structures */
80-
#define COMPAT_USE_64BIT_TIME (!is_a32_compat_task())
81-
8279
struct compat_stat {
8380
#ifdef __AARCH64EB__
8481
short st_dev;
@@ -211,9 +208,6 @@ typedef struct compat_siginfo {
211208
} _sifields;
212209
} compat_siginfo_t;
213210

214-
/* ILP32 uses the native siginfo and not the compat struct */
215-
#define COMPAT_USE_NATIVE_SIGINFO (!is_a32_compat_task())
216-
217211
#define COMPAT_OFF_T_MAX 0x7fffffff
218212
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
219213

@@ -299,16 +293,6 @@ struct compat_shmid64_ds {
299293
compat_ulong_t __unused5;
300294
};
301295

302-
#define COMPAT_ELF_HWCAP \
303-
(is_a32_compat_task() \
304-
? compat_elf_hwcap \
305-
: elf_hwcap)
306-
307-
#define COMPAT_ELF_HWCAP2 \
308-
(is_a32_compat_task() \
309-
? compat_elf_hwcap2 \
310-
: 0)
311-
312296
static inline int is_compat_task(void)
313297
{
314298
return test_thread_flag(TIF_32BIT);
@@ -327,48 +311,5 @@ static inline int is_compat_thread(struct thread_info *thread)
327311
}
328312

329313
#endif /* CONFIG_COMPAT */
330-
331-
#ifdef CONFIG_AARCH32_EL0
332-
static inline int is_a32_compat_task(void)
333-
{
334-
return test_thread_flag(TIF_AARCH32);
335-
}
336-
static inline int is_a32_compat_thread(struct thread_info *thread)
337-
{
338-
return test_ti_thread_flag(thread, TIF_AARCH32);
339-
}
340-
#else
341-
static inline int is_a32_compat_task(void)
342-
{
343-
return 0;
344-
}
345-
static inline int is_a32_compat_thread(struct thread_info *thread)
346-
{
347-
return 0;
348-
}
349-
#endif
350-
351-
#ifdef CONFIG_ARM64_ILP32
352-
static inline int is_ilp32_compat_task(void)
353-
{
354-
return test_thread_flag(TIF_32BIT) && !is_a32_compat_task();
355-
}
356-
static inline int is_ilp32_compat_thread(struct thread_info *thread)
357-
{
358-
return test_ti_thread_flag(thread, TIF_32BIT) &&
359-
!is_a32_compat_thread(thread);
360-
}
361-
#else
362-
static inline int is_ilp32_compat_task(void)
363-
{
364-
return 0;
365-
}
366-
static inline int is_ilp32_compat_thread(struct thread_info *thread)
367-
{
368-
return 0;
369-
}
370-
#endif
371-
372-
373314
#endif /* __KERNEL__ */
374315
#endif /* __ASM_COMPAT_H */

arch/arm64/include/asm/elf.h

Lines changed: 9 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#ifndef __ASM_ELF_H
1717
#define __ASM_ELF_H
1818

19-
#include <asm/errno.h>
2019
#include <asm/hwcap.h>
2120

2221
/*
@@ -136,11 +135,7 @@ extern unsigned long randomize_et_dyn(unsigned long base);
136135
*/
137136
#define ELF_PLAT_INIT(_r, load_addr) (_r)->regs[0] = 0
138137

139-
#define SET_PERSONALITY(ex) \
140-
do { \
141-
clear_thread_flag(TIF_AARCH32); \
142-
clear_thread_flag(TIF_32BIT); \
143-
} while (0)
138+
#define SET_PERSONALITY(ex) clear_thread_flag(TIF_32BIT);
144139

145140
#define ARCH_DLINFO \
146141
do { \
@@ -176,100 +171,23 @@ extern unsigned long arch_randomize_brk(struct mm_struct *mm);
176171

177172
#define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3)
178173

179-
#ifdef CONFIG_AARCH32_EL0
180-
181174
/* AArch32 registers. */
182-
#define COMPAT_A32_ELF_NGREG 18
183-
typedef unsigned int compat_a32_elf_greg_t;
184-
typedef compat_a32_elf_greg_t compat_a32_elf_gregset_t[COMPAT_A32_ELF_NGREG];
175+
#define COMPAT_ELF_NGREG 18
176+
typedef unsigned int compat_elf_greg_t;
177+
typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
185178

186179
/* AArch32 EABI. */
187180
#define EF_ARM_EABI_MASK 0xff000000
188-
#define compat_a32_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
181+
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
189182
((x)->e_flags & EF_ARM_EABI_MASK))
190183

191184
#define compat_start_thread compat_start_thread
192-
#define COMPAT_A32_SET_PERSONALITY(ex) \
193-
do { \
194-
set_thread_flag(TIF_AARCH32); \
195-
set_thread_flag(TIF_32BIT); \
196-
} while (0)
197-
#define COMPAT_A32_ARCH_DLINFO do {} while (0)
185+
#define COMPAT_SET_PERSONALITY(ex) set_thread_flag(TIF_32BIT);
186+
#define COMPAT_ARCH_DLINFO
198187
extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
199188
int uses_interp);
200-
201-
#else
202-
typedef elf_greg_t compat_elf_greg_t;
203-
typedef elf_gregset_t compat_elf_gregset_t;
204-
#define compat_a32_elf_check_arch(x) 0
205-
#define COMPAT_A32_SET_PERSONALITY(ex) do {} while (0)
206-
#define COMPAT_A32_ARCH_DLINFO do {} while (0)
207-
static inline int aarch32_setup_vectors_page(struct linux_binprm *bprm,
208-
int uses_interp)
209-
{
210-
return -EINVAL;
211-
}
212-
#endif
213-
214-
/*
215-
* If ILP32 is turned on, we want to define the compat_elf_greg_t to the non compat
216-
* one and define PR_REG_SIZE/PRSTATUS_SIZE/SET_PR_FPVALID so we pick up the correct
217-
* ones for AARCH32.
218-
*/
219-
#ifdef CONFIG_ARM64_ILP32
220-
typedef elf_greg_t compat_elf_greg_t;
221-
typedef elf_gregset_t compat_elf_gregset_t;
222-
#define COMPAT_PR_REG_SIZE(S) (is_a32_compat_task() ? 72 : 272)
223-
#define COMPAT_PRSTATUS_SIZE(S) (is_a32_compat_task() ? 124 : 352)
224-
#define COMPAT_SET_PR_FPVALID(S, V) \
225-
do { \
226-
*(int *) (((void *) &((S)->pr_reg)) + PR_REG_SIZE((S)->pr_reg)) = (V); \
227-
} while (0)
228-
#else
229-
typedef compat_a32_elf_greg_t compat_elf_greg_t;
230-
typedef compat_a32_elf_gregset_t compat_elf_gregset_t;
231-
#endif
232-
233-
#ifdef CONFIG_ARM64_ILP32
234-
#define compat_ilp32_elf_check_arch(x) ((x)->e_machine == EM_AARCH64)
235-
#define COMPAT_ILP32_SET_PERSONALITY(ex) \
236-
do { \
237-
clear_thread_flag(TIF_AARCH32); \
238-
set_thread_flag(TIF_32BIT); \
239-
} while (0)
240-
#define COMPAT_ILP32_ARCH_DLINFO \
241-
do { \
242-
NEW_AUX_ENT(AT_SYSINFO_EHDR, \
243-
(elf_addr_t)(long)current->mm->context.vdso); \
244-
} while (0)
245-
#else
246-
#define compat_ilp32_elf_check_arch(x) 0
247-
#define COMPAT_ILP32_SET_PERSONALITY(ex) do {} while (0)
248-
#define COMPAT_ILP32_ARCH_DLINFO do {} while (0)
249-
#endif
250-
251-
#define compat_elf_check_arch(x) (compat_a32_elf_check_arch(x) || compat_ilp32_elf_check_arch(x))
252-
#define COMPAT_SET_PERSONALITY(ex) \
253-
do { \
254-
if (compat_a32_elf_check_arch(&ex)) \
255-
COMPAT_A32_SET_PERSONALITY(ex); \
256-
else \
257-
COMPAT_ILP32_SET_PERSONALITY(ex); \
258-
} while (0)
259-
260-
/* ILP32 uses the "LP64-like" vdso pages */
261-
#define compat_arch_setup_additional_pages \
262-
(is_a32_compat_task() \
263-
? &aarch32_setup_vectors_page \
264-
: &(arch_setup_additional_pages))
265-
266-
#define COMPAT_ARCH_DLINFO \
267-
do { \
268-
if (is_a32_compat_task()) \
269-
COMPAT_A32_ARCH_DLINFO; \
270-
else \
271-
COMPAT_ILP32_ARCH_DLINFO; \
272-
} while (0)
189+
#define compat_arch_setup_additional_pages \
190+
aarch32_setup_vectors_page
273191

274192
#endif /* CONFIG_COMPAT */
275193

arch/arm64/include/asm/fpsimd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct fpsimd_partial_state {
5252
};
5353

5454

55-
#if defined(__KERNEL__) && defined(CONFIG_AARCH32_EL0)
55+
#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
5656
/* Masks for extracting the FPSR and FPCR from the FPSCR */
5757
#define VFP_FPSCR_STAT_MASK 0xf800009f
5858
#define VFP_FPSCR_CTRL_MASK 0x07f79f00

arch/arm64/include/asm/hwcap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
#define ELF_HWCAP (elf_hwcap)
4747

4848
#ifdef CONFIG_COMPAT
49+
#define COMPAT_ELF_HWCAP (compat_elf_hwcap)
50+
#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2)
4951
extern unsigned int compat_elf_hwcap, compat_elf_hwcap2;
5052
#endif
5153

arch/arm64/include/asm/processor.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,6 @@ static inline void start_thread(struct pt_regs *regs, unsigned long pc,
104104
static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
105105
unsigned long sp)
106106
{
107-
#ifdef CONFIG_ARM64_ILP32
108-
/*
109-
* ILP32 thread are started the same way as LP64 threads.
110-
* Note we cannot use is_ilp32_compat_task here as that
111-
* would introduce a header depency issue.
112-
*/
113-
if (!test_thread_flag(TIF_AARCH32)) {
114-
start_thread(regs, pc, sp);
115-
return;
116-
}
117-
#endif
118107
start_thread_common(regs, pc);
119108
regs->pstate = COMPAT_PSR_MODE_USR;
120109
if (pc & 1)

arch/arm64/include/asm/ptrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct pt_regs {
113113

114114
#define arch_has_single_step() (1)
115115

116-
#ifdef CONFIG_AARCH32_EL0
116+
#ifdef CONFIG_COMPAT
117117
#define compat_thumb_mode(regs) \
118118
(((regs)->pstate & COMPAT_PSR_T_BIT))
119119
#else

arch/arm64/include/asm/signal32.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define __ASM_SIGNAL32_H
1818

1919
#ifdef __KERNEL__
20-
#ifdef CONFIG_AARCH32_EL0
20+
#ifdef CONFIG_COMPAT
2121
#include <linux/compat.h>
2222

2323
#define AARCH32_KERN_SIGRET_CODE_OFFSET 0x500
@@ -47,6 +47,6 @@ static inline int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t
4747
static inline void compat_setup_restart_syscall(struct pt_regs *regs)
4848
{
4949
}
50-
#endif /* CONFIG_AARCH32_EL0 */
50+
#endif /* CONFIG_COMPAT */
5151
#endif /* __KERNEL__ */
5252
#endif /* __ASM_SIGNAL32_H */

0 commit comments

Comments
 (0)