Home | History | Annotate | Download | only in booke
History log of /src/sys/arch/powerpc/booke/trap.c
RevisionDateAuthorComments
 1.41  08-Sep-2024  andvar Use console_debbuger() or DDB guards for Debugger() and db_stack_trace_print().

Should allow to build these files without DDB enabled option.
 1.40  17-Apr-2023  skrll Trailing whitespace
 1.39  26-Oct-2022  skrll MI PMAP hardware page table walker support.

This is based on code given to me by Matt Thomas a long time ago with
many updates and bugs fixes from me.
 1.38  25-Sep-2022  skrll Rename pmap_segtab_t *stp to stb for consistency with a future
pmap_pdetab_t *ptb. pmap_pdetab_t *ptp would be far too confusing.

NFC. Same code before and after.
 1.37  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.36  06-Jan-2021  rin Sort headers. Also, use <ddb/ddb.h> instead of db_interface.h and
db_machdep.h in order not to be bothered by subtle include order.

No functional changes intended.
 1.35  10-Sep-2020  rin branches: 1.35.2;
Fix build with UVMHIST; stop passing string literal to UVMHIST_LOG(),
and also cast pointer arguments into uintptr_t.
 1.34  15-Jul-2020  rin For booke and ibm4xx, emulate m[ft]msr in user mode, in the same
manner as oea.

Now, user process can decide by itself whether floating-point
exception triggers SIGFPE or not via fenv(3).
 1.33  15-Jul-2020  rin Do not use curlwp twice. No functional changes.
 1.32  07-Jul-2020  rin For booke, fix signo and other siginfo returned for userland by
syncing with oea and ibm4xx.

Now, tests/kernel/t_trapsignal:bus_handle and friends pass on booke.
 1.31  07-Jul-2020  rin Do not clear pcb_onfault for error path of setfault().
This is caller's responsibility, and all the callers actually do so.
 1.30  07-Jul-2020  rin For booke, restore callee saved registers when recovery for page fault
fails for kernel.

OOPS! How on the earth we had overlooked this error so far...
 1.29  06-Jul-2020  rin Include missing opt_altivec.h for PPC_HAVE_SPE.
 1.28  06-Jul-2020  rin Style and cosmetic changes. No binary changes intended.
 1.27  27-Jan-2018  flxd Fix more printf format strings for mfspr() (hi mrg).
 1.26  31-Jul-2014  joerg Fix macro spelling.
 1.25  31-Jul-2014  matt Don't use numeric constants for SPR. Use the symbolic name (SPR_PIR).
Add DBSR_BRT to KASSERT
 1.24  30-Jul-2014  joerg Replace mfpir with mfspr r, 286. The Power ISA and GAS disagree on the
semantics of this instruction, so prefer the well defined replacement.
 1.23  23-Aug-2013  matt branches: 1.23.2;
Get rid of MDLWP_USED{FPU,VEC}
 1.22  02-Aug-2012  matt branches: 1.22.2; 1.22.4;
Also supprese printing fatal traps if the process is being debugged.
 1.21  02-Aug-2012  matt Only print fatal trap info if the resulting signal would be uncaught.
(this avoid the messages from libcrypto when it probes for capabilities).
 1.20  01-Aug-2012  matt Add a machine splhist command to give (a incomplete) spl history.
(only the most recent are going to be accurate).

splraise(6) from 0 at 549214603
splraise(7) from 6 at 549214643 (+40)
splx(6) from 7 at 549214691 (+48)
splx(0) from 6 at 549214730 (+39)
 1.19  01-Aug-2012  matt Export dump_trapframe.
 1.18  23-Jul-2012  matt Add support for PPC FP emulation to BookE.
Pass a ksiginfo_t to fpu_emulation so it can give more detailed
info on signals.
 1.17  09-Jul-2012  matt More cleanup. Use a union (pmap_segtab) and a typedef (pmap_segtab_t). Add
more functionality from the mips pmap and try to make it more common to ease
the transition for mips in the future.
 1.16  05-Jul-2012  matt s/seg_tab/seg_ptr/
 1.15  17-May-2012  matt Allow user addresses >= 0x80000000
 1.14  19-Feb-2012  rmind Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.13  27-Sep-2011  jym branches: 1.13.2; 1.13.6;
Modify *ASSERTMSG() so they are now used as variadic macros. The main goal
is to provide routines that do as KASSERT(9) says: append a message
to the panic format string when the assertion triggers, with optional
arguments.

Fix call sites to reflect the new definition.

Discussed on tech-kern@. See
http://mail-index.netbsd.org/tech-kern/2011/09/07/msg011427.html
 1.12  21-Jun-2011  matt Switch to use new common cpu_ast routine.
 1.11  20-Jun-2011  matt PowerPC now exports a common view of cpu.h, vmparam.h and pmap.h
when building a MODULAR kernel or compiling _MODULE.
It should be noted that MODULAR or _MODULE export a view of the kernel
as being MULTIPROCESSOR (even if isn't).
The shared pmap TLB uses mdpg in places where it used mdpg to avoid
deadly embrance inclusion problems.
 1.10  14-Jun-2011  matt Make startlwp and upcallret common instead of having 3 mostly identical copies.
 1.9  13-Jun-2011  matt If uvm_fault returns EACCES, convert it to EFAULT.
 1.8  12-Jun-2011  matt For debugging, use UVMHIST to create kernel histories pmaphist and
pmapexechist. This replaces the old pmapdebug/PDB stuff.
In ddb, you can just use kernhist_dump(pmaphist) to view the history
or vmstat -H from userland.
 1.7  05-Jun-2011  matt Remove <machine/atomic.h>; use <sys/atomic.h> instead.
Add <powerpc/cpuset.h> (for mpc85xx pmap).
Add some initial MP code for mpc85xx
Rework ipi code to be common across all ppcs
Change PPC to keep curlwp in %r13 while in the kernel.
Move astpending from cpu_info to mdlwp
Improve cpu_need_resched to be more MP friendly.
 1.6  02-May-2011  matt branches: 1.6.2;
Move powerpc to use pcu to manage FPU/AltiVec/SPE.
 1.5  17-Feb-2011  matt branches: 1.5.2;
add begging of single step support. Since BookE doesn't support PSL_SE, if
userret find PSL_SE set in SRR1, it will call booke_sstep to setup the
debug registers.
 1.4  08-Feb-2011  matt If we get a PGM exception for a trap, use SIGTRAP/TRAP_BRKPT instead of
SIGILL/ILL_ILLTRP so GDB will recognize it.
 1.3  07-Feb-2011  matt Fix inverted test. cpu_setmcontext should return success. :)
 1.2  18-Jan-2011  matt branches: 1.2.2;
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.1  07-Jan-2011  matt branches: 1.1.2; 1.1.4;
file trap.c was initially added on branch matt-nb5-pq3.
 1.1.4.1  06-Jun-2011  jruoho Sync with HEAD.
 1.1.2.5  14-Oct-2011  matt Sync with current pulling P2020 and other newer processor support.
 1.1.2.4  26-Jul-2011  matt netbsd-5 uses pool_put, not kmem_free for ucontexts
 1.1.2.3  17-Jan-2011  matt Add SPE (signal processing engine) support for mpc85xx/booke. Think of it
as AltiVec-lite (really lite). Genercize AltiVec support so that it could
the same interface could support SPE as well. Rework the FPU support along
the same lines. Move the __asm() to their own XXX_subr.S (altivec, fpu, spe).
 1.1.2.2  07-Jan-2011  matt Add support for emulating mfpvr and lwsync. GCC will emit lwsync but booke
doesn't lwsync (sync 1) so we "emulate" it by treating it as a noop since
the exception will have synchronized things for us.
 1.1.2.1  07-Jan-2011  matt Add mpc85xx support for netbsd-5 (with some incompatible kernel changes).
 1.2.2.2  05-Mar-2011  bouyer Sync with HEAD
 1.2.2.1  08-Feb-2011  bouyer Sync with HEAD
 1.5.2.4  12-Jun-2011  rmind sync with head
 1.5.2.3  31-May-2011  rmind sync with head
 1.5.2.2  05-Mar-2011  rmind sync with head
 1.5.2.1  17-Feb-2011  rmind file trap.c was added on branch rmind-uvmplock on 2011-03-05 20:51:34 +0000
 1.6.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.6.2  02-Jun-2012  mrg sync to latest -current.
 1.13.6.1  24-Feb-2012  mrg sync to -current.
 1.13.2.4  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.2.3  30-Oct-2012  yamt sync with head
 1.13.2.2  23-May-2012  yamt sync with head.
 1.13.2.1  17-Apr-2012  yamt sync with head
 1.22.4.1  28-Aug-2013  rmind sync with head
 1.22.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.2.1  10-Aug-2014  tls Rebase.
 1.35.2.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed