Home | History | Annotate | Download | only in ibm4xx
History log of /src/sys/arch/powerpc/ibm4xx/copyinstr.c
RevisionDateAuthorComments
 1.24  05-Oct-2022  rin Minor style fixes to asm codes. No binary changes.
 1.23  05-Oct-2022  rin copy{in,out}str: As a tiny optimization, drop redundant mtpid.

No regression for ATF on 405. 403 seems to work fine.
 1.22  04-Oct-2022  rin copy{in,out}str: Consistently use tmp as scratch register. NFC.
 1.21  04-Oct-2022  rin copy{in,out}str: "insn[TAB]operands;" for inline asm codes.
 1.20  04-Oct-2022  rin copy{in,out}str: Style sync with copy{in,out}. No binary changes.
 1.19  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.18  03-Oct-2022  rin copy{in,out}str: Add cr0 and ctr to list of clobbered registers.
 1.17  03-Oct-2022  rin copy{in,out}str: Consistently use uaddr instead of udaddr.
Note that we use kaddr, not kdaddr, for kernel data address.
 1.16  03-Oct-2022  rin copy{in,out}str: Tidy up inline asm's:
- Use %[foo], %[bar], ... instead of %0, %1, ...
- One instruction per line.
- Paragraph grouped instructions.
- Fix wrong comments.
No binary changes.
 1.15  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.14  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.13  05-Mar-2020  rin Cosmetic changes. No binary changes.
 1.12  05-Mar-2020  rin Use dcbst instead of dcbf to flush cache; the former does not invalidate
the cache line, which should be used immediately in most cases.
 1.11  05-Mar-2020  rin copy{in,out}str: Correctly return ENAMETOOLONG if source is not
NUL-terminated.
 1.10  05-Mar-2020  rin copy{in,out}str: sync style with booke.

- early return in case of len == 0
- *done = 0 on fault
 1.9  20-Mar-2010  chs branches: 1.9.60; 1.9.64;
fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.8  24-Dec-2005  perry branches: 1.8.78; 1.8.98; 1.8.100;
bare asm -> __asm
 1.7  11-Dec-2005  christos merge ktrace-lwp.
 1.6  02-Sep-2004  scw branches: 1.6.12;
Apply suggested changes from PR port-powerpc/24830 arch/powerpc/ibm4xx:
Bad register constraints in copyin(), copyout(), copyinstr(), copyoutstr(),
and delay().
 1.5  20-Oct-2003  simonb Remove some numeric asm labels that aren't used.
 1.4  15-Jul-2003  lukem __KERNEL_RCSID()
 1.3  02-Feb-2003  matt branches: 1.3.2;
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.2  11-Jul-2002  simonb Clean up some white space niggles.
 1.1  13-Jun-2001  simonb branches: 1.1.2; 1.1.8; 1.1.16;
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.16.1  16-Jul-2002  gehenna catch up with -current.
 1.1.8.5  01-Aug-2002  nathanw Catch up to -current.
 1.1.8.4  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.1.8.3  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.1.8.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.1.8.1  13-Jun-2001  briggs file copyinstr.c was added on branch nathanw_sa on 2001-11-05 19:46:15 +0000
 1.1.2.1  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.3.2.2  03-Sep-2004  skrll Sync with HEAD
 1.3.2.1  03-Aug-2004  skrll Sync with HEAD
 1.6.12.1  21-Jun-2006  yamt sync with head.
 1.8.100.1  30-May-2010  rmind sync with head
 1.8.98.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.8.78.1  11-Aug-2010  yamt sync with head.
 1.9.64.1  09-Mar-2020  martin Pull up following revision(s) (requested by rin in ticket #772):

sys/arch/powerpc/ibm4xx/copyinstr.c: revision 1.12
sys/arch/powerpc/ibm4xx/copyinstr.c: revision 1.13
sys/arch/powerpc/ibm4xx/copyoutstr.c: revision 1.10
sys/arch/powerpc/ibm4xx/copyoutstr.c: revision 1.11
sys/arch/powerpc/ibm4xx/copyoutstr.c: revision 1.12
sys/arch/powerpc/ibm4xx/copyoutstr.c: revision 1.13
sys/arch/powerpc/ibm4xx/copyinstr.c: revision 1.10
sys/arch/powerpc/ibm4xx/copyinstr.c: revision 1.11

copy{in,out}str: sync style with booke.
- early return in case of len == 0
- *done = 0 on fault

copy{in,out}str: Correctly return ENAMETOOLONG if source is not
NUL-terminated.

Use dcbst instead of dcbf to flush cache; the former does not invalidate
the cache line, which should be used immediately in most cases.

Cosmetic changes. No binary changes.
 1.9.60.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed