Home | History | Annotate | Download | only in ibm4xx
History log of /src/sys/arch/powerpc/ibm4xx/trap.c
RevisionDateAuthorComments
 1.102  05-Oct-2023  ad Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
 1.101  05-Oct-2022  rin Minor style fixes to asm codes. No binary changes.
 1.100  04-Oct-2022  rin copy{in,out}{,str}: Drop needless dcbst.

Data cache is purely physical for 40[53] with 16KB pages, and therefore
no need to flush cache before context switch.

This significantly improves copy{in,out} against small data; for example,
bytebench on DHT becomes:

-Pipe Throughput 12440.0 8826.1 7.1
+Pipe Throughput 12440.0 18364.8 14.8

No performance/ATF regression observed on 405. 403 boots successfully
into multiuser mode, and builds some packages.
 1.99  12-Sep-2022  rin Work around clang 13.0.0 bug; copy{in,out}() are miscompiled with -O[12],
by which /sbin/init cannot be executed.
 1.98  12-Sep-2022  rin Make ibm4xx kernels compiled by clang.

As clang cannot correctly assemble m[ft]pid:
- for asm sources, use m[ft]spr from/to SPR_PID
- for C sources, use M[FT]PID macros (see include/ibm4xx/spr.h)
This is ugly...

No binary changes for GCC-compiled kernels.
 1.97  12-Sep-2022  rin copy{in,out}(): Minor clean up:
- No need to supply count (== 0).
- %r0 can be used as %[ctx] and %[len].
 1.96  12-Sep-2022  rin copyin(): Remove one more needless mtpid. No regression for full ATF.
 1.95  11-Sep-2022  rin copyin(): Fix comment. No binary changes.
 1.94  11-Sep-2022  rin copy{in,out}(): Tiny optimizations for __asm codes.
No regressions for full ATF run.

- Use {l,st}swx instead of loop for remaining bytes.
- Drop needless "mtpid %[x]; isync;".
 1.93  11-Sep-2022  rin copy{in,out}(): Add missing clobber registers to __asm codes.
 1.92  11-Sep-2022  rin copy{in,out}(): Add missing ``if (count == 0) goto done;''.
 1.91  11-Sep-2022  rin copy{in,out}(): Consistently use %[tmp] as scratch register. NFC.
 1.90  11-Sep-2022  rin copyin(): Fix copy-paste in comment. No binary changes.
 1.89  11-Sep-2022  rin copy{in,out}(): Cosmetic changes to __asm codes. No binary changes.

- Editor-friendly indentation.
- One insn per line.
- Group insns with logical blocks.
 1.88  11-Sep-2022  rin s/udaddr/uaddr/g for consistency; we use kaddr for kernel data address.
No binary changes.
 1.87  30-May-2022  rin For IBM_PPC403, emulate unaligned memory access for userland process.
 1.86  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.85  15-Jul-2020  rin branches: 1.85.2;
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.84  15-Jul-2020  rin Treat trap instruction from userland correctly in EXC_PGM handler;
raise SIGTRAP with TRAP_BRKPT instead of SIGILL.
 1.83  06-Jul-2020  rin - Drop unused opt_altivec.h.
- Include missing opt_ppcarch.h.
 1.82  06-Jul-2020  rin Style and cosmetic changes. No binary changes intended.
 1.81  19-Jun-2020  rin Try to sanitize usage of isync and sync instructions.

According to reference manuals of 4xx, isync is "context synchronization",
which satisfies both 1 and 2:

1. instructions preceding it complete in the context that existed before it
2. instructions following it complete in the context that exists after it

Whereas sync (== msync for 440) is "execution synchronization", which
satisfies just 1, not 2. At the same time, sync guarantees "storage
synchronization", by which any previous storage references completes
before any subsequent instructions begin to execute.

Tested on 405 over months.
 1.80  19-Jun-2020  rin Return correct signo and si_code to userland when page fault.
Taken from powerpc/trap.c. Found by tests in lib/libc/sys.
 1.79  19-Jun-2020  rin Return error code from uvm layer on fault, instead of hard-coded 1.
Found by some tests in tests/lib/libc/sys.
 1.78  21-Feb-2020  rin Do not try to recovery from data page fault in interrupt context;
catch up belatedly with powerpc/trap.c rev 1.49 and etc.:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/powerpc/trap.c#rev1.49
 1.77  21-Feb-2020  rin Tiny improvements to copyin() and copyout():

- Use lwz/stw instead of 4-byte lswi/stswi for 405 and later, which
support unaligned word load/store by hardware. In many cases, both
source and destination are aligned on word boundaries.

- Use dcbst instead of dcbf to flush cache. The former does not
invalidate the cache line. Copied data should be used soon after.
 1.76  21-Feb-2020  rin Cosmetic changes for assembler codes. No binary changes.
 1.75  21-Feb-2020  rin Comment out badaddr() and badaddr_read() on ibm4xx for now.

They are not used nor exposed externally in any header file; these
functions may have never been tested so far.

Enable them again when necessary.

Note that badaddr() for oea is used by macppc port, where it is
declared as an external function.
 1.74  20-Feb-2020  rin Oops, sort header again. My bad...
 1.73  20-Feb-2020  rin Convert mi_userret(9) into powerpc-specific userret().

This is necessary in order to support RAS.

There are some sanity checks in userret() as well.
 1.72  20-Feb-2020  rin Sort more headers...
 1.71  20-Feb-2020  rin Sort headers.
 1.70  07-Apr-2019  thorpej branches: 1.70.4; 1.70.6;
Detangle some of the PowerPC CPU configuration spaghetti.
 1.69  26-Dec-2016  rin branches: 1.69.16;
Remove wrong comment which was copy-and-pasted from somewhere.
 1.68  16-Dec-2016  rin Remove needless goto's. No functional changes.
 1.67  18-Oct-2014  snj branches: 1.67.2; 1.67.4;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.66  23-Aug-2013  matt Get rid of MDLWP_USED{FPU,VEC}
 1.65  23-Jul-2012  matt branches: 1.65.2; 1.65.4;
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.64  19-Feb-2012  rmind Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.63  13-Dec-2011  kiyohara Remove white-spaces.
 1.62  21-Jun-2011  matt branches: 1.62.2; 1.62.6;
Switch to use new common cpu_ast routine.
 1.61  18-Jun-2011  matt Use <sys/foo.h> instead of <machine/foo.h> if such a file exists.
Don't assume <sys/cpu.h> includes <powerpc/subarch/cpu*.h>. Include it
explicitly.
 1.60  14-Jun-2011  matt Make startlwp and upcallret common instead of having 3 mostly identical copies.
 1.59  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.58  18-Jan-2011  matt branches: 1.58.4;
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.57  20-Dec-2010  matt branches: 1.57.2;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.56  23-Apr-2010  rmind Remove lwp_uc_pool, replace it with kmem(9), plus add some consistency.
As discussed, a while ago, with ad@.
 1.55  20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.54  25-Feb-2010  matt branches: 1.54.2;
Adapt to spr.h breakup.
 1.53  21-Nov-2009  rmind branches: 1.53.2;
Use lwp_getpcb() on mips, powerpc and sh3, clean from struct user usage.
 1.52  21-Oct-2009  rmind Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.51  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.50  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.49  15-Oct-2008  wrstuden branches: 1.49.2; 1.49.8; 1.49.16;
Merge wrstuden-revivesa into HEAD.
 1.48  02-Jan-2008  ad branches: 1.48.6; 1.48.10; 1.48.12; 1.48.16;
Merge vmlocking2 to head.
 1.47  28-Nov-2007  simonb branches: 1.47.2; 1.47.6;
Use lswi/syswi instead of lwz/stw when doing loads/stores since we don't
know the alignment of data being copied. 403 cores have alignment
restrictions on lwz/stw that 405 cores don't have. lswi/syswi benchmark
at the same speed as lwz/stw on a 405 Walnut.

Fixes problems reported by Juergen Hannken-Illjes on the Explora.
 1.46  22-Nov-2007  hpeyerl Optimize copyin/copyout to transfer as many words as possible before doing
residual bytes. This improves small transfers. As a result, we can avoid
doing bigcopyin/bigcopyout until len>1024 instead of len>256.

Reviewed by: simonb.

(everybody run, Herb's in the kernel again).
 1.45  05-Nov-2007  ad branches: 1.45.2;
Don't set l_usrpri / spc_curpriority here. mi_userret() does it.
 1.44  17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.43  09-Jul-2007  ad branches: 1.43.8; 1.43.10; 1.43.12; 1.43.14;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.42  22-May-2007  rjs Fix for yamt-idlelwp merge.
 1.41  17-May-2007  yamt merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.40  04-Mar-2007  christos branches: 1.40.2; 1.40.4; 1.40.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.39  15-Feb-2007  ad branches: 1.39.2;
Make these compile again.
 1.38  09-Feb-2007  ad Merge newlock2 to head.
 1.37  05-Oct-2006  chs add support for O_DIRECT (I/O directly to application memory,
bypassing any kernel caching for file data).
 1.36  23-Jul-2006  ad branches: 1.36.4; 1.36.6;
Use the LWP cached credentials where sane.
 1.35  19-Jul-2006  ad - Hold a reference to the process credentials in each struct lwp.
- Update the reference on syscall and user trap if p_cred has changed.
- Collect accounting flags in the LWP, and collate on LWP exit.
 1.34  15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.33  14-May-2006  elad integrate kauth.
 1.32  15-Mar-2006  drochner branches: 1.32.2;
adapt to uvm_fault() interface cleanup: kill the useless 3rd argument
 1.31  07-Mar-2006  thorpej branches: 1.31.2;
Syscall debug tracing is handled by trace_enter() / trace_exit(). Change
trace_is_enabled() to return TRUE if SYSCALL_DEBUG is defined, and g/c
all of the SYSCALL_DEBUG handling from individual system call dispatch
routines.
 1.30  07-Mar-2006  thorpej Clean up fallout proc_is_traced_p() change:
- proc_is_traced_p() -> trace_is_enabled(), to match trace_enter() and
trace_exit().
- trace_is_enabled() becomes a real function.
- Remove unnecessary include files from various files that used to care
about KTRACE and SYSTRACE, but do no more.
 1.29  24-Dec-2005  perry branches: 1.29.4; 1.29.6; 1.29.8;
bare asm -> __asm
 1.28  24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.27  11-Dec-2005  christos merge ktrace-lwp.
 1.26  03-Jun-2005  scw branches: 1.26.2;
Appease the -Wshadow and -Wcast-qual gods.
 1.25  25-Feb-2005  simonb KNF: put "if (...)" and following statement on separate lines.
 1.24  19-Jan-2005  simonb branches: 1.24.2;
White space nit.
 1.23  02-Sep-2004  scw branches: 1.23.4;
Apply suggested changes from PR port-powerpc/24830 arch/powerpc/ibm4xx:
Bad register constraints in copyin(), copyout(), copyinstr(), copyoutstr(),
and delay().
 1.22  14-Mar-2004  cl add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
* VP id
* lock on VP data
* LWP on VP
* recently blocked LWP on VP
* queue of LWPs woken which ran on this VP before sleep
* faultaddr
* LWP cache for upcalls
* upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP
 1.21  24-Feb-2004  drochner deliver SIGSEGV/SEGV_ACCERR if code execution on stack is attempted,
tested by Juergen Hannken-Illjes
(there are more uninitialized ksi.ksi_code arguments)
 1.20  31-Oct-2003  cl Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
 1.19  08-Oct-2003  thorpej * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
result of a trap. Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap. Expands to 0 if the ksiginfo_t was
not the result of a trap. This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern. Reviewed and OK's by Christos.
 1.18  26-Sep-2003  eeh Define ksi.
 1.17  25-Sep-2003  matt Add siginfo support for PowerPC.
 1.16  19-Sep-2003  cl add MD part of SA/pthread pagefault handling on powerpc
 1.15  24-Aug-2003  chs add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.
 1.14  15-Jul-2003  lukem __KERNEL_RCSID()
 1.13  28-Jun-2003  simonb branches: 1.13.2;
Sprinkle some KNF.
 1.12  07-Feb-2003  thorpej Fix some printf formats.
 1.11  02-Feb-2003  matt Perform a rototill of the powerpc code. Mandate use of SPRG0 to store
a pointer to current cpu's cpu_info structure. Use cpu_info for
intstk,intr_depth,still_stk,idle_pcb,curpcb,curlwp,etal even on
non-MULTIPROCESSOR machines. Add common macros GET_CPUINFO and
INIT_CPUINFO to get and initialize the cpu_info struct on startup. Make
ibm4xx use the standard <powerpc/frame.h>. Use IFRAME_xx in ibm4xx
trap_subr.S instead of explicit magic offsets. Move INTSTK and SPILLSTK
to std.<platform>. Change faultbuf to a struct instead of an array.

On MPC6XX cpus, stop using the vector page for temporary space and use
reserved space in cpu_info.
 1.10  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.9  25-Nov-2002  thorpej branches: 1.9.2;
Statements after labels.
 1.8  02-Aug-2002  chs use a completely separate trap handler for syscall traps.
this reduces syscall overhead by 10% to 20% depending on cpu type.
 1.7  11-Jul-2002  simonb Clean up some white space niggles.
 1.6  05-Jul-2002  matt Peform a rototill over the powerpc-based ports.

Move the trap/vector initialization for MPC6xx ports to mpc6xx_machdep.c
Also move softnet, install_extintr, mapiodev, kvtop. Add common BAT
initialization code.

Add user Altivec support.

Fix calls to OF_call_method in macppc/macppc/machdep.c.

Use ci_fpuproc in cpu_info instead of separate fpuproc.

Add separate syscall.c and defined __HAVE_SYSCALL_INTERN.
 1.5  17-Jun-2002  christos apply the fix from the powerpc port. this is almost a copy of powerpc/trap.c
and needs to be refactored.
 1.4  17-Jun-2002  christos MD systrace gluons.
 1.3  14-Feb-2002  chs branches: 1.3.8;
allow writing to write-only mappings. fixes PR 3493.
 1.2  22-Jul-2001  wiz branches: 1.2.6;
bcopy -> memcpy, bzero -> memset, bcmp -> memcmp.
Reviewed by Matt Thomas, ok'd by Tsubai Masanari.
 1.1  13-Jun-2001  simonb branches: 1.1.2;
Add a port to IBM's PPC405GP Reference Board (the "walnut")
by Eduardo Horvath and Simon Burge of Wasabi Systems.

IBM 4xx series CPU features:
- New pmap and revised trap handler.
- Support on-chip timers, PCI controller, UARTs
- Framework for on-chip ethernet and watchdog timer.
General PowerPC features:
- Add in-kernel PPC floating point emulation
- New in{,4}_cksum that is between 1.5 and 5 times faster than the
old version depending on CPU type.
General changes:
- Kernel support for generic dbsym-style symbols.
 1.1.2.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2  16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.1  03-Aug-2001  lukem update to -current
 1.2.6.15  07-Jan-2003  thorpej In the SA universe, the switch-to-this-LWP decision is made at a
different level than where preempt() calls are made, which renders
the "newlwp" argument useless. Replace it with a "more work to do"
boolean argument. Returning to userspace preempt() calls pass 0.
"Voluntary" preemptions in e.g. uiomove() pass 1. This will be used
to indicate to the SA subsystem that the LWP is not yet finished in
the kernel.

Collapse the SA vs. non-SA cases of preempt() together, making the
conditional code block much smaller, and don't call sa_preempt() if
more work is to come.

NOTE: THIS IS NOT A COMPLETE FIX TO THE preempt()-in-uiomove() PROBLEM
THAT CURRENTLY EXISTS FOR SA PROCESSES.
 1.2.6.14  11-Dec-2002  thorpej Sync with HEAD.
 1.2.6.13  06-Oct-2002  gmcgarry upcallret() takes struct *lwp.
 1.2.6.12  26-Sep-2002  nathanw Change "if (l->l_flag & L_SA_UPCALL)" to "while (l->l_flag & L_SA_UPCALL)"
in userret() functions or equivalent, to permit delivery of multiple upcalls
in a single kernel entry.

XXX It's getting crowded in here. Collapsing posting signals, upcalls, and
XXX kernel-exit handling into one mechanism would be nice.
 1.2.6.11  29-Aug-2002  nathanw Replace the old-fashioned P_WEXIT checking with p_userret hook handling.
 1.2.6.10  06-Aug-2002  nathanw Catch up with powerpc rototilling.
 1.2.6.9  01-Aug-2002  nathanw Catch up to -current.
 1.2.6.8  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.2.6.7  03-Jul-2002  nathanw Do p->p_userret handling rather than the old P_WEXIT check in trap().
 1.2.6.6  24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.2.6.5  20-Jun-2002  nathanw Catch up to -current.
 1.2.6.4  28-Feb-2002  nathanw Catch up to -current.
 1.2.6.3  17-Dec-2001  nathanw cpu_upcall() -> sa_upcall_userret().
 1.2.6.2  05-Nov-2001  briggs Initial SA support for ppc. Test-booted on sandpoint, macppc, & walnut.
mcontext and cpu_getmcontext()/cpu_setmcontext() from Klaus Klein
<kleink@netbsd.org>.
 1.2.6.1  22-Jul-2001  briggs file trap.c was added on branch nathanw_sa on 2001-11-05 19:46:16 +0000
 1.3.8.3  31-Aug-2002  gehenna catch up with -current.
 1.3.8.2  16-Jul-2002  gehenna catch up with -current.
 1.3.8.1  15-Jul-2002  gehenna catch up with -current.
 1.9.2.1  18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.13.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.13.2.5  24-Jan-2005  skrll Sync with HEAD.
 1.13.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.13.2.2  03-Sep-2004  skrll Sync with HEAD
 1.13.2.1  03-Aug-2004  skrll Sync with HEAD
 1.23.4.1  29-Apr-2005  kent sync with -current
 1.24.2.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.26.2.8  21-Jan-2008  yamt sync with head
 1.26.2.7  07-Dec-2007  yamt sync with head
 1.26.2.6  15-Nov-2007  yamt sync with head.
 1.26.2.5  27-Oct-2007  yamt sync with head.
 1.26.2.4  03-Sep-2007  yamt sync with head.
 1.26.2.3  26-Feb-2007  yamt sync with head.
 1.26.2.2  30-Dec-2006  yamt sync with head.
 1.26.2.1  21-Jun-2006  yamt sync with head.
 1.29.8.4  11-Aug-2006  yamt sync with head
 1.29.8.3  24-May-2006  yamt sync with head.
 1.29.8.2  01-Apr-2006  yamt sync with head.
 1.29.8.1  13-Mar-2006  yamt sync with head.
 1.29.6.2  01-Jun-2006  kardel Sync with head.
 1.29.6.1  22-Apr-2006  simonb Sync with head.
 1.29.4.1  09-Sep-2006  rpaulo sync with head
 1.31.2.3  19-Apr-2006  elad sync with head - hopefully this will work
 1.31.2.2  08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.31.2.1  07-Mar-2006  elad file trap.c was added on branch elad-kernelauth on 2006-03-08 00:43:13 +0000
 1.32.2.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.36.6.1  22-Oct-2006  yamt sync with head
 1.36.4.2  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.36.4.1  18-Nov-2006  ad Sync with head.
 1.39.2.2  03-Apr-2007  matt Adapt powerpc to yamt-idlelwp. Nuke cpu_setfunc.
Don't define _HAVE_BITENDIAN_BITOPS. Misc cleanups.
 1.39.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.40.10.5  03-Oct-2007  garbled Sync with HEAD
 1.40.10.4  02-Aug-2007  macallan sync with HEAD
 1.40.10.3  26-Jun-2007  garbled Sync with HEAD.
 1.40.10.2  28-May-2007  freza Add KGDB support to evbppc/virtex port. From Jean-Francois Boudreault,
cosmetics by me.

While there, generalize virtex_console_tag() to virtex_bus_space_tag()
and fix one instance of yamt-idlelwp fallout (ci_need_resched renamed
to ci_want_resched).

XXX Only compile tested since my access to suitable Virtex HW is sporadic
XXX at best.
 1.40.10.1  22-May-2007  matt Update to HEAD.
 1.40.4.1  11-Jul-2007  mjf Sync with head.
 1.40.2.3  03-Dec-2007  ad Sync with HEAD.
 1.40.2.2  23-Oct-2007  ad Sync with head.
 1.40.2.1  15-Jul-2007  ad Sync with head.
 1.43.14.3  22-Nov-2007  bouyer Sync with HEAD
 1.43.14.2  13-Nov-2007  bouyer Sync with HEAD
 1.43.14.1  25-Oct-2007  bouyer Sync with HEAD.
 1.43.12.1  18-Oct-2007  yamt sync with head.
 1.43.10.2  09-Jan-2008  matt sync with HEAD
 1.43.10.1  06-Nov-2007  matt sync with HEAD
 1.43.8.4  03-Dec-2007  joerg Sync with HEAD.
 1.43.8.3  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.43.8.2  06-Nov-2007  joerg Sync with HEAD.
 1.43.8.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.45.2.2  18-Feb-2008  mjf Sync with HEAD.
 1.45.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.47.6.1  02-Jan-2008  bouyer Sync with HEAD
 1.47.2.1  27-Dec-2007  ad locking changes for macppc. Please test.
 1.48.16.1  19-Oct-2008  haad Sync with HEAD.
 1.48.12.3  30-Jun-2008  wrstuden Change how we make SA threads not generate upcalls. Instead of clearing
LW_SA, use a private flag, LP_SA_NOBLOCK, that we set when we want
to not generate upcalls. This means we do NOT need to lock (l)
(ourselves) to set it.

Adjust tests that look at LW_SA. Now, we are an upcall-generating
lwp if ((l->l_flag & LW_SA) && (~l->l_pflag & LP_SA_NOBLOCK)).

Introduce code pattern to set & remember this:

f = ~l->l_pflag & LP_SA_NOBLOCK;
l->l_pflag |= LP_SA_NOBLOCK;

...

/* f is now LP_SA_NOBLOCK if it wasn't set in l_pflag before */

l->l_pflag ^= f;

I updated a lot of the trap handlers to do trap handling iff LP_SA_NOBLOCK
is not set. I tried to figure out if the trap handler could be triggered
for user-based faults as opposed to kernel faults to user addresses, and
only look at LP_SA_NOBLOCK for the latter.

Above is a result of discussions with rmind at to reduce lock twiddling.

Also, per same discussions, add locking to sys_sa_preempt(). p_lock is
the lock we want.

Also, per same discussions, remove use of LSSUSPENDED as a thread state.
We needed to use it when we were emulating the 4.X and previous behavior
of hiding cached threads. For the moment, we now have them instead
remain visible to all and have them sleeping on the "lwpcache" wait
channel.

sa_newcachelwp(): sa_putcachelwp() wants savp_mutex held, not p_lock.

Tweak some comments.
 1.48.12.2  22-Jun-2008  wrstuden Re-add cpu_upcall() and page fault code. i386 kernels now compile.
They don't boot, but that seems to be a consequence of current from the
day this branch was started.
 1.48.12.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.48.10.3  11-Aug-2010  yamt sync with head.
 1.48.10.2  11-Mar-2010  yamt sync with head
 1.48.10.1  04-May-2009  yamt sync with head.
 1.48.6.1  17-Jan-2009  mjf Sync with HEAD.
 1.49.16.2  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.49.16.1  07-Jan-2011  matt Deal with new powerpc world.
 1.49.8.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.49.2.1  28-Apr-2009  skrll Sync with HEAD.
 1.53.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.54.2.3  12-Jun-2011  rmind sync with head
 1.54.2.2  05-Mar-2011  rmind sync with head
 1.54.2.1  30-May-2010  rmind sync with head
 1.57.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.58.4.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.62.6.2  24-Feb-2012  mrg sync to -current.
 1.62.6.1  18-Feb-2012  mrg merge to -current.
 1.62.2.3  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.62.2.2  30-Oct-2012  yamt sync with head
 1.62.2.1  17-Apr-2012  yamt sync with head
 1.65.4.1  28-Aug-2013  rmind sync with head
 1.65.2.2  03-Dec-2017  jdolecek update from HEAD
 1.65.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.67.4.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.67.2.1  05-Feb-2017  skrll Sync with HEAD
 1.69.16.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.69.16.1  10-Jun-2019  christos Sync with HEAD
 1.70.6.1  29-Feb-2020  ad Sync with head.
 1.70.4.1  27-Feb-2020  martin Pull up following revision(s) (requested by rin in ticket #735):

sys/arch/powerpc/ibm4xx/trap.c: revision 1.71
sys/arch/powerpc/ibm4xx/trap.c: revision 1.72
sys/arch/powerpc/ibm4xx/trap.c: revision 1.73
sys/arch/powerpc/ibm4xx/trap.c: revision 1.74
sys/arch/powerpc/ibm4xx/trap.c: revision 1.75
sys/arch/powerpc/ibm4xx/trap.c: revision 1.76
sys/arch/powerpc/ibm4xx/trap.c: revision 1.77
sys/arch/powerpc/ibm4xx/trap.c: revision 1.78

Sort headers.
-
Sort more headers...
-
Convert mi_userret(9) into powerpc-specific userret().

This is necessary in order to support RAS.

There are some sanity checks in userret() as well.
-
Oops, sort header again. My bad...
-
Comment out badaddr() and badaddr_read() on ibm4xx for now.

They are not used nor exposed externally in any header file; these
functions may have never been tested so far.

Enable them again when necessary.

Note that badaddr() for oea is used by macppc port, where it is
declared as an external function.
-
Cosmetic changes for assembler codes. No binary changes.
-
Tiny improvements to copyin() and copyout():
- Use lwz/stw instead of 4-byte lswi/stswi for 405 and later, which
support unaligned word load/store by hardware. In many cases, both
source and destination are aligned on word boundaries.
- Use dcbst instead of dcbf to flush cache. The former does not
invalidate the cache line. Copied data should be used soon after.
-
Do not try to recovery from data page fault in interrupt context;
catch up belatedly with powerpc/trap.c rev 1.49 and etc.:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/powerpc/trap.c#rev1.49
 1.85.2.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed