diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2012-09-10 11:11:46 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2012-10-17 09:35:04 -0400 |
commit | 59dc67b0cc35cd93c3f4869fdd0d6cfb2a26ecbc (patch) | |
tree | fa47b1ad1c6f0688fd50c3bd5f573bb55a451730 /arch/arm64 | |
parent | c34501d21b005a6e363386a19519bd11cf92a67c (diff) |
arm64: Use generic kernel_execve() implementation
This patch enables CONFIG_GENERIC_KERNEL_EXECVE on arm64 and removes the
arm64-specific implementation of kernel_execve().
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm64/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/arm64/kernel/sys.c | 43 |
3 files changed, 2 insertions, 44 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 4077b71b1258..75b212d5db9d 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -6,6 +6,7 @@ config ARM64 | |||
6 | select GENERIC_IOMAP | 6 | select GENERIC_IOMAP |
7 | select GENERIC_IRQ_PROBE | 7 | select GENERIC_IRQ_PROBE |
8 | select GENERIC_IRQ_SHOW | 8 | select GENERIC_IRQ_SHOW |
9 | select GENERIC_KERNEL_EXECVE | ||
9 | select GENERIC_KERNEL_THREAD | 10 | select GENERIC_KERNEL_THREAD |
10 | select GENERIC_SMP_IDLE_THREAD | 11 | select GENERIC_SMP_IDLE_THREAD |
11 | select GENERIC_TIME_VSYSCALL | 12 | select GENERIC_TIME_VSYSCALL |
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 08db8972ebcc..00daf922733e 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -594,7 +594,7 @@ work_resched: | |||
594 | /* | 594 | /* |
595 | * "slow" syscall return path. | 595 | * "slow" syscall return path. |
596 | */ | 596 | */ |
597 | ENTRY(ret_to_user) | 597 | ret_to_user: |
598 | disable_irq // disable interrupts | 598 | disable_irq // disable interrupts |
599 | ldr x1, [tsk, #TI_FLAGS] | 599 | ldr x1, [tsk, #TI_FLAGS] |
600 | and x2, x1, #_TIF_WORK_MASK | 600 | and x2, x1, #_TIF_WORK_MASK |
diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c index b120df37de35..4deb0d0093cd 100644 --- a/arch/arm64/kernel/sys.c +++ b/arch/arm64/kernel/sys.c | |||
@@ -62,49 +62,6 @@ out: | |||
62 | return error; | 62 | return error; |
63 | } | 63 | } |
64 | 64 | ||
65 | int kernel_execve(const char *filename, | ||
66 | const char *const argv[], | ||
67 | const char *const envp[]) | ||
68 | { | ||
69 | struct pt_regs regs; | ||
70 | int ret; | ||
71 | |||
72 | memset(®s, 0, sizeof(struct pt_regs)); | ||
73 | ret = do_execve(filename, | ||
74 | (const char __user *const __user *)argv, | ||
75 | (const char __user *const __user *)envp, ®s); | ||
76 | if (ret < 0) | ||
77 | goto out; | ||
78 | |||
79 | /* | ||
80 | * Save argc to the register structure for userspace. | ||
81 | */ | ||
82 | regs.regs[0] = ret; | ||
83 | |||
84 | /* | ||
85 | * We were successful. We won't be returning to our caller, but | ||
86 | * instead to user space by manipulating the kernel stack. | ||
87 | */ | ||
88 | asm( "add x0, %0, %1\n\t" | ||
89 | "mov x1, %2\n\t" | ||
90 | "mov x2, %3\n\t" | ||
91 | "bl memmove\n\t" /* copy regs to top of stack */ | ||
92 | "mov x27, #0\n\t" /* not a syscall */ | ||
93 | "mov x28, %0\n\t" /* thread structure */ | ||
94 | "mov sp, x0\n\t" /* reposition stack pointer */ | ||
95 | "b ret_to_user" | ||
96 | : | ||
97 | : "r" (current_thread_info()), | ||
98 | "Ir" (THREAD_START_SP - sizeof(regs)), | ||
99 | "r" (®s), | ||
100 | "Ir" (sizeof(regs)) | ||
101 | : "x0", "x1", "x2", "x27", "x28", "x30", "memory"); | ||
102 | |||
103 | out: | ||
104 | return ret; | ||
105 | } | ||
106 | EXPORT_SYMBOL(kernel_execve); | ||
107 | |||
108 | asmlinkage long sys_mmap(unsigned long addr, unsigned long len, | 65 | asmlinkage long sys_mmap(unsigned long addr, unsigned long len, |
109 | unsigned long prot, unsigned long flags, | 66 | unsigned long prot, unsigned long flags, |
110 | unsigned long fd, off_t off) | 67 | unsigned long fd, off_t off) |