Commit 8df74b07 authored by Don Mahurin's avatar Don Mahurin Committed by Philippe Gerum
Browse files

arm64/ipipe: syscall updates. enable __ipipe_syscall_root. add call from entry.S

remove conditional aeabi/oabi code which does not apply to armv8/arm64
parent 4cf710e8
...@@ -695,6 +695,19 @@ el0_svc: ...@@ -695,6 +695,19 @@ el0_svc:
el0_svc_naked: // compat entry point el0_svc_naked: // compat entry point
stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number
enable_dbg_and_irq enable_dbg_and_irq
#ifdef CONFIG_IPIPE
mov x1, sp
mov x0, scno
bl __ipipe_syscall_root
cmp x0, #0
blt __ipipe_ret_to_user
get_thread_info tsk
bgt ret_to_user
ldp x0, x1, [sp]
ldp x2, x3, [sp, #S_X2]
#endif /* CONFIG_IPIPE */
ct_user_exit 1 ct_user_exit 1
ldr x16, [tsk, #TI_FLAGS] // check for syscall hooks ldr x16, [tsk, #TI_FLAGS] // check for syscall hooks
......
...@@ -355,18 +355,15 @@ __ipipe_switch_to_notifier_call_chain(struct atomic_notifier_head *nh, ...@@ -355,18 +355,15 @@ __ipipe_switch_to_notifier_call_chain(struct atomic_notifier_head *nh,
(void)(flags); \ (void)(flags); \
}) })
#ifndef __NR_SYSCALL_BASE
#define __NR_SYSCALL_BASE 0
#endif
asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs) asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs)
{ {
#ifdef CONFIG_OABI_COMPAT
const bool oabi = scno + __NR_SYSCALL_BASE != regs->ARM_r7;
#elif defined(CONFIG_AEABI)
const bool oabi = false;
#else /* OABI */
const bool oabi = true;
#endif
struct task_struct *const task = current; struct task_struct *const task = current;
struct ipipe_percpu_domain_data *p; struct ipipe_percpu_domain_data *p;
unsigned long orig_r7; unsigned long orig_x8;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -387,18 +384,15 @@ asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs) ...@@ -387,18 +384,15 @@ asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs)
if (!__ipipe_syscall_watched_p(task, scno)) if (!__ipipe_syscall_watched_p(task, scno))
goto out; goto out;
if (oabi) { /*
/* * We use x8 to pass the syscall number to the other domains.
* We use r7 to pass the syscall number to the other domains. */
*/ orig_x8 = regs->regs[8];
orig_r7 = regs->ARM_r7; regs->regs[8] = scno;
regs->ARM_r7 = scno;
}
ret = __ipipe_notify_syscall(regs); ret = __ipipe_notify_syscall(regs);
if (oabi) regs->regs[8] = orig_x8;
regs->ARM_r7 = orig_r7;
flags = fast_irq_disable(); flags = fast_irq_disable();
......
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