[ARM] Fix ASID version switch
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 8 May 2007 19:03:09 +0000 (20:03 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 8 May 2007 19:03:09 +0000 (20:03 +0100)
commit8678c1f04277daaa914abb107fb9fe71298d916d
treec4916538ff592210363909099aad866e1ba67985
parent08fdffd4cf4ddd4eb4b32e78f93f4ff53ccec78f
[ARM] Fix ASID version switch

Close a hole in the ASID version switch, particularly the following
scenario:

CPU0 MM PID CPU1 MM PID
idle
  A pid(A)
  A idle(lazy tlb)
* new asid version triggered by B *
  B pid(B)
  A pid(A)
* MM A gets new asid version *
  A idle(lazy tlb)
  A pid(A)
* CPU1 doesn't see the new ASID *

The result is that CPU1 continues running with the hardware set
for the original (stale) ASID value, but mm->context.id contains
the new ASID value.  The result is that the next MM fault on CPU1
updates the page table entries, but flush_tlb_page() fails due to
wrong ASID.

There is a related case with a threaded application is allocated
a new ASID on one CPU while another of its threads is running on
some different CPU.  This scenario is not fixed by this commit.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/context.c
include/asm-arm/mmu_context.h