aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuzuki K Poulose <suzuki.poulose@arm.com>2018-03-26 10:12:49 -0400
committerWill Deacon <will.deacon@arm.com>2018-03-26 13:01:44 -0400
commitece1397cbc89c51914fae1aec729539cfd8bd62b (patch)
tree32e396f96ffcd188ad30d40e73c609d723f89ced
parent05abb595bbaccc9c4290bee62086d0eeea9f0f32 (diff)
arm64: Add work around for Arm Cortex-A55 Erratum 1024718
Some variants of the Arm Cortex-55 cores (r0p0, r0p1, r1p0) suffer from an erratum 1024718, which causes incorrect updates when DBM/AP bits in a page table entry is modified without a break-before-make sequence. The work around is to skip enabling the hardware DBM feature on the affected cores. The hardware Access Flag management features is not affected. There are some other cores suffering from this errata, which could be added to the midr_list to trigger the work around. Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: ckadabi@codeaurora.org Reviewed-by: Dave Martin <dave.martin@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--Documentation/arm64/silicon-errata.txt1
-rw-r--r--arch/arm64/Kconfig14
-rw-r--r--arch/arm64/kernel/cpufeature.c16
3 files changed, 30 insertions, 1 deletions
diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
index c1d520de6dfe..3b2f2dd82225 100644
--- a/Documentation/arm64/silicon-errata.txt
+++ b/Documentation/arm64/silicon-errata.txt
@@ -55,6 +55,7 @@ stable kernels.
55| ARM | Cortex-A57 | #834220 | ARM64_ERRATUM_834220 | 55| ARM | Cortex-A57 | #834220 | ARM64_ERRATUM_834220 |
56| ARM | Cortex-A72 | #853709 | N/A | 56| ARM | Cortex-A72 | #853709 | N/A |
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 | MMU-500 | #841119,#826419 | N/A | 59| ARM | MMU-500 | #841119,#826419 | N/A |
59| | | | | 60| | | | |
60| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 | 61| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index a6688fcf3dc6..fd74c5830232 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -465,6 +465,20 @@ config ARM64_ERRATUM_843419
465 465
466 If unsure, say Y. 466 If unsure, say Y.
467 467
468config ARM64_ERRATUM_1024718
469 bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
470 default y
471 help
472 This option adds work around for Arm Cortex-A55 Erratum 1024718.
473
474 Affected Cortex-A55 cores (r0p0, r0p1, r1p0) could cause incorrect
475 update of the hardware dirty bit when the DBM/AP bits are updated
476 without a break-before-make. The work around is to disable the usage
477 of hardware DBM locally on the affected cores. CPUs not affected by
478 erratum will continue to use the feature.
479
480 If unsure, say Y.
481
468config CAVIUM_ERRATUM_22375 482config CAVIUM_ERRATUM_22375
469 bool "Cavium erratum 22375, 24313" 483 bool "Cavium erratum 22375, 24313"
470 default y 484 default y
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 35e7ae8967f3..381bb4077563 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -966,9 +966,23 @@ static inline void __cpu_enable_hw_dbm(void)
966 isb(); 966 isb();
967} 967}
968 968
969static bool cpu_has_broken_dbm(void)
970{
971 /* List of CPUs which have broken DBM support. */
972 static const struct midr_range cpus[] = {
973#ifdef CONFIG_ARM64_ERRATUM_1024718
974 MIDR_RANGE(MIDR_CORTEX_A55, 0, 0, 1, 0), // A55 r0p0 -r1p0
975#endif
976 {},
977 };
978
979 return is_midr_in_range_list(read_cpuid_id(), cpus);
980}
981
969static bool cpu_can_use_dbm(const struct arm64_cpu_capabilities *cap) 982static bool cpu_can_use_dbm(const struct arm64_cpu_capabilities *cap)
970{ 983{
971 return has_cpuid_feature(cap, SCOPE_LOCAL_CPU); 984 return has_cpuid_feature(cap, SCOPE_LOCAL_CPU) &&
985 !cpu_has_broken_dbm();
972} 986}
973 987
974static void cpu_enable_hw_dbm(struct arm64_cpu_capabilities const *cap) 988static void cpu_enable_hw_dbm(struct arm64_cpu_capabilities const *cap)