Where is the page permission stored?
If one entry’s present
flag is off, OS can use this entry for other purpose. What can be other purpose? and How to use it properly?
Descriptors (types of different PT entries):
Cast from integer to the PT entries type: __pte, __pmd, __pud, __pgd, __pgprot
Entries of page directories and page tables have the same structure. Each entry includes the following fields:
Present
flag. If set, the page is in main memory; If the flag is 0, the page is not contained in main memory and the remaining entry bits may be used by the operating system for its own purposes.
cr2
, and exception 14 - Page Fault
will be generated.20-bit
(=32-12) field as page frame physical address.accessed
flag. set each time the paging unit addresses the page. OS can use this for swapping. Paging unit will not reset the flag. OS should reset it instead.dirty
read/write
user/supervisor
: contains the privilege level required to access the page or Page Table.PCD & PWT
flag. cache control.Page Size
flag. Only for Page Table entries. If set, the entry refers to a 2MB or 4MB long page frame.Global
flag. Only for Page Table entries. Prevent frequently used pages from being flushed from TLB cache. Works only if Page Global Enable flag of register cr4
is set.p
to a specified value v
p
and a group of access rights prot
, and builds the correponding Page Table entry.Reference 1
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?