1
0
Fork 0
alistair23-linux/arch
Will Deacon 8a4e3a9ead ARM: 7659/1: mm: make mm->context.id an atomic64_t variable
mm->context.id is updated under asid_lock when a new ASID is allocated
to an mm_struct. However, it is also read without the lock when a task
is being scheduled and checking whether or not the current ASID
generation is up-to-date.

If two threads of the same process are being scheduled in parallel and
the bottom bits of the generation in their mm->context.id match the
current generation (that is, the mm_struct has not been used for ~2^24
rollovers) then the non-atomic, lockless access to mm->context.id may
yield the incorrect ASID.

This patch fixes this issue by making mm->context.id and atomic64_t,
ensuring that the generation is always read consistently. For code that
only requires access to the ASID bits (e.g. TLB flushing by mm), then
the value is accessed directly, which GCC converts to an ldrb.

Cc: <stable@vger.kernel.org> # 3.8
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-03-03 22:54:14 +00:00
..
alpha arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
arc ARC: split elf.h into uapi and export it for userspace 2013-02-27 20:00:26 +05:30
arm ARM: 7659/1: mm: make mm->context.id an atomic64_t variable 2013-03-03 22:54:14 +00:00
arm64 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-03-02 08:34:06 -08:00
avr32 arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
blackfin Merge branch 'timer/cleanup' into late/mvebu2 2013-02-28 18:54:15 +01:00
c6x Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
cris Merge branch 'timer/cleanup' into late/mvebu2 2013-02-28 18:54:15 +01:00
frv arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
h8300 arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
hexagon Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
ia64 hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
m32r Merge branch 'timer/cleanup' into late/mvebu2 2013-02-28 18:54:15 +01:00
m68k Merge branch 'timer/cleanup' into late/mvebu2 2013-02-28 18:54:15 +01:00
metag ImgTec Meta architecture changes for v3.9-rc1 2013-03-03 12:06:09 -08:00
microblaze arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
mips Merge git://www.linux-watchdog.org/linux-watchdog 2013-03-03 10:23:29 -08:00
mn10300 arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
openrisc arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
parisc Merge branch 'fixes-for-3.9-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2013-03-03 12:57:38 -08:00
powerpc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-03-02 08:34:06 -08:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-03-03 13:23:03 -08:00
score arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
sh hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
sparc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-03-02 08:34:06 -08:00
tile arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
um Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-02-23 18:50:11 -08:00
unicore32 arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
x86 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-03-03 13:23:03 -08:00
xtensa arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS 2013-02-27 19:10:23 -08:00
.gitignore
Kconfig ImgTec Meta architecture changes for v3.9-rc1 2013-03-03 12:06:09 -08:00