ARM: mm: fix racy ASID rollover broadcast on SMP platforms
authorWill Deacon <will.deacon@arm.com>
Fri, 20 May 2011 11:19:58 +0000 (12:19 +0100)
committer黄涛 <huangtao@rock-chips.com>
Wed, 22 Feb 2012 06:09:45 +0000 (14:09 +0800)
commit3006cb821a6596d592cf43537a9b1993581a07d5
tree816458269f5eb1f8947a8f60e232ce64d07a28de
parent80e4f17cc859e0229a60e97ff778bf1f1e99dd64
ARM: mm: fix racy ASID rollover broadcast on SMP platforms

If ASID rollover is detected on a CPU in an SMP system, a synchronous
IPI call is made to force the secondaries to reallocate their current
ASIDs.

There is a problem where a CPU may be interrupted in the cpu_switch_mm
code with the context ID held in r1. After servicing the IPI, the
context ID register will be updated with an ASID from the previous
generation, polluting the TLB for when that ASID becomes valid in the
new generation.

This patch disables interrupts during cpu_switch_mm for SMP systems,
preventing incoming rollover broadcasts from being serviced while the
register state is inconsistent. Additionally, the context resetting code
is modified to call cpu_switch_mm, rather than setting the context ID
register directly, so that the TTBR always agrees with the ASID.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/include/asm/proc-fns.h
arch/arm/mm/context.c