Subject: PR/36548 CVS commit: src/sys/arch/arm
To: None <,,,>
From: Steve Woodford <>
List: netbsd-bugs
Date: 09/15/2007 09:25:02
The following reply was made to PR kern/36548; it has been noted by GNATS.

From: Steve Woodford <>
Subject: PR/36548 CVS commit: src/sys/arch/arm
Date: Sat, 15 Sep 2007 09:25:23 +0000 (UTC)

 Module Name:	src
 Committed By:	scw
 Date:		Sat Sep 15 09:25:23 UTC 2007
 Modified Files:
 	src/sys/arch/arm/arm: cpufunc_asm_arm10.S cpufunc_asm_arm11.S
 	    cpufunc_asm_arm67.S cpufunc_asm_arm7tdmi.S cpufunc_asm_arm8.S
 	    cpufunc_asm_arm9.S cpufunc_asm_sa1.S cpufunc_asm_xscale.S
 	src/sys/arch/arm/arm32: arm32_machdep.c cpuswitch.S pmap.c
 	src/sys/arch/arm/include: cpufunc.h pcb.h
 	src/sys/arch/arm/include/arm32: pmap.h
 Log Message:
 ARM cpu_switchto() has been partially broken since yamt-idlelwp was merged
 as its cache/tlb management smarts relied too heavily on pre-merge context-
 switch behaviour. See PR kern/36548 for one manifestation of the breakage.
 To address this:
  - Ditch the shadow pmap variables in the PCB (pagedir, l1vec, dacr, cstate)
    as it was too easy for them to get out of sync with the pmap.
  - Re-write (and fix) the convoluted cpuswitch.S cache/tlb ASM code in C.
    It's only slightly less efficient, but is much more readable/maintainable.
  - Document cpufuncs.cf_context_switch() as being C-callable.
  - pmap_activate() becomes a no-op if the lwp's vmspace is already active.
    (Good performance win, since pmap_activate() is now invoked on every
    context-switch, even though ARM's cpu_switchto() already does all the
    grunt work)
 XXX: Some CPU-specific armXX_context_switch() implementations (arm67,
 arm7tdmi, arm8) always flush the I+D caches. This should not be necessary.
 Someone with access to hardware (acorn32?) needs to deal with this.
 To generate a diff of this commit:
 cvs rdiff -r1.6 -r1.7 src/sys/arch/arm/arm/cpufunc_asm_arm10.S
 cvs rdiff -r1.2 -r1.3 src/sys/arch/arm/arm/cpufunc_asm_arm11.S \
 cvs rdiff -r1.1 -r1.2 src/sys/arch/arm/arm/cpufunc_asm_arm67.S \
 cvs rdiff -r1.4 -r1.5 src/sys/arch/arm/arm/cpufunc_asm_arm9.S
 cvs rdiff -r1.8 -r1.9 src/sys/arch/arm/arm/cpufunc_asm_sa1.S
 cvs rdiff -r1.16 -r1.17 src/sys/arch/arm/arm/cpufunc_asm_xscale.S
 cvs rdiff -r1.49 -r1.50 src/sys/arch/arm/arm32/arm32_machdep.c
 cvs rdiff -r1.48 -r1.49 src/sys/arch/arm/arm32/cpuswitch.S
 cvs rdiff -r1.33 -r1.34 src/sys/arch/arm/arm32/
 cvs rdiff -r1.164 -r1.165 src/sys/arch/arm/arm32/pmap.c
 cvs rdiff -r1.38 -r1.39 src/sys/arch/arm/arm32/vm_machdep.c
 cvs rdiff -r1.40 -r1.41 src/sys/arch/arm/include/cpufunc.h
 cvs rdiff -r1.14 -r1.15 src/sys/arch/arm/include/pcb.h
 cvs rdiff -r1.81 -r1.82 src/sys/arch/arm/include/arm32/pmap.h
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.