41 | | || PPN2 || Physical Page Number || 28 bits : Concatened to the page offset to build the 40 bits address || |
| 42 | || V || Valid bit || Valid entry when 1 (set by the OS) || |
| 43 | || T || Type bit || PTD1 when 1 (set by the OS) || |
| 44 | || L || Local access bit || Used by the OS for page replacement (set by the hardware) || |
| 45 | || R || Remote access bit || Used by the OS for page replacement (set by the hardware) || |
| 46 | || C || Cachable bit || The page is cachable in the L1 cache when 1 (set by the OS) || |
| 47 | || W || Writable bit || The page is writable when 1 (set by the OS) || |
| 48 | || X || eXecutable bit || The page can contain instructions when 1 (set by the OS) || |
| 49 | || U || User bit || The page is accessible in user mode when 1 (set by the OS) || |
| 50 | || G || Global bit || Entry not invalidated in TLB flush when 1 (set by the OS) || |
| 51 | || D || Dirty bit || The page has been modified when 1 (set by the hardware) || |
| 52 | || PPN1 || Physical Page Number || Concatened to the page offset to build the physical address || |
| 53 | || PTBA || Page Table Base Address || Second level page table base address || |
| 54 | |
| 55 | The L, R, D bits are used by the operating system to implement the page replacement policy. |
| 56 | * The D bit is set by the hardware, when a page is written and when it is not already set, using an atomic access (LL/SC). |
| 57 | * The L bit is set by the hardware, when the page is accessed by a local processor or coprocessor, after a TLB miss, and when it is not already set. |
| 58 | * The R bit is set by the hardware, when the page is accessed by a remote processor or coprocessor, after a TLB miss, and when it is not already set. |
| 59 | These page table updates use atomic access (LL/SC). |
| 60 | |
| 61 | If the entry is a PTE1, the PPN1 value (19 bits) must be concatened with the page offset (21 bits) to build the 40 bits physical address. |
| 62 | |
| 63 | If the entry is a PTD1, the PTBA value (28 bits) must be left-shifted by 12 bits to define the base address of the level 2 page table. The page table being aligned in memory, the 12 LSB bits of this base address have a 0 value. |
| 64 | |
| 65 | === 1.3 Second Level Page Table Entry Format === |
| 66 | |
| 67 | Each entry in a second level page table contains a 4K bytes page descriptor (called PTE2). |
| 68 | It is implemented as two 32 bits words: the first word contains the flags; the second word contains the 28 bits physical page number (PPN2). |
| 69 | |
| 70 | * PTE2 first word : |
| 71 | ||V||T||L||R||C||W||X||U||G||D|| reserved (22 bits) || |
| 72 | |
| 73 | * PTE2 second word : |
| 74 | || reserved (4 bits) || PPN2 (28 bits) || |
| 75 | |
| 76 | The various fields are defined as follows : |
| 77 | |
| 90 | The L, R, D bits are used by the operating system to implement the page replacement policy. |
| 91 | * The D bit is set by the hardware, when a page is written and when it is not already set, using an atomic access (LL/SC). |
| 92 | * The L bit is set by the hardware, when the page is accessed by a local processor or coprocessor, after a TLB miss, and when it is not already set. |
| 93 | * The R bit is set by the hardware, when the page is accessed by a remote processor or coprocessor, after a TLB miss, and when it is not already set. |
| 94 | These page table updates use atomic access (LL/SC). |
57 | | === 1.3 First Level Page Table Entry Format === |
58 | | |
59 | | Each entry in a first level page table is a 32 bits word containing either a 2M bytes page descriptor (called PTE1), or a second level page table descriptor (called PTD1) : |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
65 | | |
66 | | |
67 | | |
68 | | |
69 | | |
70 | | If the entry is a PTE1, the PPN1 value (19 bits) must be concatened with the page offset (21 bits) to build the 40 bits physical address. The (V, T, L, R, C, W, X, U, G, D) bits have the same meaning as in a PTE2. |
71 | | |
72 | | If the entry is a PTD1, PTBA is the Page Table Base Address. The PTBA value (28 bits) must be left-shifted by 12 bits to define the base address of the level 2 page table. The page table being aligned in memory, the 12 LSB bits of this address have a 0 value. |