Up to [cvs.NetBSD.org] / src / sys / kern
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Sync with HEAD
Pull up following revision(s) (requested by riastradh in ticket #1385): sys/kern/sys_process_lwpstatus.c: revision 1.6 sys/kern/sys_process_lwpstatus.c: revision 1.7 sys/kern/sys_process_lwpstatus.c: revision 1.8 sys/arch/x86/include/dbregs.h: revision 1.9 sys/kern/sys_process_lwpstatus.c: revision 1.9 sys/sys/ptrace.h: revision 1.78 sys/arch/x86/x86/dbregs.c: revision 1.16 sys/kern/sys_process_lwpstatus.c: revision 1.10 sys/arch/i386/i386/process_machdep.c: revision 1.98 sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.10 sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.11 sys/arch/amd64/amd64/process_machdep.c: revision 1.51 ptrace/procfs: Take lwp lock around process_read/write_(fp)regs(32). And verify that the lwp is in LSSTOP state before trying to read. Otherwise, we might catch an lwp while it's still running on the CPU, with all FPU state active, making the result unstable and tripping assertions on some architectures. PR port-amd64/60556: panic in process_read_fpregs_xmm proc_regio: Clarify control flow and sprinkle comments. Use `if (error) goto out' instead of `if (error == 0) error = ...' to make the error case non-linear and indented, and the success case a straight line of logic. No functional change intended. PR port-amd64/60556: panic in process_read_fpregs_xmm x86: Pull dbregs buffer allocation out from under lwp_lock. Sprinkle assertions and notes about locking rules while here. PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG This fixes a bug that was revealed by lifting up rock while fixing: PR kern/60556: panic in process_read_fpregs_xmm netbsd32_ptrace: Fix locking around ptrace register access. PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs() ptrace(2): Tidy register access: no sketchy function pointer casts. Followups for: PR port-amd64/60556: panic in process_read_fpregs_xmm PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs() ptrace(2): Fix compat32 register set types in previous. Not always `struct reg32' or `struct fpreg32', notably on arm32 -- make sure to say `process_reg32'/`process_fpreg32'/`process_dbreg32'. (Here `compat32' means oabi?) Followups for: PR port-amd64/60556: panic in process_read_fpregs_xmm PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs() netbsd32_ptrace: Need to pre-allocate dbregs before read/write. Followup for: PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs()
Pull up following revision(s) (requested by riastradh in ticket #540): sys/kern/sys_process_lwpstatus.c: revision 1.6 sys/kern/sys_process_lwpstatus.c: revision 1.7 sys/kern/sys_process_lwpstatus.c: revision 1.8 sys/arch/x86/include/dbregs.h: revision 1.9 sys/kern/sys_process_lwpstatus.c: revision 1.9 sys/sys/ptrace.h: revision 1.78 sys/arch/x86/x86/dbregs.c: revision 1.16 sys/kern/sys_process_lwpstatus.c: revision 1.10 sys/arch/i386/i386/process_machdep.c: revision 1.98 sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.10 sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.11 sys/arch/amd64/amd64/process_machdep.c: revision 1.51 ptrace/procfs: Take lwp lock around process_read/write_(fp)regs(32). And verify that the lwp is in LSSTOP state before trying to read. Otherwise, we might catch an lwp while it's still running on the CPU, with all FPU state active, making the result unstable and tripping assertions on some architectures. PR port-amd64/60556: panic in process_read_fpregs_xmm proc_regio: Clarify control flow and sprinkle comments. Use `if (error) goto out' instead of `if (error == 0) error = ...' to make the error case non-linear and indented, and the success case a straight line of logic. No functional change intended. PR port-amd64/60556: panic in process_read_fpregs_xmm x86: Pull dbregs buffer allocation out from under lwp_lock. Sprinkle assertions and notes about locking rules while here. PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG This fixes a bug that was revealed by lifting up rock while fixing: PR kern/60556: panic in process_read_fpregs_xmm netbsd32_ptrace: Fix locking around ptrace register access. PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs() ptrace(2): Tidy register access: no sketchy function pointer casts. Followups for: PR port-amd64/60556: panic in process_read_fpregs_xmm PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs() ptrace(2): Fix compat32 register set types in previous. Not always `struct reg32' or `struct fpreg32', notably on arm32 -- make sure to say `process_reg32'/`process_fpreg32'/`process_dbreg32'. (Here `compat32' means oabi?) Followups for: PR port-amd64/60556: panic in process_read_fpregs_xmm PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs() netbsd32_ptrace: Need to pre-allocate dbregs before read/write. Followup for: PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs()
ptrace(2): Fix compat32 register set types in previous. Not always `struct reg32' or `struct fpreg32', notably on arm32 -- make sure to say `process_reg32'/`process_fpreg32'/`process_dbreg32'. (Here `compat32' means oabi?) Followups for: PR port-amd64/60556: panic in process_read_fpregs_xmm PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs()
ptrace(2): Tidy register access: no sketchy function pointer casts. Followups for: PR port-amd64/60556: panic in process_read_fpregs_xmm PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG PR kern/60658: netbsd32_process_read_dbregs() needs the same fix as native amd64 process_read_dbregs()
x86: Pull dbregs buffer allocation out from under lwp_lock. Sprinkle assertions and notes about locking rules while here. PR kern/60595: System lockup using gdb(1) on kernel with DEBUG+LOCKDEBUG This fixes a bug that was revealed by lifting up rock while fixing: PR kern/60556: panic in process_read_fpregs_xmm
proc_regio: Clarify control flow and sprinkle comments. Use `if (error) goto out' instead of `if (error == 0) error = ...' to make the error case non-linear and indented, and the success case a straight line of logic. No functional change intended. PR port-amd64/60556: panic in process_read_fpregs_xmm
ptrace/procfs: Take lwp lock around process_read/write_(fp)regs(32). And verify that the lwp is in LSSTOP state before trying to read. Otherwise, we might catch an lwp while it's still running on the CPU, with all FPU state active, making the result unstable and tripping assertions on some architectures. PR port-amd64/60556: panic in process_read_fpregs_xmm
Sync with HEAD
Pull up following revision(s) (requested by hgutch in ticket #1039): sys/kern/sys_process_lwpstatus.c: revision 1.5 sys/sys/ptrace.h: revision 1.77 sys/kern/sys_ptrace_common.c: revision 1.96 PR/58983: Harold Gutch: Fix INSTALL_FLOPPY on i386. Make the register handling code conditional on if PTRACE is enabled in the kernel.
PR/58983: Harold Gutch: Fix INSTALL_FLOPPY on i386. Make the register handling code conditional on if PTRACE is enabled in the kernel.
ptrace(PT_LWPSTATUS): Fix lid=0 case. Make ptrace_read_lwpstatus always overwrite the whole struct ptrace_lwpstatus so the caller doesn't have to make sure pl_lwpid is initialized correctly -- ptrace_lwpstatus was missing that reinitialization after ptrace_update_lwp, but it's less work for all the callers if we just make the assertion an assignment instead.
Include missing <sys/proc.h>. Hopefully fix build for everyone except vax, for which process_machep.c is missing.
Basic register read/write functionality and lwp setting are always provided by the kernel because they are needed by multiple things (ptrace/procfs/coredump), so move them to sys_process_lwpstatus (this file should be renamed to sys_process_common.c?)
Merge changes from current as of 20200406
file sys_process_lwpstatus.c was added on branch phil-wifi on 2020-04-08 14:08:52 +0000
Rename sys_ptrace_lwpstatus.c to sys_process_lwpstatus.c Keep the names of functions internally as ptrace intact as this code is shared with core_elf32.c that already reaches ptrace(2) specifc symbols. No functional change intended.