Re: [RFC][CFT][CFReview] execve and kernel_thread unification work

Catalin Marinas
2012-10-17T14:02:38Z

Hi Al,

On 15 October 2012 02:30, Al Viro <viro@zeniv.linux.org.uk> wrote:
> arch-arm64 - patches from maintainer with minor followup folded

Thanks for updating the arm64 branch. I've adapted the changes, tested
and folded them into the branch below (the AArch64 instruction set
does not have conditional instructions):

git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64.git
execve

Top commit: 6a872777ffff6184f4ac10bd71d926d5e6f2491e (arm64: Use
generic sys_execve() implementation)

The diff between your branch and mine (including one cosmetic change
as the ARM64 Kconfig selects are alphabetically sorted):

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 31e3b5e..75b212d 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -6,8 +6,8 @@ config ARM64
select GENERIC_IOMAP
select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW
- select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
+ select GENERIC_KERNEL_THREAD
select GENERIC_SMP_IDLE_THREAD
select GENERIC_TIME_VSYSCALL
select HARDIRQS_SW_RESEND
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index c3d650a..6165318 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -611,10 +611,10 @@ ENDPROC(ret_to_user)
*/
ENTRY(ret_from_fork)
bl schedule_tail
- cmp x19, #0
- movne x0, x20
- blne x19
- get_thread_info tsk
+ cbz x19, 1f // not a kernel thread
+ mov x0, x20
+ blr x19
+1: get_thread_info tsk
b ret_to_user
ENDPROC(ret_from_fork)

--
Catalin