Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f14488cc authored by Shaohua Li's avatar Shaohua Li Committed by Tony Luck
Browse files

[IA64] utrace use generic trace hook



Make IA64 use generic trace hook in some paths.

Signed-off-by: default avatarShaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent cfb361f1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -108,6 +108,11 @@ GLOBAL_ENTRY(ia32_trace_syscall)
	;;
	st8 [r2]=r3				// initialize return code to -ENOSYS
	br.call.sptk.few rp=syscall_trace_enter	// give parent a chance to catch syscall args
	cmp.lt p6,p0=r8,r0			// check tracehook
	adds r2=IA64_PT_REGS_R8_OFFSET+16,sp	// r2 = &pt_regs.r8
	;;
(p6)	st8.spill [r2]=r8			// store return value in slot for r8
(p6)	br.spnt.few .ret4
.ret2:	// Need to reload arguments (they may be changed by the tracing process)
	adds r2=IA64_PT_REGS_R1_OFFSET+16,sp	// r2 = &pt_regs.r1
	adds r3=IA64_PT_REGS_R13_OFFSET+16,sp	// r3 = &pt_regs.r13
+0 −3
Original line number Diff line number Diff line
@@ -87,9 +87,6 @@ struct thread_info {
#define alloc_task_struct()	((struct task_struct *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER))
#define free_task_struct(tsk)	free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)

#define tsk_set_notify_resume(tsk) \
	set_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME)
extern void tsk_clear_notify_resume(struct task_struct *tsk);
#endif /* !__ASSEMBLY */

/*
+5 −0
Original line number Diff line number Diff line
@@ -534,6 +534,11 @@ GLOBAL_ENTRY(ia64_trace_syscall)
 	stf.spill [r16]=f10
 	stf.spill [r17]=f11
	br.call.sptk.many rp=syscall_trace_enter // give parent a chance to catch syscall args
	cmp.lt p6,p0=r8,r0			// check tracehook
	adds r2=PT(R8)+16,sp			// r2 = &pt_regs.r8
	adds r3=PT(R10)+16,sp			// r3 = &pt_regs.r10
	mov r10=0
(p6)	br.cond.sptk strace_error		// syscall failed ->
	adds r16=PT(F6)+16,sp
	adds r17=PT(F7)+16,sp
	;;
+3 −4
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include <linux/capability.h>
#include <linux/rcupdate.h>
#include <linux/completion.h>
#include <linux/tracehook.h>

#include <asm/errno.h>
#include <asm/intrinsics.h>
@@ -3684,7 +3685,7 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)

		PFM_SET_WORK_PENDING(task, 1);

		tsk_set_notify_resume(task);
		set_notify_resume(task);

		/*
		 * XXX: send reschedule if task runs on another CPU
@@ -5044,8 +5045,6 @@ pfm_handle_work(void)

	PFM_SET_WORK_PENDING(current, 0);

	tsk_clear_notify_resume(current);

	regs = task_pt_regs(current);

	/*
@@ -5414,7 +5413,7 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
			 * when coming from ctxsw, current still points to the
			 * previous task, therefore we must work with task and not current.
			 */
			tsk_set_notify_resume(task);
			set_notify_resume(task);
		}
		/*
		 * defer until state is changed (shorten spin window). the context is locked
+6 −15
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <linux/delay.h>
#include <linux/kdebug.h>
#include <linux/utsname.h>
#include <linux/tracehook.h>

#include <asm/cpu.h>
#include <asm/delay.h>
@@ -160,21 +161,6 @@ show_regs (struct pt_regs *regs)
		show_stack(NULL, NULL);
}

void tsk_clear_notify_resume(struct task_struct *tsk)
{
#ifdef CONFIG_PERFMON
	if (tsk->thread.pfm_needs_checking)
		return;
#endif
	if (test_ti_thread_flag(task_thread_info(tsk), TIF_RESTORE_RSE))
		return;
	clear_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME);
}

/*
 * do_notify_resume_user():
 *	Called from notify_resume_user at entry.S, with interrupts disabled.
 */
void
do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long in_syscall)
{
@@ -203,6 +189,11 @@ do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long in_syscall)
		ia64_do_signal(scr, in_syscall);
	}

	if (test_thread_flag(TIF_NOTIFY_RESUME)) {
		clear_thread_flag(TIF_NOTIFY_RESUME);
		tracehook_notify_resume(&scr->pt);
	}

	/* copy user rbs to kernel rbs */
	if (unlikely(test_thread_flag(TIF_RESTORE_RSE))) {
		local_irq_enable();	/* force interrupt enable */
Loading