| |||
| Home > System Control Coprocessor > System control processor register descriptions > c10, TLB Lockdown Register | |||
The purpose of the TLB Lockdown Register is to control where hardware page table walks place the TLB entry in either:
the set associative region of the TLB.
the lockdown region of the TLB, and if in the lockdown region, which entry to write.
See TLB organization for a description of the structure of the TLB. The lockdown region of the TLB contains eight entries, numbered from 0 to 7.
The TLB Lockdown Register is:
in CP15 c10
32-bit read/write register
accessible in privileged mode only.
Figure 3.48 shows the arrangement of bits in the register.
Table 3.99 shows the bit functions of the TLB Lockdown Register.
Table 3.99. TLB Lockdown Register bit functions
| Bit range | Field name | Function |
|---|---|---|
[31:29] | - | UNP/SBZ. |
| [28:26] | Victim | Specifies the entry in the lockdown region where a subsequent hardware page table walk can place a TLB entry. The Victim value defines the Lockdown region for the TLB entry. Allowed values are 0-7. The reset value is 0. |
[25:1] | - | UNP/SBZ. |
[0] | P | Preserve bit. Determines if subsequent hardware page table walks place a TLB entry in the lockdown region or in the set associative region of the TLB. 0 = Place the TLB entry in the set associative region of the TLB. This is the reset value. 1 = Place the TLB entry in the lockdown region of the TLB as defined by the Victim bits [28:26]. |
TLB entries in the lockdown region are preserved:
Invalidate TLB operations only invalidate the unpreserved entries in the TLB. This means they only invalidate entries in the set-associative region.
Invalidate TLB Single Entry operations invalidate any TLB entry corresponding to the Modified Virtual Address given in Rd, regardless of the preserved state of the entry. This means that they invalidate the specified entry regardless of whether it is in the lockdown region or in the set-associative region of the TLB.
See c8, TLB Operations Register (invalidate TLB operation) for a description of the TLB invalidate operations.
The victim automatically increments after any table walk that results in an entry being written into the lockdown part of the TLB.
Table 3.100 shows the results of attempted accesses to the TLB Lockdown Register for each mode.
Table 3.100. Results of accesses to the Data TLB Lockdown Register
| Privileged read | Privileged write | User read or write |
|---|---|---|
| Data read | Data write | Undefined exception |
To access the TLB Lockdown Register you read or write CP15 with:
Opcode_1 set to 0
CRn set to c10
CRm set to c0
Opcode_2 set to 0.
For example:
MRC p15, 0, <Rd>, c10, c0, 0 ; Read TLB Lockdown Register
MCR p15, 0, <Rd>, c10, c0, 0 ; Write TLB Lockdown Register.
Example 3.3 is a code sequence that locks down an entry to the current victim.
Example 3.3. Lock down an entry to the current victim
ADR r1,LockAddr ; set r1 to the value of the address to be locked down
MCR p15,0,r1,c8,c7,1 ; invalidate TLB single entry to ensure that
; LockAddr is not already in the TLB
MRC p15,0,r0,c10,c0,0 ; read the lockdown register
ORR r0,r0,#1 ; set the preserve bit
MCR p15,0,r0,c10,c0,0 ; write to the lockdown register
LDR r1,[r1] ; TLB will miss, and entry will be loaded
MRC p15,0,r0,c10,c0,0 ; read the lockdown register (victim will have
; incremented)
BIC r0,r0,#1 ; clear preserve bit
MCR p15,0,r0,c10,c0,0 ; write to the lockdown register