aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-11-16 22:28:34 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-16 22:28:34 -0500
commit9526d9bc23f362035cfabf044aa90f4ed1787955 (patch)
tree3c24639de58cfaebc9f2616750dedfdad4251c35 /arch/arm64
parentd042f3135e5e3a0132942335dea0155ae86a7308 (diff)
parent6929039761a3414e5c71448eb3dcc1d82fc1891d (diff)
Merge branch 'arch-arm64' into no-rebases
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/include/asm/elf.h5
-rw-r--r--arch/arm64/include/asm/fpsimd.h5
-rw-r--r--arch/arm64/include/asm/io.h8
-rw-r--r--arch/arm64/include/asm/syscalls.h11
-rw-r--r--arch/arm64/include/asm/unistd32.h6
-rw-r--r--arch/arm64/kernel/entry.S5
-rw-r--r--arch/arm64/kernel/perf_event.c10
-rw-r--r--arch/arm64/kernel/process.c28
-rw-r--r--arch/arm64/kernel/sys.c11
-rw-r--r--arch/arm64/kernel/sys32.S14
-rw-r--r--arch/arm64/kernel/sys_compat.c20
11 files changed, 34 insertions, 89 deletions
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index cf284649dfcb..07fea290d7c1 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -25,12 +25,10 @@
25#include <asm/user.h> 25#include <asm/user.h>
26 26
27typedef unsigned long elf_greg_t; 27typedef unsigned long elf_greg_t;
28typedef unsigned long elf_freg_t[3];
29 28
30#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) 29#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
31typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 30typedef elf_greg_t elf_gregset_t[ELF_NGREG];
32 31typedef struct user_fpsimd_state elf_fpregset_t;
33typedef struct user_fp elf_fpregset_t;
34 32
35#define EM_AARCH64 183 33#define EM_AARCH64 183
36 34
@@ -87,7 +85,6 @@ typedef struct user_fp elf_fpregset_t;
87#define R_AARCH64_MOVW_PREL_G2_NC 292 85#define R_AARCH64_MOVW_PREL_G2_NC 292
88#define R_AARCH64_MOVW_PREL_G3 293 86#define R_AARCH64_MOVW_PREL_G3 293
89 87
90
91/* 88/*
92 * These are used to set parameters in the core dumps. 89 * These are used to set parameters in the core dumps.
93 */ 90 */
diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
index b42fab9f62a9..c43b4ac13008 100644
--- a/arch/arm64/include/asm/fpsimd.h
+++ b/arch/arm64/include/asm/fpsimd.h
@@ -25,9 +25,8 @@
25 * - FPSR and FPCR 25 * - FPSR and FPCR
26 * - 32 128-bit data registers 26 * - 32 128-bit data registers
27 * 27 *
28 * Note that user_fp forms a prefix of this structure, which is relied 28 * Note that user_fpsimd forms a prefix of this structure, which is
29 * upon in the ptrace FP/SIMD accessors. struct user_fpsimd_state must 29 * relied upon in the ptrace FP/SIMD accessors.
30 * form a prefix of struct fpsimd_state.
31 */ 30 */
32struct fpsimd_state { 31struct fpsimd_state {
33 union { 32 union {
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 74a2a7d304a9..54f6116697f7 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -114,7 +114,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
114 * I/O port access primitives. 114 * I/O port access primitives.
115 */ 115 */
116#define IO_SPACE_LIMIT 0xffff 116#define IO_SPACE_LIMIT 0xffff
117#define PCI_IOBASE ((void __iomem *)0xffffffbbfffe0000UL) 117#define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_2M))
118 118
119static inline u8 inb(unsigned long addr) 119static inline u8 inb(unsigned long addr)
120{ 120{
@@ -225,9 +225,9 @@ extern void __iounmap(volatile void __iomem *addr);
225#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) 225#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE))
226#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) 226#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC))
227 227
228#define ioremap(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE) 228#define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
229#define ioremap_nocache(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE) 229#define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
230#define ioremap_wc(addr, size) __ioremap((addr), (size), PROT_NORMAL_NC) 230#define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
231#define iounmap __iounmap 231#define iounmap __iounmap
232 232
233#define ARCH_HAS_IOREMAP_WC 233#define ARCH_HAS_IOREMAP_WC
diff --git a/arch/arm64/include/asm/syscalls.h b/arch/arm64/include/asm/syscalls.h
index 81680a0ae913..a1b00cd6f786 100644
--- a/arch/arm64/include/asm/syscalls.h
+++ b/arch/arm64/include/asm/syscalls.h
@@ -23,15 +23,16 @@
23/* 23/*
24 * System call wrappers implemented in kernel/entry.S. 24 * System call wrappers implemented in kernel/entry.S.
25 */ 25 */
26asmlinkage long sys_clone_wrapper(unsigned long clone_flags,
27 unsigned long newsp,
28 void __user *parent_tid,
29 unsigned long tls_val,
30 void __user *child_tid);
31asmlinkage long sys_rt_sigreturn_wrapper(void); 26asmlinkage long sys_rt_sigreturn_wrapper(void);
32asmlinkage long sys_sigaltstack_wrapper(const stack_t __user *uss, 27asmlinkage long sys_sigaltstack_wrapper(const stack_t __user *uss,
33 stack_t __user *uoss); 28 stack_t __user *uoss);
34 29
30/*
31 * AArch64 sys_clone implementation has a different prototype than the generic
32 * one (additional TLS value argument).
33 */
34#define sys_clone sys_clone
35
35#include <asm-generic/syscalls.h> 36#include <asm-generic/syscalls.h>
36 37
37#endif /* __ASM_SYSCALLS_H */ 38#endif /* __ASM_SYSCALLS_H */
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
index 9035e6add3e4..d9850cf9870d 100644
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -23,7 +23,7 @@
23 23
24__SYSCALL(0, sys_restart_syscall) 24__SYSCALL(0, sys_restart_syscall)
25__SYSCALL(1, sys_exit) 25__SYSCALL(1, sys_exit)
26__SYSCALL(2, compat_sys_fork_wrapper) 26__SYSCALL(2, compat_sys_fork)
27__SYSCALL(3, sys_read) 27__SYSCALL(3, sys_read)
28__SYSCALL(4, sys_write) 28__SYSCALL(4, sys_write)
29__SYSCALL(5, compat_sys_open) 29__SYSCALL(5, compat_sys_open)
@@ -141,7 +141,7 @@ __SYSCALL(116, compat_sys_sysinfo)
141__SYSCALL(117, sys_ni_syscall) /* 117 was sys_ipc */ 141__SYSCALL(117, sys_ni_syscall) /* 117 was sys_ipc */
142__SYSCALL(118, sys_fsync) 142__SYSCALL(118, sys_fsync)
143__SYSCALL(119, compat_sys_sigreturn_wrapper) 143__SYSCALL(119, compat_sys_sigreturn_wrapper)
144__SYSCALL(120, compat_sys_clone_wrapper) 144__SYSCALL(120, sys_clone)
145__SYSCALL(121, sys_setdomainname) 145__SYSCALL(121, sys_setdomainname)
146__SYSCALL(122, sys_newuname) 146__SYSCALL(122, sys_newuname)
147__SYSCALL(123, sys_ni_syscall) /* 123 was sys_modify_ldt */ 147__SYSCALL(123, sys_ni_syscall) /* 123 was sys_modify_ldt */
@@ -211,7 +211,7 @@ __SYSCALL(186, compat_sys_sigaltstack_wrapper)
211__SYSCALL(187, compat_sys_sendfile) 211__SYSCALL(187, compat_sys_sendfile)
212__SYSCALL(188, sys_ni_syscall) /* 188 reserved */ 212__SYSCALL(188, sys_ni_syscall) /* 188 reserved */
213__SYSCALL(189, sys_ni_syscall) /* 189 reserved */ 213__SYSCALL(189, sys_ni_syscall) /* 189 reserved */
214__SYSCALL(190, compat_sys_vfork_wrapper) 214__SYSCALL(190, compat_sys_vfork)
215__SYSCALL(191, compat_sys_getrlimit) /* SuS compliant getrlimit */ 215__SYSCALL(191, compat_sys_getrlimit) /* SuS compliant getrlimit */
216__SYSCALL(192, sys_mmap_pgoff) 216__SYSCALL(192, sys_mmap_pgoff)
217__SYSCALL(193, compat_sys_truncate64_wrapper) 217__SYSCALL(193, compat_sys_truncate64_wrapper)
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 616531862d52..cbfa4d28100e 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -676,11 +676,6 @@ __sys_trace_return:
676/* 676/*
677 * Special system call wrappers. 677 * Special system call wrappers.
678 */ 678 */
679ENTRY(sys_clone_wrapper)
680 mov x5, sp
681 b sys_clone
682ENDPROC(sys_clone_wrapper)
683
684ENTRY(sys_rt_sigreturn_wrapper) 679ENTRY(sys_rt_sigreturn_wrapper)
685 mov x0, sp 680 mov x0, sp
686 b sys_rt_sigreturn 681 b sys_rt_sigreturn
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index ecbf2d81ec5c..c76c7241125b 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -613,17 +613,11 @@ enum armv8_pmuv3_perf_types {
613 ARMV8_PMUV3_PERFCTR_BUS_ACCESS = 0x19, 613 ARMV8_PMUV3_PERFCTR_BUS_ACCESS = 0x19,
614 ARMV8_PMUV3_PERFCTR_MEM_ERROR = 0x1A, 614 ARMV8_PMUV3_PERFCTR_MEM_ERROR = 0x1A,
615 ARMV8_PMUV3_PERFCTR_BUS_CYCLES = 0x1D, 615 ARMV8_PMUV3_PERFCTR_BUS_CYCLES = 0x1D,
616
617 /*
618 * This isn't an architected event.
619 * We detect this event number and use the cycle counter instead.
620 */
621 ARMV8_PMUV3_PERFCTR_CPU_CYCLES = 0xFF,
622}; 616};
623 617
624/* PMUv3 HW events mapping. */ 618/* PMUv3 HW events mapping. */
625static const unsigned armv8_pmuv3_perf_map[PERF_COUNT_HW_MAX] = { 619static const unsigned armv8_pmuv3_perf_map[PERF_COUNT_HW_MAX] = {
626 [PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CPU_CYCLES, 620 [PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES,
627 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV8_PMUV3_PERFCTR_INSTR_EXECUTED, 621 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV8_PMUV3_PERFCTR_INSTR_EXECUTED,
628 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_ACCESS, 622 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_ACCESS,
629 [PERF_COUNT_HW_CACHE_MISSES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_REFILL, 623 [PERF_COUNT_HW_CACHE_MISSES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_REFILL,
@@ -1106,7 +1100,7 @@ static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc,
1106 unsigned long evtype = event->config_base & ARMV8_EVTYPE_EVENT; 1100 unsigned long evtype = event->config_base & ARMV8_EVTYPE_EVENT;
1107 1101
1108 /* Always place a cycle counter into the cycle counter. */ 1102 /* Always place a cycle counter into the cycle counter. */
1109 if (evtype == ARMV8_PMUV3_PERFCTR_CPU_CYCLES) { 1103 if (evtype == ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES) {
1110 if (test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask)) 1104 if (test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask))
1111 return -EAGAIN; 1105 return -EAGAIN;
1112 1106
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index bf615e212c6c..8a5f3341861e 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -246,14 +246,20 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,
246 *childregs = *regs; 246 *childregs = *regs;
247 childregs->regs[0] = 0; 247 childregs->regs[0] = 0;
248 if (is_compat_thread(task_thread_info(p))) { 248 if (is_compat_thread(task_thread_info(p))) {
249 childregs->compat_sp = stack_start; 249 if (stack_start)
250 childregs->compat_sp = stack_start;
250 } else { 251 } else {
251 /* 252 /*
252 * Read the current TLS pointer from tpidr_el0 as it may be 253 * Read the current TLS pointer from tpidr_el0 as it may be
253 * out-of-sync with the saved value. 254 * out-of-sync with the saved value.
254 */ 255 */
255 asm("mrs %0, tpidr_el0" : "=r" (tls)); 256 asm("mrs %0, tpidr_el0" : "=r" (tls));
256 childregs->sp = stack_start; 257 if (stack_start) {
258 /* 16-byte aligned stack mandatory on AArch64 */
259 if (stack_start & 15)
260 return -EINVAL;
261 childregs->sp = stack_start;
262 }
257 } 263 }
258 /* 264 /*
259 * If a TLS pointer was passed to clone (4th argument), use it 265 * If a TLS pointer was passed to clone (4th argument), use it
@@ -317,24 +323,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
317 return last; 323 return last;
318} 324}
319 325
320/*
321 * Fill in the task's elfregs structure for a core dump.
322 */
323int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs)
324{
325 elf_core_copy_regs(elfregs, task_pt_regs(t));
326 return 1;
327}
328
329/*
330 * fill in the fpe structure for a core dump...
331 */
332int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
333{
334 return 0;
335}
336EXPORT_SYMBOL(dump_fpu);
337
338unsigned long get_wchan(struct task_struct *p) 326unsigned long get_wchan(struct task_struct *p)
339{ 327{
340 struct stackframe frame; 328 struct stackframe frame;
diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c
index 9c77c0bacc1d..4364df85050e 100644
--- a/arch/arm64/kernel/sys.c
+++ b/arch/arm64/kernel/sys.c
@@ -31,14 +31,10 @@
31 */ 31 */
32asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, 32asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
33 int __user *parent_tidptr, unsigned long tls_val, 33 int __user *parent_tidptr, unsigned long tls_val,
34 int __user *child_tidptr, struct pt_regs *regs) 34 int __user *child_tidptr)
35{ 35{
36 if (!newsp) 36 return do_fork(clone_flags, newsp, current_pt_regs(), 0,
37 newsp = regs->sp; 37 parent_tidptr, child_tidptr);
38 /* 16-byte aligned stack mandatory on AArch64 */
39 if (newsp & 15)
40 return -EINVAL;
41 return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr);
42} 38}
43 39
44asmlinkage long sys_mmap(unsigned long addr, unsigned long len, 40asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
@@ -54,7 +50,6 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
54/* 50/*
55 * Wrappers to pass the pt_regs argument. 51 * Wrappers to pass the pt_regs argument.
56 */ 52 */
57#define sys_clone sys_clone_wrapper
58#define sys_rt_sigreturn sys_rt_sigreturn_wrapper 53#define sys_rt_sigreturn sys_rt_sigreturn_wrapper
59#define sys_sigaltstack sys_sigaltstack_wrapper 54#define sys_sigaltstack sys_sigaltstack_wrapper
60 55
diff --git a/arch/arm64/kernel/sys32.S b/arch/arm64/kernel/sys32.S
index 92145d402cf1..7ef59e9245ef 100644
--- a/arch/arm64/kernel/sys32.S
+++ b/arch/arm64/kernel/sys32.S
@@ -26,20 +26,6 @@
26/* 26/*
27 * System call wrappers for the AArch32 compatibility layer. 27 * System call wrappers for the AArch32 compatibility layer.
28 */ 28 */
29compat_sys_fork_wrapper:
30 mov x0, sp
31 b compat_sys_fork
32ENDPROC(compat_sys_fork_wrapper)
33
34compat_sys_vfork_wrapper:
35 mov x0, sp
36 b compat_sys_vfork
37ENDPROC(compat_sys_vfork_wrapper)
38
39compat_sys_clone_wrapper:
40 mov x5, sp
41 b compat_sys_clone
42ENDPROC(compat_sys_clone_wrapper)
43 29
44compat_sys_sigreturn_wrapper: 30compat_sys_sigreturn_wrapper:
45 mov x0, sp 31 mov x0, sp
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c
index d140b73a8bc4..6fabc1912da0 100644
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -28,25 +28,15 @@
28#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
29#include <asm/unistd32.h> 29#include <asm/unistd32.h>
30 30
31asmlinkage int compat_sys_fork(struct pt_regs *regs) 31asmlinkage int compat_sys_fork(void)
32{ 32{
33 return do_fork(SIGCHLD, regs->compat_sp, regs, 0, NULL, NULL); 33 return do_fork(SIGCHLD, 0, current_pt_regs(), 0, NULL, NULL);
34} 34}
35 35
36asmlinkage int compat_sys_clone(unsigned long clone_flags, unsigned long newsp, 36asmlinkage int compat_sys_vfork(void)
37 int __user *parent_tidptr, int tls_val,
38 int __user *child_tidptr, struct pt_regs *regs)
39{ 37{
40 if (!newsp) 38 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0,
41 newsp = regs->compat_sp; 39 current_pt_regs(), 0, NULL, NULL);
42
43 return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr);
44}
45
46asmlinkage int compat_sys_vfork(struct pt_regs *regs)
47{
48 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->compat_sp,
49 regs, 0, NULL, NULL);
50} 40}
51 41
52asmlinkage int compat_sys_sched_rr_get_interval(compat_pid_t pid, 42asmlinkage int compat_sys_sched_rr_get_interval(compat_pid_t pid,