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 />

Reading a Format A register returns the value last written to it.<br />

Writing a Format A register has the following effects:<br />

The next cache miss in each cache set replaces the cache line with the specified WAY in that cache set.<br />

The replacement strategy for the cache is constrained so that it can only select cache lines with the<br />

specified WAY <strong>and</strong> higher until the register is written again.<br />

The format of a Format B lockdown register is:<br />

31 30 W W–1 0<br />

L UNK/SBZ WAY<br />

Reading a Format B register returns the value last written to it.<br />

Writing a Format B register has the following effects:<br />

If L == 1, all cache misses replace the cache line with the specified WAY in the relevant cache set<br />

until the register is written again.<br />

If L ==0:<br />

— If the previous value of L was 0, <strong>and</strong> the previous value of WAY is smaller than the new value,<br />

the behavior is UNPREDICTABLE.<br />

— If the previous value of L was not 0, the replacement strategy for the cache is constrained so<br />

that it can only select cache lines with the specified WAY <strong>and</strong> higher until the register is written<br />

again.<br />

Format A <strong>and</strong> B cache lockdown procedure<br />

The procedure for locking down N lockdown blocks is as follows:<br />

1. Ensure that no processor exceptions can occur during the execution of this procedure, for example by<br />

disabling interrupts. If for some reason this is not possible, all code <strong>and</strong> data used by any exception<br />

h<strong>and</strong>lers that can get called must be treated as code <strong>and</strong> data used by this procedure for the purpose<br />

of steps 2 <strong>and</strong> 3.<br />

2. If an instruction cache or a unified cache is being locked down, ensure that all the code executed by<br />

this procedure is in an Non-cacheable area of memory.<br />

3. If a data cache or a unified cache is being locked down, ensure that all data used by the following<br />

code is in an Non-cacheable area of memory, apart from the data that is to be locked down.<br />

4. Ensure that the data or instructions that are to be locked down are in a Cacheable area of memory.<br />

5. Ensure that the data or instructions that are to be locked down are not already in the cache, using<br />

cache clean, invalidate, or clean <strong>and</strong> invalidate instructions as appropriate.<br />

6. For each value of i from 0 to N-1:<br />

a. Write to the CP15 c9 register with:<br />

WAY == i, for Formats A <strong>and</strong> B<br />

L == 1, for Format B only.<br />

b. For each of the cache lines to be locked down in lockdown block i:<br />

AppxH-54 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!