Subject: Re: pmap_enter() bashed
To: None <eeh@netbsd.org>
From: Charles M. Hannum <root@ihack.net>
List: tech-kern
Date: 03/27/1999 00:34:46
It's really quite simple to implement.  It was complicated on the ARM
only because the ARM pmap had numerous bugs (and, due to those bugs,
was not really doing R emulation before).

For an example, see the patch Jason committed to the Alpha pmap.c
(plus the few lines after the code added).  What it does is:

* If access_type has bits set, set the corresponding R/M bits in the
  software page attributes.

* If the R/M bits are set, don't turn on the corresponding `fault on
  {read,write,exec}' bits in the PTE.

Obviously the latter is going to vary a little depending on the
hardware.  E.g., on the ARM we set the map type in the level 2 page
table to an `invalid' to cause a fault on read, and turn off the
`writable' bit to cause a fault on write, since we don't have the
convenient `fault on *' bits that the Alpha does.  On other platforms
you probably have `valid' and `writable' bits in PTE which will do the
same thing.