From 633389de656cac1be7a3bb3a2f716eb5c1a80b61 Mon Sep 17 00:00:00 2001 From: Itaru Kitayama Date: Sat, 10 Dec 2016 01:53:58 -0600 Subject: [PATCH] arm64 remove SYSCALL_EXIT_BREAKPOINT define and the DSIABLE_POSTONE code --- proccontrol/src/linux.C | 80 ----------------------------------------- 1 file changed, 80 deletions(-) diff --git a/proccontrol/src/linux.C b/proccontrol/src/linux.C index 67c5bf9529..7df4740164 100644 --- a/proccontrol/src/linux.C +++ b/proccontrol/src/linux.C @@ -101,9 +101,6 @@ using namespace ProcControlAPI; #define PTRACE_SETREGS PPC_PTRACE_SETREGS #endif -#if defined(arch_aarch64) -#define SYSCALL_EXIT_BREAKPOINT -#endif static pid_t P_gettid(); static bool t_kill(int pid, int sig); @@ -501,59 +498,16 @@ bool DecoderLinux::decode(ArchEvent *ae, std::vector &events) break; } } - /* - * aarch64 notes: - * Due to arm kenel bug, if tracer continues the tracee with PTRACE_SYSCALL, - * the kernel doesn't check the changed flags again before exiting. - * Hence, I assume syscalls exit quietly and normally. - * And move the code for exit stop here. - * "Postpone" is actually "postponed" below. - */ -#if defined(arch_aarch64) -#define DISABLE_POSTPONE -#endif - -#if defined(DISABLE_POSTPONE) - #if defined(SYSCALL_EXIT_BREAKPOINT) - #undef DISABLE_POSTPONE - #endif -#endif if (postpone) { archevent->event_ext = ext; -#if !defined(DISABLE_POSTPONE) pthrd_printf("Postponing event until syscall exit on %d/%d\n", proc->getPid(), thread->getLWP()); event = Event::ptr(new EventPostponedSyscall()); lthread->postponeSyscallEvent(archevent); archevent = NULL; -#else //disable postpone - pthrd_printf("ARM-warning: syscall is not postponed on %d/%d.\n", - proc->getPid(), thread->getLWP() ); - - switch (ext) { - case PTRACE_EVENT_FORK: - case PTRACE_EVENT_CLONE: - pthrd_printf("Handle %s event after syscall enter on %d/%d\n", - ext == PTRACE_EVENT_FORK ? "fork" : "clone", - proc->getPid(), thread->getLWP()); - if (!archevent->findPairedEvent(parent, child)) { - pthrd_printf("Parent half of paired event, postponing decode " - "until child arrives\n"); - archevent->postponePairedEvent(); - return true; - } - break; - case PTRACE_EVENT_EXEC: - pthrd_printf("Resuming exec event after syscall exit on %d/%d\n", - proc->getPid(), thread->getLWP()); - event = Event::ptr(new EventExec(EventType::Post)); - event->setSyncType(Event::sync_process); - break; - } -#endif } break; } @@ -581,40 +535,6 @@ bool DecoderLinux::decode(ArchEvent *ae, std::vector &events) } adjusted_addr = adjustTrapAddr(addr, proc->getTargetArch()); - // handle the fake syscall exit stop bp. -#if defined(SYSCALL_EXIT_BREAKPOINT) - if( lthread->addr_fakeSyscallExitBp == adjusted_addr - && lthread->isSet_fakeSyscallExitBp){ - //do the same as syscall_exit_stop signal - if (lthread->hasPostponedSyscallEvent()) { - delete archevent; - archevent = lthread->getPostponedSyscallEvent(); - ext = archevent->event_ext; - switch (ext) { - case PTRACE_EVENT_FORK: - case PTRACE_EVENT_CLONE: - pthrd_printf("Resuming %s event after syscall exit on %d/%d\n", - ext == PTRACE_EVENT_FORK ? "fork" : "clone", - proc->getPid(), thread->getLWP()); - if (!archevent->findPairedEvent(parent, child)) { - pthrd_printf("Parent half of paired event, postponing decode " - "until child arrives\n"); - archevent->postponePairedEvent(); - return true; - } - break; - case PTRACE_EVENT_EXEC: - pthrd_printf("Resuming exec event after syscall exit on %d/%d\n", - proc->getPid(), thread->getLWP()); - event = Event::ptr(new EventExec(EventType::Post)); - event->setSyncType(Event::sync_process); - break; - } - break; - } - } -#endif - if (rpcMgr()->isRPCTrap(thread, adjusted_addr)) { pthrd_printf("Decoded event to rpc completion on %d/%d at %lx\n", proc->getPid(), thread->getLWP(), adjusted_addr);