05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ARM</strong>v4 <strong>and</strong> <strong>ARM</strong>v5 Differences<br />

The TLB lock by entry model<br />

When a new entry is written to the TLB as the result of a translation table walk following a TLB miss, the<br />

Victim field of the appropriate TLB Lockdown Register is incremented. When the value of the Victim field<br />

reaches the maximum number of TLB entries, the incremented Victim field wraps to the value of the Base<br />

field.<br />

The architecture permits a modified form of this where the Base field is fixed as zero. It is particularly<br />

appropriate where an implementation provides dedicated lockable entries (unified or Harvard) as a separate<br />

resource from the general TLB provision. To determine which form of the locking model is provided, write<br />

the Base field with all bits nonzero, read it back <strong>and</strong> check whether it is a nonzero value.<br />

TLB Lockdown Register format, for the lockdown by entry mechanism<br />

The format of the CP15 register used for the lockdown by entry form is:<br />

31 32-Wa 31-W 32-2W 31-2W 1 0<br />

Base Victim Reserved P<br />

a. W = log2(n), rounded up to an integer if necessary, where n is the number of TLB entries.<br />

If the implementation has separate instruction <strong>and</strong> data TLBs, there are two variants of this register, selected<br />

by the field of the MCR or MRC instruction used to access the CP15 c10 register:<br />

== 0 Selects the data TLB lockdown register.<br />

== 1 Selects the instruction TLB lockdown register.<br />

If the implementation has a unified TLB, only one variant of this register exists, <strong>and</strong> must be zero.<br />

CRm must be c0 for MCR <strong>and</strong> MRC instructions that access the CP15 c10 register.<br />

Writing the appropriate TLB lockdown by entry register has the following effects:<br />

The victim field specifies which TLB entry is replaced by the translation table walk result generated<br />

by the next TLB miss.<br />

The Base field constrains the TLB replacement strategy to only use the TLB entries numbered from<br />

(Base) to ((number of TLB entries)-1), provided the victim field is already in that range.<br />

Any translation table walk results written to TLB entries while P == 1 are protected from being<br />

invalidated by the CP15 c8 invalidate entire TLB operations. Ones written while P == 0 are<br />

invalidated normally by these operations.<br />

Note<br />

If the number of TLB entries is not a power of two, writing a value to either the Base or Victim fields that<br />

is greater than or equal to the number of TLB entries has UNPREDICTABLE results.<br />

Reading the appropriate TLB lockdown by entry register returns the last values written to the Base field <strong>and</strong><br />

the P bit, <strong>and</strong> the number of the next TLB entry to be replaced in the victim field.<br />

AppxH-60 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!