diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2014-11-29 20:54:33 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2014-11-29 20:54:33 +0000 |
commit | 56d52388251ae50e236d698bc2596e9e4473cd3f (patch) | |
tree | a35cc3aa1ff22bdd9178c537d1fac5bc962c94c6 /sys/powerpc/aim | |
parent | 443d4e8f9b3c39375a4f5d88aaa6961ada4680f3 (diff) | |
download | FreeBSD-src-56d52388251ae50e236d698bc2596e9e4473cd3f.zip FreeBSD-src-56d52388251ae50e236d698bc2596e9e4473cd3f.tar.gz |
Add support for dtrace:fbt on modules for PowerPC
Summary:
Revert the initial FBT-with-KDB changes for trap_subr*.S, and instead use the
db_trap filter function to handle dtrace trap filtering. With this, the MMU is
enabled by the support code, simplifying the codepath altogether.
Test Plan: Tested on my G4 PowerBook
Reviewers: #powerpc, nwhitehorn
Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D1207
MFC after: 3 weeks
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r-- | sys/powerpc/aim/machdep.c | 4 | ||||
-rw-r--r-- | sys/powerpc/aim/trap.c | 5 | ||||
-rw-r--r-- | sys/powerpc/aim/trap_subr32.S | 17 | ||||
-rw-r--r-- | sys/powerpc/aim/trap_subr64.S | 17 |
4 files changed, 11 insertions, 32 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index 5864a02..d1413a2 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -757,6 +757,10 @@ db_trap_glue(struct trapframe *frame) || frame->exc == EXC_BPT || frame->exc == EXC_DSI)) { int type = frame->exc; + + /* Ignore DTrace traps. */ + if (*(uint32_t *)frame->srr0 == EXC_DTRACE) + return (0); if (type == EXC_PGM && (frame->srr1 & 0x20000)) { type = T_BREAKPOINT; } diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index cc54e59..8276e96 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -258,7 +258,8 @@ trap(struct trapframe *frame) if (frame->srr1 & EXC_PGM_TRAP) { #ifdef KDTRACE_HOOKS inst = fuword32((const void *)frame->srr0); - if (inst == 0x0FFFDDDD && dtrace_pid_probe_ptr != NULL) { + if (inst == 0x0FFFDDDD && + dtrace_pid_probe_ptr != NULL) { struct reg regs; fill_regs(td, ®s); (*dtrace_pid_probe_ptr)(®s); @@ -301,7 +302,7 @@ trap(struct trapframe *frame) #ifdef KDTRACE_HOOKS case EXC_PGM: if (frame->srr1 & EXC_PGM_TRAP) { - if (*(uint32_t *)frame->srr0 == 0x7c810808) { + if (*(uint32_t *)frame->srr0 == EXC_DTRACE) { if (dtrace_invop_jump_addr != NULL) { dtrace_invop_jump_addr(frame); return; diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S index 56ca715..2aae2a0 100644 --- a/sys/powerpc/aim/trap_subr32.S +++ b/sys/powerpc/aim/trap_subr32.S @@ -890,8 +890,7 @@ CNAME(dblow): mfcr %r29 /* save CR in r29 */ mfsrr1 %r1 mtcr %r1 - bf 17,2f /* branch if privileged */ -1: + bf 17,1f /* branch if privileged */ /* Unprivileged case */ mtcr %r29 /* put the condition register back */ mfsprg2 %r29 /* ... and r29 */ @@ -900,19 +899,7 @@ CNAME(dblow): li %r1, 0 /* How to get the vector from LR */ bla generictrap /* and we look like a generic trap */ -2: -#ifdef KDTRACE_HOOKS - /* Privileged, so drop to KDB */ - mfsrr0 %r1 - mtsprg3 %r3 - lwz %r1,0(%r1) - /* Check if it's a DTrace trap. */ - li %r3,0x0808 - addis %r3,%r3,0x7c81 - cmplw %cr0,%r3,%r1 - mfsprg3 %r3 - beq %cr0,1b -#endif +1: /* Privileged, so drop to KDB */ GET_CPUINFO(%r1) stw %r28,(PC_DBSAVE+CPUSAVE_R28)(%r1) /* free r28 */ diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S index bedf1f1..0dc46b3 100644 --- a/sys/powerpc/aim/trap_subr64.S +++ b/sys/powerpc/aim/trap_subr64.S @@ -799,9 +799,8 @@ CNAME(dblow): mfcr %r29 /* save CR in r29 */ mfsrr1 %r1 mtcr %r1 - bf 17,2f /* branch if privileged */ + bf 17,1f /* branch if privileged */ -1: /* Unprivileged case */ mtcr %r29 /* put the condition register back */ mfsprg2 %r29 /* ... and r29 */ @@ -810,19 +809,7 @@ CNAME(dblow): li %r1, 0 /* How to get the vector from LR */ bla generictrap /* and we look like a generic trap */ -2: -#ifdef KDTRACE_HOOKS - /* Privileged, so drop to KDB */ - mfsrr0 %r1 - mtsprg3 %r3 - lwz %r1,0(%r1) - /* Check if it's a DTrace trap. */ - li %r3,0x0808 - addis %r3,%r3,0x7c81 - cmplw %cr0,%r3,%r1 - mfsprg3 %r3 - beq %cr0,1b -#endif +1: GET_CPUINFO(%r1) std %r27,(PC_DBSAVE+CPUSAVE_R27)(%r1) /* free r27 */ std %r28,(PC_DBSAVE+CPUSAVE_R28)(%r1) /* free r28 */ |