Re: [PATCHv3 09/19] arm64: convert syscall trace logic to C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 18, 2018 at 01:03:00PM +0100, Mark Rutland wrote:
> +asmlinkage void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> +			       syscall_fn_t syscall_table[])
> +{
> +	unsigned long flags = current_thread_info()->flags;
> +
> +	regs->orig_x0 = regs->regs[0];
> +	regs->syscallno = scno;
> +
> +	local_daif_restore(DAIF_PROCCTX);
> +	user_exit();
> +
> +	if (has_syscall_work(flags)) {
> +		/* set default errno for user-issued syscall(-1) */
> +		if (scno == NO_SYSCALL)
> +			regs->regs[0] = -ENOSYS;
> +		scno = syscall_trace_enter(regs);
> +		if (scno == NO_SYSCALL)
> +			goto trace_exit;
> +	}
> +
> +	invoke_syscall(regs, scno, sc_nr, syscall_table);
> +
> +	/*
> +	 * The tracing status may have changed under our feet, so we have to
> +	 * check again. However, if we were tracing entry, then we always trace
> +	 * exit regardless, as the old entry assembly did.
> +	 */
> +	if (!has_syscall_work(flags)) {
> +		local_daif_mask();
> +		flags = current_thread_info()->flags;
> +		if (!has_syscall_work(flags))
> +			return;
> +		local_daif_restore(DAIF_PROCCTX);
> +	}

IIUC the above 'if' block replaces ret_fast_syscall in entry.S with the
work_pending handled via ret_to_user (we used to check _TIF_WORK_MASK in
two places). 

Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux