Subject: sun3 problem found (pmap_enter() bashed)
To: Charles M. Hannum <root@ihack.net>
From: Gordon W. Ross <gwr@mediaone.net>
List: tech-kern
Date: 04/07/1999 00:57:41
Charles M. Hannum writes:
>
> So I just checked in a large batch of changes to modify the
> pmap_enter() API as previously noted.
>
> This has not been tested on other platforms than arm32. However,
> since all other platforms currently ignore the `access_type' argument,
> it should not cause any problems (other than potential compilation
> errors).
Well... I guess you warned me... but this one cost me several days...
Note the uninitialized variable "pa" that is passed to pmap_enter.
(Gee... Let's enter some RANDOM mappings! What fun!:)
Watch out for those temptations to "tweak while there"...
Lesson: when in pre-release, do the minimum and get out!
(Listening Charles?)
diff -rc date0326/sys/arch/sun3/sun3/vm_machdep.c ...
*** ../date0326/sys/arch/sun3/sun3/vm_machdep.c Wed Mar 24 00:51:15 1999
--- sys/arch/sun3/sun3/vm_machdep.c Tue Apr 6 23:44:52 1999
***************
*** 311,323 ****
kpmap = vm_map_pmap(kernel_map);
while (len > 0) {
! pa = pmap_extract(kpmap, fva);
! if (pa != 0) {
! /* this does the cache flush work itself */
! pmap_remove(kpmap, fva, fva + NBPG);
! pmap_enter(kpmap, tva, pa,
! VM_PROT_READ|VM_PROT_WRITE, 1);
! }
fva += NBPG;
tva += NBPG;
len -= NBPG;
--- 311,320 ----
kpmap = vm_map_pmap(kernel_map);
while (len > 0) {
! /* this does the cache flush work itself */
! pmap_remove(kpmap, fva, fva + NBPG);
! pmap_enter(kpmap, tva, pa,
! VM_PROT_READ|VM_PROT_WRITE, 1, VM_PROT_READ|VM_PROT_WRITE);
fva += NBPG;
tva += NBPG;
len -= NBPG;