Home | History | Annotate | Download | only in include
History log of /src/sys/arch/powerpc/include/ptrace.h
RevisionDateAuthorComments
 1.19  06-Mar-2021  rin For booke and ibm4xx, switch to software-based single-stepping for PT_STEP
ptrace(2) command from broken hardware-based implementation.

As described in proposal on port-powerpc@,

http://mail-index.netbsd.org/port-powerpc/2021/02/26/msg003597.html

hardware debug facilities of booke and 4xx use critical interrupts, that
are difficult to handle for this purpose; they are not automatically masked
when entering kernel mode via system call trap or hardware interrupt.
See my proposal above for more details.

Now, hardware debug facilities are exclusively usable by kernel itself.
They are much more functional than PSL_SE MSR bit of oea, and should be
useful to, e.g., support byte-granular watchpoint for DDB in the future.
 1.18  15-Oct-2020  mgorny branches: 1.18.2;
Fix the machine-dependent ptrace requests to respect LWP number

Fix the machine-dependent ptrace register-related requests (e.g.
PT_GETXMMREGS, PT_GETXSTATE on x86) to correctly respect the LWP number
passed as the data argument. Before this change, these requests
did not operate on the requested LWP of a multithreaded program.

This change required moving ptrace_update_lwp() out of unit scope,
and changing ptrace_machdep_dorequest() function to take a pointer
to pointer as the second argument, consistently with ptrace_regs().

I am planning to extend the ATF ptrace() register tests in the future
to check for regressions in multithreaded programs, as time permits.

Reviewed by kamil.
 1.17  21-Jun-2020  rin Fix inconsistency b/w kernel and userland recognitions of TLS, as well as
inconsistency whether it is biased or not in kernel.

- Obsolete __lwp_settcb() in order to let kernel know new TLS address via
_lwp_setprivate(2). Alternatively, we can call _lwp_setprivate(2) within
__lwp_settcb() like mips, but it is just double handling; we adjust %r2
appropriately in _lwp_setprivate(2) via cpu_lwp_setprivate().

- Make sure that, like other ports, l_private represents address of tcb,
not biased one as in %r2. This guarantees that the returned values from
_lwp_getprivate(2) and __lwp_getprivate_fast() are always same. Also,
we can obsolete PTRACE_LWP_GETPRIVATE() macro.

Now, *_pl_private tests in tests/lib/libc/sys successfully pass, while
no other tests become newly falling.
 1.16  24-Dec-2019  kamil Introduce PT_LWPSTATUS + PT_LWPNEXT, obsolete PT_LWPINFO

PT_LWPINFO is a legacy ptrace(2) operation that was originally intended
to retrieve the thread (LWP) information inside a traced process.

It has a number of flaws and is confused with PT_LWPINFO from FreeBSD.

PT_LWPSTATUS and PT_LWPNEXT address the problems (shortly by: rename,
removal of pl_event) and introduces new features: signal context
(pl_sigpend, pl_sigmask), LWP name (pl_name), LWP TLS base address
(pl_private). The private pointer was so far missing information for
a debugger.

PT_LWPSTATUS@nnn is now shipped with core(5) files and contain LWP specific
information, so far missed in the core(5) files.

PT_LWPSTATUS retrieves LWP information for the prompted thread.
PT_LWPNEXT retrieves LWP information for the next thread, borrowing the
semantics from NetBSD specific PT_LWPINFO.

PT_LWPINFO is namespaced with __LEGACY_PT_LWPINFO and still available for
the foreseeable future, without plans of removing it.

Add ATF tests for PT_LWPSTATUS + PT_LWPNEXT.

Keep ATF tests for PT_LWPINFO.

Switch GDB to new API.

Proposed on tech-kern@.
 1.15  29-Nov-2019  martin Add illegal asm and breakpoint
 1.14  18-Jun-2019  kamil Introduce PTRACE_REG_FP() a helper macro to retrieve the frame pointer

The macro is dummy for ia64 (the FP register is unknown and can change
freely) and sparc/sparc64 (not stored in struct reg).
 1.13  08-Apr-2017  kamil branches: 1.13.14;
Add new ptrace(2) API: PT_SETSTEP & PT_CLEARSTEP

These operations allow to mark thread as a single-stepping one.

This allows to i.a.:
- single step and emit a signal (PT_SETSTEP & PT_CONTINUE)
- single step and trace syscall entry and exit (PT_SETSTEP & PT_SYSCALL)

The former is useful for debuggers like GDB or LLDB. The latter can be used
to singlestep a usermode kernel. These examples don't limit use-cases of
this interface.

Define PT_*STEP only for platforms defining PT_STEP.

Add new ATF tests setstep[1234].

These ptrace(2) operations first appeared in FreeBSD.

Sponsored by <The NetBSD Foundation>
 1.12  15-Sep-2015  christos branches: 1.12.2; 1.12.4;
Provide access to pc/sp/syscall-return registers like we have for mcontext
 1.11  18-Jan-2011  matt branches: 1.11.16; 1.11.34;
Add support for BookE Freescale MPC85xx (e500 core) processors.
Add fast softint support for PowerPC (though only booke uses it).
Redo FPU/VEC support and add e500 SPE support.
Rework trap/intrs to use a common trapframe format.
Support SOFTFLOAT (no hardfloat or fpu emulation) for BookE.
 1.10  04-Mar-2007  christos branches: 1.10.66; 1.10.70; 1.10.72;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9  11-Dec-2005  christos branches: 1.9.26;
merge ktrace-lwp.
 1.8  06-May-2004  matt branches: 1.8.12;
Add PT_MACHDEP_STRINGS so that kdump(1) can print out the PowerPC-specific
ptrace requests.
 1.7  29-Jun-2003  fvdl branches: 1.7.2; 1.7.4;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.6  29-Jun-2003  darrenr 'struct proc *' -> 'struct lwp *' as required to get GENERIC for macppc built
 1.5  05-Mar-2003  matt Make AltiVec registers available via ptrace/procfs. Simplify AltiVec
processing. Add a "common" procfs_machdep.c for PowerPC platforms.
Even though it is supposed to be port specific, most (if not all)
PowerPC ports can just use the common one.
 1.4  04-Jun-2000  tsubai Add PT_GETFPREGS and PT_SETFPREGS support.
 1.3  03-May-1999  tsubai branches: 1.3.2; 1.3.10;
PT_{STEP,GETREGS,SETREGS} support.
 1.2  05-Jan-1998  perry branches: 1.2.10;
RCSID Police.
 1.1  01-Oct-1996  ws Add some files that CVS missed somehow
These are empty for now, but are needed by MI code
 1.2.10.1  21-Jun-1999  thorpej Sync w/ -current.
 1.3.10.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.4.1  10-May-2004  tron Pull up revision 1.8 (requested by matt in ticket #278):
Add PT_MACHDEP_STRINGS so that kdump(1) can print out the
PowerPC-specific
ptrace requests.
 1.7.2.4  18-Nov-2004  skrll Adapt to branch. macppc release builds.
 1.7.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1  03-Aug-2004  skrll Sync with HEAD
 1.8.12.2  03-Sep-2007  yamt sync with head.
 1.8.12.1  21-Jun-2006  yamt sync with head.
 1.9.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.10.72.1  06-Jun-2011  jruoho Sync with HEAD.
 1.10.70.1  11-Jan-2011  matt Anything that applies to Altivec also applies SPE since to the common powerpc
code they share identical hooks.
 1.10.66.1  05-Mar-2011  rmind sync with head
 1.11.34.2  28-Aug-2017  skrll Sync with HEAD
 1.11.34.1  22-Sep-2015  skrll Sync with HEAD
 1.11.16.1  03-Dec-2017  jdolecek update from HEAD
 1.12.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.12.2.1  26-Apr-2017  pgoyette Sync with HEAD
 1.13.14.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.13.14.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.18.2.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed