Re: [PATCH 21/24] ARM64:ILP32: Use a seperate syscall table as a few syscalls need to be using the compat syscalls

Catalin Marinas
2014-10-02T15:46:17Z

On Wed, Sep 03, 2014 at 10:19:15PM +0100, Andrew Pinski wrote:
> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 9314352..dbedecf 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -643,9 +643,14 @@ ENDPROC(ret_from_fork)
> */
> .align 6
> el0_svc:
> - adrp stbl, sys_call_table // load syscall table pointer
> uxtw scno, w8 // syscall number in w8
> mov sc_nr, #__NR_syscalls
> +#ifdef CONFIG_ARM64_ILP32
> + get_thread_info tsk
> + ldr x16, [tsk, #TI_FLAGS]
> + tbnz x16, #TIF_32BIT, el0_ilp32_svc // We are using ILP32
> +#endif
> + adrp stbl, sys_call_table // load syscall table pointer
> el0_svc_naked: // compat entry point
> stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number
> enable_dbg_and_irq

The kernel_entry macro already sets tsk to the current thread_info, so
no need to re-read it.

You could also move the TI_FLAGS reading unconditionally in el0_svc and
el0_svc_compat and we only have a tbnz here without the subsequent
TI_FLAGS read in el0_svc_naked.

--
Catalin