History log of /freebsd-current/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
Revision Date Author Comments
# 088cf0c5 20-Nov-2022 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc/dtrace: Guard fuword64 usage for powerpc64 only

32-bit powerpc doesn't have a fuword64, so only use it on powerpc64.
This could also be done elsewhere that splits 32-bit and 64-bit
accesses, but adding ifdefs everywhere would just clutter up the source
for little benefit. This is the only usage of fuword64 directly; other
archs have a dtrace_fuword64_nocheck(), but powerpc does not, and I
don't see a need to add it currently.

MFC after: 1 week


# ec9388dd 30-Oct-2022 Justin Hibbits <jhibbits@FreeBSD.org>

dtrace: Make pid provider work on trivial tests

'newpc' needs set in the "common" case. With this, the trivial test

$ dtrace -n 'pid$target:libc:strlen:entry { trace(timestamp); }' -p
<pid>

now works.

MFC after: 3 weeks


# f74deaba 12-Dec-2017 Mark Johnston <markj@FreeBSD.org>

Correct initialization of pc on powerpc.

PR: 224293
Submitted by: Breno Leitao <breno.leitao@gmail.com>
X-MFC with: r326774
Pointy hat: markj


# 5bab6234 11-Dec-2017 Mark Johnston <markj@FreeBSD.org>

Pass the trap frame to fasttrap hooks.

The DTrace fasttrap entry points expect a struct reg containing the
register values of the calling thread. Perform the conversion in
fasttrap rather than in the trap handler: this reduces the number of
ifdefs and avoids wasting stack space for traps that don't involve
DTrace.

MFC after: 2 weeks


# 9e579a58 24-Sep-2016 Mark Johnston <markj@FreeBSD.org>

Move implementations of uread() and uwrite() to the illumos compat layer.

MFC after: 1 week


# 380344a7 07-Mar-2016 Mark Johnston <markj@FreeBSD.org>

Fix fasttrap tracepoint locking.

Upstream, tracepoints are protected by per-CPU mutexes. An unlinked
tracepoint may be freed once all the tracepoint mutexes have been acquired
and released - this is done in fasttrap_mod_barrier(). This mechanism was
not properly ported: in some places, the proc lock is used in place of a
tracepoint lock, and in others the locking is omitted entirely. This change
implements tracepoint locking with an rmlock, where the read lock is used
in fasttrap probe context. As a side effect, this fixes a recursion on the
proc lock when the raise action is used from a userland probe.

MFC after: 1 month


# 711fbd17 07-Dec-2015 Mark Johnston <markj@FreeBSD.org>

Add helper functions proc_readmem() and proc_writemem().

These helper functions can be used to read in or write a buffer from or to
an arbitrary process' address space. Without them, this can only be done
using proc_rwmem(), which requires the caller to fill out a uio. This is
onerous and results in code duplication; the new functions provide a simpler
interface which is sufficient for most existing callers of proc_rwmem().

This change also adds a manual page for proc_rwmem() and the new functions.

Reviewed by: jhb, kib
Differential Revision: https://reviews.freebsd.org/D4245


# 45bf6d59 09-May-2015 Justin Hibbits <jhibbits@FreeBSD.org>

Fix a couple bugs in 64-bit powerpc fasttrap argument retrieval.

Found by code inspection.


# e53c69c1 10-Dec-2013 Mark Johnston <markj@FreeBSD.org>

Correct the check for errors from proc_rwmem().

MFC after: 2 weeks


# 30b318b9 15-Oct-2013 Justin Hibbits <jhibbits@FreeBSD.org>

Add fasttrap for PowerPC. This is the last piece of the dtrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.

MFC after: 1 month


# c7570492 07-Nov-2012 Justin Hibbits <jhibbits@FreeBSD.org>

Implement DTrace for PowerPC. This includes both 32-bit and 64-bit.

There is one known issue: Some probes will display an error message along the
lines of: "Invalid address (0)"

I tested this with both a simple dtrace probe and dtruss on a few different
binaries on 32-bit. I only compiled 64-bit, did not run it, but I don't expect
problems without the modules loaded. Volunteers are welcome.

MFC after: 1 month