Commit cf3a0a01 authored by Philippe Gerum's avatar Philippe Gerum Committed by Dmitriy Cherkasov

arm64: ipipe: route syscalls to co-kernel

This commit introduces the changes redirecting "foreign" system calls
to the co-kernel.
parent f5beda02
......@@ -53,3 +53,5 @@
#endif
#define NR_syscalls (__NR_syscalls)
#define __ARM_ipipe_syscall 0x10000000
......@@ -964,6 +964,57 @@ el0_svc:
el0_svc_naked: // compat entry point
stp x0, xscno, [sp, #S_ORIG_X0] // save the original x0 and syscall number
enable_dbg_and_irq
#ifdef CONFIG_IPIPE
ldr x16, [tsk, #TSK_TI_IPIPE]
tst wscno, __ARM_ipipe_syscall
b.eq fastcall_bypass
tst x16, #_TIP_HEAD
b.eq fastcall_bypass
mov x0, sp
bl ipipe_fastcall_hook
cmp w0, #0
b.lt no_fastcall
ldr x16, [tsk, #TSK_TI_IPIPE]
tst x16, #_TIP_HEAD
b.ne fastcall_exit
bl __ipipe_root_sync
fastcall_tail:
ldr x0, [sp, #S_X0]
b ret_fast_syscall
fastcall_exit:
tst x16, #_TIP_MAYDAY
b.eq fastcall_notail
mov x0, sp
bl __ipipe_call_mayday
fastcall_notail:
ldr x0, [sp, #S_X0]
disable_irq
ldr x1, [tsk, #TSK_TI_FLAGS]
enable_step_tsk x1, x2
kernel_exit 0
no_fastcall:
ldr x16, [tsk, #TSK_TI_IPIPE]
fastcall_bypass:
tst x16, #_TIP_NOTIFY
b.ne syscall_pipeline
tst wscno, __ARM_ipipe_syscall
b.eq regular_syscall
syscall_pipeline:
mov x0, sp
bl __ipipe_notify_syscall
ldr x16, [tsk, #TSK_TI_IPIPE]
tst x16, #_TIP_HEAD
b.ne fastcall_notail
cmp w0, #0
b.ne fastcall_tail
regular_syscall:
ldp x0, x1, [sp, #S_X0]
ldp x2, x3, [sp, #S_X2]
ldp x4, x5, [sp, #S_X4]
ldp x6, x7, [sp, #S_X6]
#endif /* CONFIG_IPIPE */
ct_user_exit 1
ldr x16, [tsk, #TSK_TI_FLAGS] // check for syscall hooks
......
......@@ -225,6 +225,20 @@ static void __ipipe_do_IRQ(unsigned irq, void *cookie)
__handle_domain_irq(NULL, irq, false, regs);
}
void __ipipe_root_sync(void)
{
struct ipipe_percpu_domain_data *p;
unsigned long flags;
flags = hard_local_irq_save();
p = ipipe_this_cpu_root_context();
if (__ipipe_ipending_p(p))
__ipipe_sync_stage();
hard_local_irq_restore(flags);
}
static struct __ipipe_tscinfo tsc_info;
void __init __ipipe_tsc_register(struct __ipipe_tscinfo *info)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment