Next: Making the Model More
Up: An Abstract Model of
Previous: Shared Virtual Memory
The page tables are also used by the CPU and the Operating System to control
access to memory.
Here the access control information in the page tables is used to check, again
on each virtual memory access, that the action is allowable.
Traditionally the code in an image is separated out from the data and made read only.
In this way the code is protected from corruption by not allowing anything to write
to it.
Process specific data structures, for example those holding the environment variables,
are also protected in this way.
A process that attempted to access a page in a way that was not allowed would be
terminated with an access violation.
The access control information is held in the PTE and
is CPU specific; figure shows the PTE for Alpha AXPThe bit fields have the following meanings:
- V
- Valid, if set this PTE is valid,
- FOE
- ``Fault on Execute'', Whenever an access of this type occurs, the
CPU reports a page fault and passes control to the operating system,
- FOW
- ``Fault on Write'',
- FOR
- ``Fault on Read'',
- ASM
- Address Space Match. This is used when the operating system
wishes to clear only some of the entries from the Translation
Buffer,
- KRE
- Code running in kernel mode can read this page,
- URE
- Code running in user mode can read this page,
- GH
- Granularity hint used when mapping an entire block with
a single Translation Buffer entry rather than many,
- KWE
- Code running in kernel mode can write to this page,
- UWE
- Code running in kernel mode can read this page,
- PFN
- For PTEs with the V bit set, this field contains
the physical Page Frame Number (PFN) for this PTE. For invalid
PTEs, if this field is not zero, it contains information about
where the page is in the swap file.
The following two bits are defined and used by Linux:
- __PAGE__DIRTY
- if set, the page needs to
be written out to the swap file,
- __PAGE__ACCESSED
- Used by Linux to mark a page as having been
accessed.
Next: Making the Model More
Up: An Abstract Model of
Previous: Shared Virtual Memory
David A. Rusling
david.rusling@reo.mts.dec.com