diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2019-05-28 10:38:14 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-06-20 23:29:58 +0200 |
commit | 5f41f9198f296091c6a58bc2e86af1e9f019b2a3 (patch) | |
tree | f309f6b56520b0b974c46cff4de32b3d8decc1c1 /arch/arm/mm/init.c | |
parent | ARM: 8861/1: errata: Workaround errata A12 857271 / A17 857272 (diff) | |
download | linux-5f41f9198f296091c6a58bc2e86af1e9f019b2a3.tar.xz linux-5f41f9198f296091c6a58bc2e86af1e9f019b2a3.zip |
ARM: 8864/1: Add workaround for I-Cache line size mismatch between CPU cores
Some big.LITTLE systems have I-Cache line size mismatch between
LITTLE and big cores. This patch adds a workaround for proper I-Cache
support on such systems. Without it, some class of the userspace code
(typically self-modifying) might suffer from random SIGILL failures.
Similar workaround already exists for ARM64 architecture. I has been
added by commit 116c81f427ff ("arm64: Work around systems with mismatched
cache line sizes").
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index be0b42937888..1a66af5bd259 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -242,6 +242,22 @@ static void __init arm_initrd_init(void) #endif } +#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND +void check_cpu_icache_size(int cpuid) +{ + u32 size, ctr; + + asm("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr)); + + size = 1 << ((ctr & 0xf) + 2); + if (cpuid != 0 && icache_size != size) + pr_info("CPU%u: detected I-Cache line size mismatch, workaround enabled\n", + cpuid); + if (icache_size > size) + icache_size = size; +} +#endif + void __init arm_memblock_init(const struct machine_desc *mdesc) { /* Register the kernel text, kernel data and initrd with memblock. */ |