ARM: Use TTBR1 instead of reserved context ID
authorWill Deacon <will.deacon@arm.com>
Tue, 31 May 2011 14:38:43 +0000 (15:38 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 17 Apr 2012 14:29:21 +0000 (15:29 +0100)
commit3c5f7e7b4a0346de670b08f595bd15e7eec91f97
treeab49b3cd2cc56f83f569350c0dd2a2499de80a09
parente816b57a337ea3b755de72bec38c10c864f23015
ARM: Use TTBR1 instead of reserved context ID

On ARMv7 CPUs that cache first level page table entries (like the
Cortex-A15), using a reserved ASID while changing the TTBR or flushing
the TLB is unsafe.

This is because the CPU may cache the first level entry as the result of
a speculative memory access while the reserved ASID is assigned. After
the process owning the page tables dies, the memory will be reallocated
and may be written with junk values which can be interpreted as global,
valid PTEs by the processor. This will result in the TLB being populated
with bogus global entries.

This patch avoids the use of a reserved context ID in the v7 switch_mm
and ASID rollover code by temporarily using the swapper_pg_dir pointed
at by TTBR1, which contains only global entries that are not tagged
with ASIDs.

Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Tested-by: Marc Zyngier <Marc.Zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[catalin.marinas@arm.com: add LPAE support]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/mm/context.c
arch/arm/mm/proc-v7-2level.S
This page took 0.025092 seconds and 5 git commands to generate.