summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/ptrace.c
Commit message (Collapse)AuthorAgeFilesLines
* sparc,sparc64: unify kernel/Sam Ravnborg2008-12-041-1090/+0
| | | | | | | | | | | | | | | | o Move all files from sparc64/kernel/ to sparc/kernel - rename as appropriate o Update sparc/Makefile to the changes o Update sparc/kernel/Makefile to include the sparc64 files NOTE: This commit changes link order on sparc64! Link order had to change for either of sparc32 and sparc64. And assuming sparc64 see more testing than sparc32 change link order on sparc64 where issues will be caught faster. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Fix bug in PTRACE_SETFPREGS64 handling.Chris Torek2008-12-031-1/+1
| | | | | | | | | | | | From: Chris Torek <chris.torek@windriver.com> >The SPARC64 kernel code for PTRACE_SETFPREGS64 appears to be an exact copy >of that for PTRACE_GETFPREGS64. This means that gdbserver and native >64-bit GDB cannot set floating-point registers. It looks like a simple typo. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc: Fix user_regset 'n' field values.David S. Miller2008-09-121-4/+4
| | | | | | | | | | As noticed by Russell King, we were not setting this properly to the number of entries, but rather the total size. This results in the core dumping code allocating waayyyy too much memory. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Split syscall_trace() into two functions.David S. Miller2008-08-241-18/+20
| | | | | | | | Christoph Hellwig noticed that having both entry and exit logic in one function no longer makes sense, and having seperate ones simplifies things a lot. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: tracehook syscallRoland McGrath2008-07-271-20/+12
| | | | | | | | | | | | This changes sparc64 syscall tracing to use the new tracehook.h entry points. [ Add assembly changes to force an immediate -ENOSYS return from the system call when syscall_trace() returns non-zero at syscall entry. -DaveM ] Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc: Fix debugger syscall restart interactions.David S. Miller2008-05-111-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So, forever, we've had this ptrace_signal_deliver implementation which tries to handle all of the nasties that can occur when the debugger looks at a process about to take a signal. It's meant to address all of these issues inside of the kernel so that the debugger need not be mindful of such things. Problem is, this doesn't work. The idea was that we should do the syscall restart business first, so that the debugger captures that state. Otherwise, if the debugger for example saves the child's state, makes the child execute something else, then restores the saved state, we won't handle the syscall restart properly because we lose the "we're in a syscall" state. The code here worked for most cases, but if the debugger actually passes the signal through to the child unaltered, it's possible that we would do a syscall restart when we shouldn't have. In particular this breaks the case of debugging a process under a gdb which is being debugged by yet another gdb. gdb uses sigsuspend to wait for SIGCHLD of the inferior, but if gdb itself is being debugged by a top-level gdb we get a ptrace_stop(). The top-level gdb does a PTRACE_CONT with SIGCHLD to let the inferior gdb see the signal. But ptrace_signal_deliver() assumed the debugger would cancel out the signal and therefore did a syscall restart, because the return error was ERESTARTNOHAND. Fix this by simply making ptrace_signal_deliver() a nop, and providing a way for the debugger to control system call restarting properly: 1) Report a "in syscall" software bit in regs->{tstate,psr}. It is set early on in trap entry to a system call and is fully visible to the debugger via ptrace() and regsets. 2) Test this bit right before doing a syscall restart. We have to do a final recheck right after get_signal_to_deliver() in case the debugger cleared the bit during ptrace_stop(). 3) Clear the bit in trap return so we don't accidently try to set that bit in the real register. As a result we also get a ptrace_{is,clear}_syscall() for sparc32 just like sparc64 has. M68K has this same exact bug, and is now the only other user of the ptrace_signal_deliver hook. It needs to be fixed in the same exact way as sparc. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc: Fix ptrace() detach.David S. Miller2008-05-111-0/+4
| | | | | | | | | | | | | Forever we had a PTRACE_SUNOS_DETACH which was unconditionally recognized, regardless of the personality of the process. Unfortunately, this value is what ended up in the GLIBC sys/ptrace.h header file on sparc as PTRACE_DETACH and PT_DETACH. So continue to recognize this old value. Luckily, it doesn't conflict with anything we actually care about. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC]: Fix several regset and ptrace bugs.David S. Miller2008-04-091-51/+97
| | | | | | | | | | | | | | | | | 1) ptrace should pass 'current' to task_user_regset_view() 2) When fetching general registers using a 64-bit view, and the target is 32-bit, we have to convert. 3) Skip the whole register window get/set code block if the user isn't asking to access anything in there. Otherwise we have problems if the user doesn't have an address space setup. Fetching ptrace register is still valid at such a time, and ptrace does not try to access the register window area of the regset. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix user accesses in regset code.David S. Miller2008-04-031-21/+115
| | | | | | | | If target is not current we need to use access_process_vm(). Noticed by Roland McGrath. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: flush_ptrace_access() needs preemption disable.David S. Miller2008-03-261-0/+4
| | | | | | Based upon a report by Mariusz Kozlowski. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix allnoconfig build, ptrace.c missing CONFIG_COMPAT checks.David S. Miller2008-03-261-0/+6
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/ptrace.cDavid S. Miller2008-03-261-2/+8
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Make use of compat_sys_ptrace()David S. Miller2008-02-071-158/+108
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Use regsets in arch_ptrace().David S. Miller2008-02-071-132/+77
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Remove unintentional ptrace debugging messages.David S. Miller2008-02-071-5/+0
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC]: Move over to arch_ptrace().David S. Miller2008-02-071-280/+109
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC]: Remove PTRACE_SUN* handling.David S. Miller2008-02-071-14/+1
| | | | | | | | Supporting SunOS ptrace() is pretty pointless and these kinds of quirks keep us from being able to share more code with other platforms. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC]: Kill DEBUG_PTRACE code.David S. Miller2008-02-071-43/+0
| | | | | | It has long exceeded it's usefulness. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Add user regsets.David S. Miller2008-02-071-1/+581
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC{32,64}]: Propagate ptrace_traceme() return value.Alexey Dobriyan2006-12-101-1/+4
| | | | | | | | | | | ptrace_traceme() consolidation made ret = ptrace_traceme(); dead write. Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] drop task argument of audit_syscall_{entry,exit}Al Viro2006-05-011-3/+2
| | | | | | ... it's always current, and that's a good thing - allows simpler locking. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* [SPARC64]: Translate PTRACE_GETEVENTMSG for 32-bit tasks.David S. Miller2006-04-091-0/+16
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Add dummy PTRACE_PEEKUSR for gdb.David S. Miller2006-04-091-0/+7
| | | | | | | | GDB uses a PTRACE_PEEKUSR call with offset 0 to see if a thread is alive, so provide a success return for this particular special case. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Don't do anything in flush_ptrace_access() on SUN4V.David S. Miller2006-03-201-0/+3
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] sparc64: task_pt_regs()Al Viro2006-01-121-6/+6
| | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sparc64: task_thread_info()Al Viro2006-01-121-17/+17
| | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] use ptrace_get_task_struct in various placesChristoph Hellwig2006-01-081-29/+5
| | | | | | | | | | | | | | | | The ptrace_get_task_struct() helper that I added as part of the ptrace consolidation is useful in variety of places that currently opencode it. Switch them to the common helpers. Add a ptrace_traceme() helper that needs to be explicitly called, and simplify the ptrace_get_task_struct() interface. We don't need the request argument now, and we return the task_struct directly, using ERR_PTR() for error returns. It's a bit more code in the callers, but we have two sane routines that do one thing well now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [SPARC64]: Fix several bugs in flush_ptrace_access().David S. Miller2005-09-291-3/+11
| | | | | | | | | 1) Use cpudata cache line sizes, not magic constants. 2) Align start address in cheetah case so we do not get unaligned address traps. (pgrep was good at triggering this, via /proc/${pid}/cmdline accesses) Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Move DCACHE_ALIASING_POSSIBLE define to asm/page.hDavid S. Miller2005-09-191-3/+4
| | | | | | | | This showed that arch/sparc64/kernel/ptrace.c was not getting the define properly, and thus the code protected by this ifdef was never actually compiled before. So fix that too. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Add syscall auditing support.David S. Miller2005-07-101-3/+29
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Pass regs and entry/exit boolean to syscall_trace()David S. Miller2005-07-101-2/+2
| | | | | | | | Also fix a bug in 32-bit syscall tracing. We forgot to update this code when we moved over to the convention that all 32-bit syscall arguments are zero extended by default. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Add SECCOMP support.David S. Miller2005-07-101-8/+4
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] convert that currently tests _NSIG directly to use valid_signal()Jesper Juhl2005-05-011-1/+2
| | | | | | | | | Convert most of the current code that uses _NSIG directly to instead use valid_signal(). This avoids gcc -W warnings and off-by-one errors. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sparc64: Reduce ptrace cache flushingDavid S. Miller2005-04-171-27/+55
| | | | | | | | | | | | | | | | | | | | | | We were flushing the D-cache excessively for ptrace() processing and this makes debugging threads so slow as to be totally unusable. All process page accesses via ptrace() go via access_process_vm(). This routine, for each process page, uses get_user_pages(). That in turn does a flush_dcache_page() on the child pages before we copy in/out the ptrace request data. Therefore, all we need to do after the data movement is: 1) Flush the D-cache pages if the kernel maps the page to a different color than userspace does. 2) If we wrote to the page, we need to flush the I-cache on older cpus. Previously we just flushed the entire cache at the end of a ptrace() request, and that was beyond stupid. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sparc: Fix PTRACE_CONT bogosityDavid S. Miller2005-04-171-19/+0
| | | | | | | | | | | | | | | | | | | | SunOS aparently had this weird PTRACE_CONT semantic which we copied. If the addr argument is something other than 1, it sets the process program counter to whatever that value is. This is different from every other Linux architecture, which don't do anything with the addr and data args. This difference in particular breaks the Linux native GDB support for fork and vfork tracing on sparc and sparc64. There is no interest in running SunOS binaries using this weird PTRACE_CONT behavior, so just delete it so we behave like other platforms do. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-161-0/+646
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
OpenPOWER on IntegriCloud