ARM: 8129/1: errata: work around Cortex-A15 erratum 830321 using dummy strex
authorMark Rutland <mark.rutland@arm.com>
Fri, 15 Aug 2014 11:11:50 +0000 (12:11 +0100)
committerZefan Li <lizefan@huawei.com>
Thu, 25 Sep 2014 03:49:16 +0000 (11:49 +0800)
commit2f3e285da53ae6002cabb028438a65b9f9cee534
treeda3943e7a063b9bcfc004cd016f55a0ef1a894e5
parent5624bb35686b13e17438aaf211586556bcba58da
ARM: 8129/1: errata: work around Cortex-A15 erratum 830321 using dummy strex

commit 2c32c65e3726c773760038910be30cce1b4d4149 upstream.

On revisions of Cortex-A15 prior to r3p3, a CLREX instruction at PL1 may
falsely trigger a watchpoint exception, leading to potential data aborts
during exception return and/or livelock.

This patch resolves the issue in the following ways:

  - Replacing our uses of CLREX with a dummy STREX sequence instead (as
    we did for v6 CPUs).

  - Removing the clrex code from v7_exit_coherency_flush and derivatives,
    since this only exists as a minor performance improvement when
    non-cached exclusives are in use (Linux doesn't use these).

Benchmarking on a variety of ARM cores revealed no measurable
performance difference with this change applied, so the change is
performed unconditionally and no new Kconfig entry is added.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[lizf: Backported to 3.4:
 - Drop changes to arch/arm/include/asm/cacheflush.h and
   arch/arm/mach-exynos/mcpm-exynos.c]
Signed-off-by: Zefan Li <lizefan@huawei.com>
arch/arm/kernel/entry-header.S