summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2018-11-19 06:27:28 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2018-11-29 11:45:45 -0500
commitce8c80c536dac9f325a051b30bf7730ee505eddc (patch)
treeb08f46fdd50ec86694cbd8fbe78c4b84daced233
parent2e6e902d185027f8e3cb8b7305238f7e35d6a436 (diff)
arm64: Add workaround for Cortex-A76 erratum 1286807
On the affected Cortex-A76 cores (r0p0 to r3p0), if a virtual address for a cacheable mapping of a location is being accessed by a core while another core is remapping the virtual address to a new physical page using the recommended break-before-make sequence, then under very rare circumstances TLBI+DSB completes before a read using the translation being invalidated has been observed by other observers. The workaround repeats the TLBI+DSB operation and is shared with the Qualcomm Falkor erratum 1009 Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r--Documentation/arm64/silicon-errata.txt1
-rw-r--r--arch/arm64/Kconfig25
-rw-r--r--arch/arm64/include/asm/tlbflush.h4
-rw-r--r--arch/arm64/kernel/cpu_errata.c20
4 files changed, 45 insertions, 5 deletions
diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
index 76ccded8b74c..8f9577621144 100644
--- a/Documentation/arm64/silicon-errata.txt
+++ b/Documentation/arm64/silicon-errata.txt
@@ -57,6 +57,7 @@ stable kernels.
57| ARM | Cortex-A73 | #858921 | ARM64_ERRATUM_858921 | 57| ARM | Cortex-A73 | #858921 | ARM64_ERRATUM_858921 |
58| ARM | Cortex-A55 | #1024718 | ARM64_ERRATUM_1024718 | 58| ARM | Cortex-A55 | #1024718 | ARM64_ERRATUM_1024718 |
59| ARM | Cortex-A76 | #1188873 | ARM64_ERRATUM_1188873 | 59| ARM | Cortex-A76 | #1188873 | ARM64_ERRATUM_1188873 |
60| ARM | Cortex-A76 | #1286807 | ARM64_ERRATUM_1286807 |
60| ARM | MMU-500 | #841119,#826419 | N/A | 61| ARM | MMU-500 | #841119,#826419 | N/A |
61| | | | | 62| | | | |
62| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 | 63| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 787d7850e064..ea2ab0330e3a 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -497,6 +497,24 @@ config ARM64_ERRATUM_1188873
497 497
498 If unsure, say Y. 498 If unsure, say Y.
499 499
500config ARM64_ERRATUM_1286807
501 bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
502 default y
503 select ARM64_WORKAROUND_REPEAT_TLBI
504 help
505 This option adds workaround for ARM Cortex-A76 erratum 1286807
506
507 On the affected Cortex-A76 cores (r0p0 to r3p0), if a virtual
508 address for a cacheable mapping of a location is being
509 accessed by a core while another core is remapping the virtual
510 address to a new physical page using the recommended
511 break-before-make sequence, then under very rare circumstances
512 TLBI+DSB completes before a read using the translation being
513 invalidated has been observed by other observers. The
514 workaround repeats the TLBI+DSB operation.
515
516 If unsure, say Y.
517
500config CAVIUM_ERRATUM_22375 518config CAVIUM_ERRATUM_22375
501 bool "Cavium erratum 22375, 24313" 519 bool "Cavium erratum 22375, 24313"
502 default y 520 default y
@@ -566,9 +584,16 @@ config QCOM_FALKOR_ERRATUM_1003
566 is unchanged. Work around the erratum by invalidating the walk cache 584 is unchanged. Work around the erratum by invalidating the walk cache
567 entries for the trampoline before entering the kernel proper. 585 entries for the trampoline before entering the kernel proper.
568 586
587config ARM64_WORKAROUND_REPEAT_TLBI
588 bool
589 help
590 Enable the repeat TLBI workaround for Falkor erratum 1009 and
591 Cortex-A76 erratum 1286807.
592
569config QCOM_FALKOR_ERRATUM_1009 593config QCOM_FALKOR_ERRATUM_1009
570 bool "Falkor E1009: Prematurely complete a DSB after a TLBI" 594 bool "Falkor E1009: Prematurely complete a DSB after a TLBI"
571 default y 595 default y
596 select ARM64_WORKAROUND_REPEAT_TLBI
572 help 597 help
573 On Falkor v1, the CPU may prematurely complete a DSB following a 598 On Falkor v1, the CPU may prematurely complete a DSB following a
574 TLBI xxIS invalidate maintenance operation. Repeat the TLBI operation 599 TLBI xxIS invalidate maintenance operation. Repeat the TLBI operation
diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h
index c3c0387aee18..5dfd23897dea 100644
--- a/arch/arm64/include/asm/tlbflush.h
+++ b/arch/arm64/include/asm/tlbflush.h
@@ -41,14 +41,14 @@
41 ALTERNATIVE("nop\n nop", \ 41 ALTERNATIVE("nop\n nop", \
42 "dsb ish\n tlbi " #op, \ 42 "dsb ish\n tlbi " #op, \
43 ARM64_WORKAROUND_REPEAT_TLBI, \ 43 ARM64_WORKAROUND_REPEAT_TLBI, \
44 CONFIG_QCOM_FALKOR_ERRATUM_1009) \ 44 CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
45 : : ) 45 : : )
46 46
47#define __TLBI_1(op, arg) asm ("tlbi " #op ", %0\n" \ 47#define __TLBI_1(op, arg) asm ("tlbi " #op ", %0\n" \
48 ALTERNATIVE("nop\n nop", \ 48 ALTERNATIVE("nop\n nop", \
49 "dsb ish\n tlbi " #op ", %0", \ 49 "dsb ish\n tlbi " #op ", %0", \
50 ARM64_WORKAROUND_REPEAT_TLBI, \ 50 ARM64_WORKAROUND_REPEAT_TLBI, \
51 CONFIG_QCOM_FALKOR_ERRATUM_1009) \ 51 CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
52 : : "r" (arg)) 52 : : "r" (arg))
53 53
54#define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg) 54#define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg)
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index a509e35132d2..6ad715d67df8 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -570,6 +570,20 @@ static const struct midr_range arm64_harden_el2_vectors[] = {
570 570
571#endif 571#endif
572 572
573#ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
574
575static const struct midr_range arm64_repeat_tlbi_cpus[] = {
576#ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009
577 MIDR_RANGE(MIDR_QCOM_FALKOR_V1, 0, 0, 0, 0),
578#endif
579#ifdef CONFIG_ARM64_ERRATUM_1286807
580 MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 0),
581#endif
582 {},
583};
584
585#endif
586
573const struct arm64_cpu_capabilities arm64_errata[] = { 587const struct arm64_cpu_capabilities arm64_errata[] = {
574#if defined(CONFIG_ARM64_ERRATUM_826319) || \ 588#if defined(CONFIG_ARM64_ERRATUM_826319) || \
575 defined(CONFIG_ARM64_ERRATUM_827319) || \ 589 defined(CONFIG_ARM64_ERRATUM_827319) || \
@@ -695,11 +709,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
695 .matches = is_kryo_midr, 709 .matches = is_kryo_midr,
696 }, 710 },
697#endif 711#endif
698#ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009 712#ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
699 { 713 {
700 .desc = "Qualcomm Technologies Falkor erratum 1009", 714 .desc = "Qualcomm erratum 1009, ARM erratum 1286807",
701 .capability = ARM64_WORKAROUND_REPEAT_TLBI, 715 .capability = ARM64_WORKAROUND_REPEAT_TLBI,
702 ERRATA_MIDR_REV(MIDR_QCOM_FALKOR_V1, 0, 0), 716 ERRATA_MIDR_RANGE_LIST(arm64_repeat_tlbi_cpus),
703 }, 717 },
704#endif 718#endif
705#ifdef CONFIG_ARM64_ERRATUM_858921 719#ifdef CONFIG_ARM64_ERRATUM_858921