GNU Linux-libre 5.15.72-gnu
[releases.git] / arch / arm64 / kernel / cpu_errata.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Contains CPU specific errata definitions
4  *
5  * Copyright (C) 2014 ARM Ltd.
6  */
7
8 #include <linux/arm-smccc.h>
9 #include <linux/types.h>
10 #include <linux/cpu.h>
11 #include <asm/cpu.h>
12 #include <asm/cputype.h>
13 #include <asm/cpufeature.h>
14 #include <asm/kvm_asm.h>
15 #include <asm/smp_plat.h>
16
17 static bool __maybe_unused
18 is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int scope)
19 {
20         const struct arm64_midr_revidr *fix;
21         u32 midr = read_cpuid_id(), revidr;
22
23         WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
24         if (!is_midr_in_range(midr, &entry->midr_range))
25                 return false;
26
27         midr &= MIDR_REVISION_MASK | MIDR_VARIANT_MASK;
28         revidr = read_cpuid(REVIDR_EL1);
29         for (fix = entry->fixed_revs; fix && fix->revidr_mask; fix++)
30                 if (midr == fix->midr_rv && (revidr & fix->revidr_mask))
31                         return false;
32
33         return true;
34 }
35
36 static bool __maybe_unused
37 is_affected_midr_range_list(const struct arm64_cpu_capabilities *entry,
38                             int scope)
39 {
40         WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
41         return is_midr_in_range_list(read_cpuid_id(), entry->midr_range_list);
42 }
43
44 static bool __maybe_unused
45 is_kryo_midr(const struct arm64_cpu_capabilities *entry, int scope)
46 {
47         u32 model;
48
49         WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
50
51         model = read_cpuid_id();
52         model &= MIDR_IMPLEMENTOR_MASK | (0xf00 << MIDR_PARTNUM_SHIFT) |
53                  MIDR_ARCHITECTURE_MASK;
54
55         return model == entry->midr_range.model;
56 }
57
58 static bool
59 has_mismatched_cache_type(const struct arm64_cpu_capabilities *entry,
60                           int scope)
61 {
62         u64 mask = arm64_ftr_reg_ctrel0.strict_mask;
63         u64 sys = arm64_ftr_reg_ctrel0.sys_val & mask;
64         u64 ctr_raw, ctr_real;
65
66         WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
67
68         /*
69          * We want to make sure that all the CPUs in the system expose
70          * a consistent CTR_EL0 to make sure that applications behaves
71          * correctly with migration.
72          *
73          * If a CPU has CTR_EL0.IDC but does not advertise it via CTR_EL0 :
74          *
75          * 1) It is safe if the system doesn't support IDC, as CPU anyway
76          *    reports IDC = 0, consistent with the rest.
77          *
78          * 2) If the system has IDC, it is still safe as we trap CTR_EL0
79          *    access on this CPU via the ARM64_HAS_CACHE_IDC capability.
80          *
81          * So, we need to make sure either the raw CTR_EL0 or the effective
82          * CTR_EL0 matches the system's copy to allow a secondary CPU to boot.
83          */
84         ctr_raw = read_cpuid_cachetype() & mask;
85         ctr_real = read_cpuid_effective_cachetype() & mask;
86
87         return (ctr_real != sys) && (ctr_raw != sys);
88 }
89
90 static void
91 cpu_enable_trap_ctr_access(const struct arm64_cpu_capabilities *cap)
92 {
93         u64 mask = arm64_ftr_reg_ctrel0.strict_mask;
94         bool enable_uct_trap = false;
95
96         /* Trap CTR_EL0 access on this CPU, only if it has a mismatch */
97         if ((read_cpuid_cachetype() & mask) !=
98             (arm64_ftr_reg_ctrel0.sys_val & mask))
99                 enable_uct_trap = true;
100
101         /* ... or if the system is affected by an erratum */
102         if (cap->capability == ARM64_WORKAROUND_1542419)
103                 enable_uct_trap = true;
104
105         if (enable_uct_trap)
106                 sysreg_clear_set(sctlr_el1, SCTLR_EL1_UCT, 0);
107 }
108
109 #ifdef CONFIG_ARM64_ERRATUM_1463225
110 static bool
111 has_cortex_a76_erratum_1463225(const struct arm64_cpu_capabilities *entry,
112                                int scope)
113 {
114         return is_affected_midr_range_list(entry, scope) && is_kernel_in_hyp_mode();
115 }
116 #endif
117
118 static void __maybe_unused
119 cpu_enable_cache_maint_trap(const struct arm64_cpu_capabilities *__unused)
120 {
121         sysreg_clear_set(sctlr_el1, SCTLR_EL1_UCI, 0);
122 }
123
124 #define CAP_MIDR_RANGE(model, v_min, r_min, v_max, r_max)       \
125         .matches = is_affected_midr_range,                      \
126         .midr_range = MIDR_RANGE(model, v_min, r_min, v_max, r_max)
127
128 #define CAP_MIDR_ALL_VERSIONS(model)                                    \
129         .matches = is_affected_midr_range,                              \
130         .midr_range = MIDR_ALL_VERSIONS(model)
131
132 #define MIDR_FIXED(rev, revidr_mask) \
133         .fixed_revs = (struct arm64_midr_revidr[]){{ (rev), (revidr_mask) }, {}}
134
135 #define ERRATA_MIDR_RANGE(model, v_min, r_min, v_max, r_max)            \
136         .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,                         \
137         CAP_MIDR_RANGE(model, v_min, r_min, v_max, r_max)
138
139 #define CAP_MIDR_RANGE_LIST(list)                               \
140         .matches = is_affected_midr_range_list,                 \
141         .midr_range_list = list
142
143 /* Errata affecting a range of revisions of  given model variant */
144 #define ERRATA_MIDR_REV_RANGE(m, var, r_min, r_max)      \
145         ERRATA_MIDR_RANGE(m, var, r_min, var, r_max)
146
147 /* Errata affecting a single variant/revision of a model */
148 #define ERRATA_MIDR_REV(model, var, rev)        \
149         ERRATA_MIDR_RANGE(model, var, rev, var, rev)
150
151 /* Errata affecting all variants/revisions of a given a model */
152 #define ERRATA_MIDR_ALL_VERSIONS(model)                         \
153         .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,                 \
154         CAP_MIDR_ALL_VERSIONS(model)
155
156 /* Errata affecting a list of midr ranges, with same work around */
157 #define ERRATA_MIDR_RANGE_LIST(midr_list)                       \
158         .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,                 \
159         CAP_MIDR_RANGE_LIST(midr_list)
160
161 static const __maybe_unused struct midr_range tx2_family_cpus[] = {
162         MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN),
163         MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2),
164         {},
165 };
166
167 static bool __maybe_unused
168 needs_tx2_tvm_workaround(const struct arm64_cpu_capabilities *entry,
169                          int scope)
170 {
171         int i;
172
173         if (!is_affected_midr_range_list(entry, scope) ||
174             !is_hyp_mode_available())
175                 return false;
176
177         for_each_possible_cpu(i) {
178                 if (MPIDR_AFFINITY_LEVEL(cpu_logical_map(i), 0) != 0)
179                         return true;
180         }
181
182         return false;
183 }
184
185 static bool __maybe_unused
186 has_neoverse_n1_erratum_1542419(const struct arm64_cpu_capabilities *entry,
187                                 int scope)
188 {
189         u32 midr = read_cpuid_id();
190         bool has_dic = read_cpuid_cachetype() & BIT(CTR_DIC_SHIFT);
191         const struct midr_range range = MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1);
192
193         WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
194         return is_midr_in_range(midr, &range) && has_dic;
195 }
196
197 #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
198 static const struct arm64_cpu_capabilities arm64_repeat_tlbi_list[] = {
199 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009
200         {
201                 ERRATA_MIDR_REV(MIDR_QCOM_FALKOR_V1, 0, 0)
202         },
203         {
204                 .midr_range.model = MIDR_QCOM_KRYO,
205                 .matches = is_kryo_midr,
206         },
207 #endif
208 #ifdef CONFIG_ARM64_ERRATUM_1286807
209         {
210                 ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 0),
211         },
212         {
213                 /* Kryo4xx Gold (rcpe to rfpe) => (r0p0 to r3p0) */
214                 ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe),
215         },
216 #endif
217 #ifdef CONFIG_ARM64_ERRATUM_2441009
218         {
219                 /* Cortex-A510 r0p0 -> r1p1. Fixed in r1p2 */
220                 ERRATA_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1),
221         },
222 #endif
223         {},
224 };
225 #endif
226
227 #ifdef CONFIG_CAVIUM_ERRATUM_27456
228 const struct midr_range cavium_erratum_27456_cpus[] = {
229         /* Cavium ThunderX, T88 pass 1.x - 2.1 */
230         MIDR_RANGE(MIDR_THUNDERX, 0, 0, 1, 1),
231         /* Cavium ThunderX, T81 pass 1.0 */
232         MIDR_REV(MIDR_THUNDERX_81XX, 0, 0),
233         {},
234 };
235 #endif
236
237 #ifdef CONFIG_CAVIUM_ERRATUM_30115
238 static const struct midr_range cavium_erratum_30115_cpus[] = {
239         /* Cavium ThunderX, T88 pass 1.x - 2.2 */
240         MIDR_RANGE(MIDR_THUNDERX, 0, 0, 1, 2),
241         /* Cavium ThunderX, T81 pass 1.0 - 1.2 */
242         MIDR_REV_RANGE(MIDR_THUNDERX_81XX, 0, 0, 2),
243         /* Cavium ThunderX, T83 pass 1.0 */
244         MIDR_REV(MIDR_THUNDERX_83XX, 0, 0),
245         {},
246 };
247 #endif
248
249 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003
250 static const struct arm64_cpu_capabilities qcom_erratum_1003_list[] = {
251         {
252                 ERRATA_MIDR_REV(MIDR_QCOM_FALKOR_V1, 0, 0),
253         },
254         {
255                 .midr_range.model = MIDR_QCOM_KRYO,
256                 .matches = is_kryo_midr,
257         },
258         {},
259 };
260 #endif
261
262 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
263 static const struct midr_range workaround_clean_cache[] = {
264 #if     defined(CONFIG_ARM64_ERRATUM_826319) || \
265         defined(CONFIG_ARM64_ERRATUM_827319) || \
266         defined(CONFIG_ARM64_ERRATUM_824069)
267         /* Cortex-A53 r0p[012]: ARM errata 826319, 827319, 824069 */
268         MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 2),
269 #endif
270 #ifdef  CONFIG_ARM64_ERRATUM_819472
271         /* Cortex-A53 r0p[01] : ARM errata 819472 */
272         MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 1),
273 #endif
274         {},
275 };
276 #endif
277
278 #ifdef CONFIG_ARM64_ERRATUM_1418040
279 /*
280  * - 1188873 affects r0p0 to r2p0
281  * - 1418040 affects r0p0 to r3p1
282  */
283 static const struct midr_range erratum_1418040_list[] = {
284         /* Cortex-A76 r0p0 to r3p1 */
285         MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1),
286         /* Neoverse-N1 r0p0 to r3p1 */
287         MIDR_RANGE(MIDR_NEOVERSE_N1, 0, 0, 3, 1),
288         /* Kryo4xx Gold (rcpe to rfpf) => (r0p0 to r3p1) */
289         MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xf),
290         {},
291 };
292 #endif
293
294 #ifdef CONFIG_ARM64_ERRATUM_845719
295 static const struct midr_range erratum_845719_list[] = {
296         /* Cortex-A53 r0p[01234] */
297         MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 4),
298         /* Brahma-B53 r0p[0] */
299         MIDR_REV(MIDR_BRAHMA_B53, 0, 0),
300         /* Kryo2XX Silver rAp4 */
301         MIDR_REV(MIDR_QCOM_KRYO_2XX_SILVER, 0xa, 0x4),
302         {},
303 };
304 #endif
305
306 #ifdef CONFIG_ARM64_ERRATUM_843419
307 static const struct arm64_cpu_capabilities erratum_843419_list[] = {
308         {
309                 /* Cortex-A53 r0p[01234] */
310                 .matches = is_affected_midr_range,
311                 ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 4),
312                 MIDR_FIXED(0x4, BIT(8)),
313         },
314         {
315                 /* Brahma-B53 r0p[0] */
316                 .matches = is_affected_midr_range,
317                 ERRATA_MIDR_REV(MIDR_BRAHMA_B53, 0, 0),
318         },
319         {},
320 };
321 #endif
322
323 #ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT
324 static const struct midr_range erratum_speculative_at_list[] = {
325 #ifdef CONFIG_ARM64_ERRATUM_1165522
326         /* Cortex A76 r0p0 to r2p0 */
327         MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 2, 0),
328 #endif
329 #ifdef CONFIG_ARM64_ERRATUM_1319367
330         MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
331         MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
332 #endif
333 #ifdef CONFIG_ARM64_ERRATUM_1530923
334         /* Cortex A55 r0p0 to r2p0 */
335         MIDR_RANGE(MIDR_CORTEX_A55, 0, 0, 2, 0),
336         /* Kryo4xx Silver (rdpe => r1p0) */
337         MIDR_REV(MIDR_QCOM_KRYO_4XX_SILVER, 0xd, 0xe),
338 #endif
339         {},
340 };
341 #endif
342
343 #ifdef CONFIG_ARM64_ERRATUM_1463225
344 static const struct midr_range erratum_1463225[] = {
345         /* Cortex-A76 r0p0 - r3p1 */
346         MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1),
347         /* Kryo4xx Gold (rcpe to rfpf) => (r0p0 to r3p1) */
348         MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xf),
349         {},
350 };
351 #endif
352
353 const struct arm64_cpu_capabilities arm64_errata[] = {
354 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
355         {
356                 .desc = "ARM errata 826319, 827319, 824069, or 819472",
357                 .capability = ARM64_WORKAROUND_CLEAN_CACHE,
358                 ERRATA_MIDR_RANGE_LIST(workaround_clean_cache),
359                 .cpu_enable = cpu_enable_cache_maint_trap,
360         },
361 #endif
362 #ifdef CONFIG_ARM64_ERRATUM_832075
363         {
364         /* Cortex-A57 r0p0 - r1p2 */
365                 .desc = "ARM erratum 832075",
366                 .capability = ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE,
367                 ERRATA_MIDR_RANGE(MIDR_CORTEX_A57,
368                                   0, 0,
369                                   1, 2),
370         },
371 #endif
372 #ifdef CONFIG_ARM64_ERRATUM_834220
373         {
374         /* Cortex-A57 r0p0 - r1p2 */
375                 .desc = "ARM erratum 834220",
376                 .capability = ARM64_WORKAROUND_834220,
377                 ERRATA_MIDR_RANGE(MIDR_CORTEX_A57,
378                                   0, 0,
379                                   1, 2),
380         },
381 #endif
382 #ifdef CONFIG_ARM64_ERRATUM_843419
383         {
384                 .desc = "ARM erratum 843419",
385                 .capability = ARM64_WORKAROUND_843419,
386                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
387                 .matches = cpucap_multi_entry_cap_matches,
388                 .match_list = erratum_843419_list,
389         },
390 #endif
391 #ifdef CONFIG_ARM64_ERRATUM_845719
392         {
393                 .desc = "ARM erratum 845719",
394                 .capability = ARM64_WORKAROUND_845719,
395                 ERRATA_MIDR_RANGE_LIST(erratum_845719_list),
396         },
397 #endif
398 #ifdef CONFIG_CAVIUM_ERRATUM_23154
399         {
400         /* Cavium ThunderX, pass 1.x */
401                 .desc = "Cavium erratum 23154",
402                 .capability = ARM64_WORKAROUND_CAVIUM_23154,
403                 ERRATA_MIDR_REV_RANGE(MIDR_THUNDERX, 0, 0, 1),
404         },
405 #endif
406 #ifdef CONFIG_CAVIUM_ERRATUM_27456
407         {
408                 .desc = "Cavium erratum 27456",
409                 .capability = ARM64_WORKAROUND_CAVIUM_27456,
410                 ERRATA_MIDR_RANGE_LIST(cavium_erratum_27456_cpus),
411         },
412 #endif
413 #ifdef CONFIG_CAVIUM_ERRATUM_30115
414         {
415                 .desc = "Cavium erratum 30115",
416                 .capability = ARM64_WORKAROUND_CAVIUM_30115,
417                 ERRATA_MIDR_RANGE_LIST(cavium_erratum_30115_cpus),
418         },
419 #endif
420         {
421                 .desc = "Mismatched cache type (CTR_EL0)",
422                 .capability = ARM64_MISMATCHED_CACHE_TYPE,
423                 .matches = has_mismatched_cache_type,
424                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
425                 .cpu_enable = cpu_enable_trap_ctr_access,
426         },
427 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003
428         {
429                 .desc = "Qualcomm Technologies Falkor/Kryo erratum 1003",
430                 .capability = ARM64_WORKAROUND_QCOM_FALKOR_E1003,
431                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
432                 .matches = cpucap_multi_entry_cap_matches,
433                 .match_list = qcom_erratum_1003_list,
434         },
435 #endif
436 #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
437         {
438                 .desc = "Qualcomm erratum 1009, or ARM erratum 1286807, 2441009",
439                 .capability = ARM64_WORKAROUND_REPEAT_TLBI,
440                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
441                 .matches = cpucap_multi_entry_cap_matches,
442                 .match_list = arm64_repeat_tlbi_list,
443         },
444 #endif
445 #ifdef CONFIG_ARM64_ERRATUM_858921
446         {
447         /* Cortex-A73 all versions */
448                 .desc = "ARM erratum 858921",
449                 .capability = ARM64_WORKAROUND_858921,
450                 ERRATA_MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
451         },
452 #endif
453         {
454                 .desc = "Spectre-v2",
455                 .capability = ARM64_SPECTRE_V2,
456                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
457                 .matches = has_spectre_v2,
458                 .cpu_enable = spectre_v2_enable_mitigation,
459         },
460 #ifdef CONFIG_RANDOMIZE_BASE
461         {
462         /* Must come after the Spectre-v2 entry */
463                 .desc = "Spectre-v3a",
464                 .capability = ARM64_SPECTRE_V3A,
465                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
466                 .matches = has_spectre_v3a,
467                 .cpu_enable = spectre_v3a_enable_mitigation,
468         },
469 #endif
470         {
471                 .desc = "Spectre-v4",
472                 .capability = ARM64_SPECTRE_V4,
473                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
474                 .matches = has_spectre_v4,
475                 .cpu_enable = spectre_v4_enable_mitigation,
476         },
477         {
478                 .desc = "Spectre-BHB",
479                 .capability = ARM64_SPECTRE_BHB,
480                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
481                 .matches = is_spectre_bhb_affected,
482                 .cpu_enable = spectre_bhb_enable_mitigation,
483         },
484 #ifdef CONFIG_ARM64_ERRATUM_1418040
485         {
486                 .desc = "ARM erratum 1418040",
487                 .capability = ARM64_WORKAROUND_1418040,
488                 ERRATA_MIDR_RANGE_LIST(erratum_1418040_list),
489                 /*
490                  * We need to allow affected CPUs to come in late, but
491                  * also need the non-affected CPUs to be able to come
492                  * in at any point in time. Wonderful.
493                  */
494                 .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
495         },
496 #endif
497 #ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT
498         {
499                 .desc = "ARM errata 1165522, 1319367, or 1530923",
500                 .capability = ARM64_WORKAROUND_SPECULATIVE_AT,
501                 ERRATA_MIDR_RANGE_LIST(erratum_speculative_at_list),
502         },
503 #endif
504 #ifdef CONFIG_ARM64_ERRATUM_1463225
505         {
506                 .desc = "ARM erratum 1463225",
507                 .capability = ARM64_WORKAROUND_1463225,
508                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
509                 .matches = has_cortex_a76_erratum_1463225,
510                 .midr_range_list = erratum_1463225,
511         },
512 #endif
513 #ifdef CONFIG_CAVIUM_TX2_ERRATUM_219
514         {
515                 .desc = "Cavium ThunderX2 erratum 219 (KVM guest sysreg trapping)",
516                 .capability = ARM64_WORKAROUND_CAVIUM_TX2_219_TVM,
517                 ERRATA_MIDR_RANGE_LIST(tx2_family_cpus),
518                 .matches = needs_tx2_tvm_workaround,
519         },
520         {
521                 .desc = "Cavium ThunderX2 erratum 219 (PRFM removal)",
522                 .capability = ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM,
523                 ERRATA_MIDR_RANGE_LIST(tx2_family_cpus),
524         },
525 #endif
526 #ifdef CONFIG_ARM64_ERRATUM_1542419
527         {
528                 /* we depend on the firmware portion for correctness */
529                 .desc = "ARM erratum 1542419 (kernel portion)",
530                 .capability = ARM64_WORKAROUND_1542419,
531                 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
532                 .matches = has_neoverse_n1_erratum_1542419,
533                 .cpu_enable = cpu_enable_trap_ctr_access,
534         },
535 #endif
536 #ifdef CONFIG_ARM64_ERRATUM_1508412
537         {
538                 /* we depend on the firmware portion for correctness */
539                 .desc = "ARM erratum 1508412 (kernel portion)",
540                 .capability = ARM64_WORKAROUND_1508412,
541                 ERRATA_MIDR_RANGE(MIDR_CORTEX_A77,
542                                   0, 0,
543                                   1, 0),
544         },
545 #endif
546 #ifdef CONFIG_NVIDIA_CARMEL_CNP_ERRATUM
547         {
548                 /* NVIDIA Carmel */
549                 .desc = "NVIDIA Carmel CNP erratum",
550                 .capability = ARM64_WORKAROUND_NVIDIA_CARMEL_CNP,
551                 ERRATA_MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL),
552         },
553 #endif
554 #ifdef CONFIG_ARM64_ERRATUM_2457168
555         {
556                 .desc = "ARM erratum 2457168",
557                 .capability = ARM64_WORKAROUND_2457168,
558                 .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
559                 /* Cortex-A510 r0p0-r1p1 */
560                 CAP_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1)
561         },
562 #endif
563         {
564         }
565 };