2 * Contains CPU specific errata definitions
4 * Copyright (C) 2014 ARM Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include <linux/arm-smccc.h>
20 #include <linux/psci.h>
21 #include <linux/types.h>
23 #include <asm/cputype.h>
24 #include <asm/cpufeature.h>
26 static bool __maybe_unused
27 is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int scope)
29 const struct arm64_midr_revidr *fix;
30 u32 midr = read_cpuid_id(), revidr;
32 WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
33 if (!is_midr_in_range(midr, &entry->midr_range))
36 midr &= MIDR_REVISION_MASK | MIDR_VARIANT_MASK;
37 revidr = read_cpuid(REVIDR_EL1);
38 for (fix = entry->fixed_revs; fix && fix->revidr_mask; fix++)
39 if (midr == fix->midr_rv && (revidr & fix->revidr_mask))
45 static bool __maybe_unused
46 is_affected_midr_range_list(const struct arm64_cpu_capabilities *entry,
49 WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
50 return is_midr_in_range_list(read_cpuid_id(), entry->midr_range_list);
53 static bool __maybe_unused
54 is_kryo_midr(const struct arm64_cpu_capabilities *entry, int scope)
58 WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
60 model = read_cpuid_id();
61 model &= MIDR_IMPLEMENTOR_MASK | (0xf00 << MIDR_PARTNUM_SHIFT) |
62 MIDR_ARCHITECTURE_MASK;
64 return model == entry->midr_range.model;
68 has_mismatched_cache_type(const struct arm64_cpu_capabilities *entry,
71 u64 mask = arm64_ftr_reg_ctrel0.strict_mask;
72 u64 sys = arm64_ftr_reg_ctrel0.sys_val & mask;
73 u64 ctr_raw, ctr_real;
75 WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
78 * We want to make sure that all the CPUs in the system expose
79 * a consistent CTR_EL0 to make sure that applications behaves
80 * correctly with migration.
82 * If a CPU has CTR_EL0.IDC but does not advertise it via CTR_EL0 :
84 * 1) It is safe if the system doesn't support IDC, as CPU anyway
85 * reports IDC = 0, consistent with the rest.
87 * 2) If the system has IDC, it is still safe as we trap CTR_EL0
88 * access on this CPU via the ARM64_HAS_CACHE_IDC capability.
90 * So, we need to make sure either the raw CTR_EL0 or the effective
91 * CTR_EL0 matches the system's copy to allow a secondary CPU to boot.
93 ctr_raw = read_cpuid_cachetype() & mask;
94 ctr_real = read_cpuid_effective_cachetype() & mask;
96 return (ctr_real != sys) && (ctr_raw != sys);
100 cpu_enable_trap_ctr_access(const struct arm64_cpu_capabilities *__unused)
102 u64 mask = arm64_ftr_reg_ctrel0.strict_mask;
104 /* Trap CTR_EL0 access on this CPU, only if it has a mismatch */
105 if ((read_cpuid_cachetype() & mask) !=
106 (arm64_ftr_reg_ctrel0.sys_val & mask))
107 sysreg_clear_set(sctlr_el1, SCTLR_EL1_UCT, 0);
110 atomic_t arm64_el2_vector_last_slot = ATOMIC_INIT(-1);
112 #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
113 #include <asm/mmu_context.h>
114 #include <asm/cacheflush.h>
116 DEFINE_PER_CPU_READ_MOSTLY(struct bp_hardening_data, bp_hardening_data);
118 #ifdef CONFIG_KVM_INDIRECT_VECTORS
119 extern char __smccc_workaround_1_smc_start[];
120 extern char __smccc_workaround_1_smc_end[];
122 static void __copy_hyp_vect_bpi(int slot, const char *hyp_vecs_start,
123 const char *hyp_vecs_end)
125 void *dst = lm_alias(__bp_harden_hyp_vecs_start + slot * SZ_2K);
128 for (i = 0; i < SZ_2K; i += 0x80)
129 memcpy(dst + i, hyp_vecs_start, hyp_vecs_end - hyp_vecs_start);
131 __flush_icache_range((uintptr_t)dst, (uintptr_t)dst + SZ_2K);
134 static void install_bp_hardening_cb(bp_hardening_cb_t fn,
135 const char *hyp_vecs_start,
136 const char *hyp_vecs_end)
138 static DEFINE_RAW_SPINLOCK(bp_lock);
142 * enable_smccc_arch_workaround_1() passes NULL for the hyp_vecs
143 * start/end if we're a guest. Skip the hyp-vectors work.
145 if (!hyp_vecs_start) {
146 __this_cpu_write(bp_hardening_data.fn, fn);
150 raw_spin_lock(&bp_lock);
151 for_each_possible_cpu(cpu) {
152 if (per_cpu(bp_hardening_data.fn, cpu) == fn) {
153 slot = per_cpu(bp_hardening_data.hyp_vectors_slot, cpu);
159 slot = atomic_inc_return(&arm64_el2_vector_last_slot);
160 BUG_ON(slot >= BP_HARDEN_EL2_SLOTS);
161 __copy_hyp_vect_bpi(slot, hyp_vecs_start, hyp_vecs_end);
164 __this_cpu_write(bp_hardening_data.hyp_vectors_slot, slot);
165 __this_cpu_write(bp_hardening_data.fn, fn);
166 raw_spin_unlock(&bp_lock);
169 #define __smccc_workaround_1_smc_start NULL
170 #define __smccc_workaround_1_smc_end NULL
172 static void install_bp_hardening_cb(bp_hardening_cb_t fn,
173 const char *hyp_vecs_start,
174 const char *hyp_vecs_end)
176 __this_cpu_write(bp_hardening_data.fn, fn);
178 #endif /* CONFIG_KVM_INDIRECT_VECTORS */
180 #include <uapi/linux/psci.h>
181 #include <linux/arm-smccc.h>
182 #include <linux/psci.h>
184 static void call_smc_arch_workaround_1(void)
186 arm_smccc_1_1_smc(ARM_SMCCC_ARCH_WORKAROUND_1, NULL);
189 static void call_hvc_arch_workaround_1(void)
191 arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_WORKAROUND_1, NULL);
194 static void qcom_link_stack_sanitization(void)
198 asm volatile("mov %0, x30 \n"
206 static bool __nospectre_v2;
207 static int __init parse_nospectre_v2(char *str)
209 __nospectre_v2 = true;
212 early_param("nospectre_v2", parse_nospectre_v2);
216 * 0: No workaround required
217 * 1: Workaround installed
219 static int detect_harden_bp_fw(void)
221 bp_hardening_cb_t cb;
222 void *smccc_start, *smccc_end;
223 struct arm_smccc_res res;
224 u32 midr = read_cpuid_id();
226 if (psci_ops.smccc_version == SMCCC_VERSION_1_0)
229 switch (psci_ops.conduit) {
230 case PSCI_CONDUIT_HVC:
231 arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
232 ARM_SMCCC_ARCH_WORKAROUND_1, &res);
233 switch ((int)res.a0) {
235 /* Firmware says we're just fine */
238 cb = call_hvc_arch_workaround_1;
239 /* This is a guest, no need to patch KVM vectors */
248 case PSCI_CONDUIT_SMC:
249 arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
250 ARM_SMCCC_ARCH_WORKAROUND_1, &res);
251 switch ((int)res.a0) {
253 /* Firmware says we're just fine */
256 cb = call_smc_arch_workaround_1;
257 smccc_start = __smccc_workaround_1_smc_start;
258 smccc_end = __smccc_workaround_1_smc_end;
269 if (((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR) ||
270 ((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR_V1))
271 cb = qcom_link_stack_sanitization;
273 install_bp_hardening_cb(cb, smccc_start, smccc_end);
277 #endif /* CONFIG_HARDEN_BRANCH_PREDICTOR */
279 #ifdef CONFIG_ARM64_SSBD
280 DEFINE_PER_CPU_READ_MOSTLY(u64, arm64_ssbd_callback_required);
282 int ssbd_state __read_mostly = ARM64_SSBD_KERNEL;
284 static const struct ssbd_options {
288 { "force-on", ARM64_SSBD_FORCE_ENABLE, },
289 { "force-off", ARM64_SSBD_FORCE_DISABLE, },
290 { "kernel", ARM64_SSBD_KERNEL, },
293 static int __init ssbd_cfg(char *buf)
300 for (i = 0; i < ARRAY_SIZE(ssbd_options); i++) {
301 int len = strlen(ssbd_options[i].str);
303 if (strncmp(buf, ssbd_options[i].str, len))
306 ssbd_state = ssbd_options[i].state;
312 early_param("ssbd", ssbd_cfg);
314 void __init arm64_update_smccc_conduit(struct alt_instr *alt,
315 __le32 *origptr, __le32 *updptr,
320 BUG_ON(nr_inst != 1);
322 switch (psci_ops.conduit) {
323 case PSCI_CONDUIT_HVC:
324 insn = aarch64_insn_get_hvc_value();
326 case PSCI_CONDUIT_SMC:
327 insn = aarch64_insn_get_smc_value();
333 *updptr = cpu_to_le32(insn);
336 void __init arm64_enable_wa2_handling(struct alt_instr *alt,
337 __le32 *origptr, __le32 *updptr,
340 BUG_ON(nr_inst != 1);
342 * Only allow mitigation on EL1 entry/exit and guest
343 * ARCH_WORKAROUND_2 handling if the SSBD state allows it to
346 if (arm64_get_ssbd_state() == ARM64_SSBD_KERNEL)
347 *updptr = cpu_to_le32(aarch64_insn_gen_nop());
350 void arm64_set_ssbd_mitigation(bool state)
352 if (this_cpu_has_cap(ARM64_SSBS)) {
354 asm volatile(SET_PSTATE_SSBS(0));
356 asm volatile(SET_PSTATE_SSBS(1));
360 switch (psci_ops.conduit) {
361 case PSCI_CONDUIT_HVC:
362 arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_WORKAROUND_2, state, NULL);
365 case PSCI_CONDUIT_SMC:
366 arm_smccc_1_1_smc(ARM_SMCCC_ARCH_WORKAROUND_2, state, NULL);
375 static bool has_ssbd_mitigation(const struct arm64_cpu_capabilities *entry,
378 struct arm_smccc_res res;
379 bool required = true;
382 WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
384 if (this_cpu_has_cap(ARM64_SSBS)) {
389 if (psci_ops.smccc_version == SMCCC_VERSION_1_0) {
390 ssbd_state = ARM64_SSBD_UNKNOWN;
394 switch (psci_ops.conduit) {
395 case PSCI_CONDUIT_HVC:
396 arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
397 ARM_SMCCC_ARCH_WORKAROUND_2, &res);
400 case PSCI_CONDUIT_SMC:
401 arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
402 ARM_SMCCC_ARCH_WORKAROUND_2, &res);
406 ssbd_state = ARM64_SSBD_UNKNOWN;
413 case SMCCC_RET_NOT_SUPPORTED:
414 ssbd_state = ARM64_SSBD_UNKNOWN;
417 case SMCCC_RET_NOT_REQUIRED:
418 pr_info_once("%s mitigation not required\n", entry->desc);
419 ssbd_state = ARM64_SSBD_MITIGATED;
422 case SMCCC_RET_SUCCESS:
426 case 1: /* Mitigation not required on this CPU */
435 switch (ssbd_state) {
436 case ARM64_SSBD_FORCE_DISABLE:
437 arm64_set_ssbd_mitigation(false);
441 case ARM64_SSBD_KERNEL:
443 __this_cpu_write(arm64_ssbd_callback_required, 1);
444 arm64_set_ssbd_mitigation(true);
448 case ARM64_SSBD_FORCE_ENABLE:
449 arm64_set_ssbd_mitigation(true);
459 switch (ssbd_state) {
460 case ARM64_SSBD_FORCE_DISABLE:
461 pr_info_once("%s disabled from command-line\n", entry->desc);
464 case ARM64_SSBD_FORCE_ENABLE:
465 pr_info_once("%s forced from command-line\n", entry->desc);
471 #endif /* CONFIG_ARM64_SSBD */
473 static void __maybe_unused
474 cpu_enable_cache_maint_trap(const struct arm64_cpu_capabilities *__unused)
476 sysreg_clear_set(sctlr_el1, SCTLR_EL1_UCI, 0);
479 #define CAP_MIDR_RANGE(model, v_min, r_min, v_max, r_max) \
480 .matches = is_affected_midr_range, \
481 .midr_range = MIDR_RANGE(model, v_min, r_min, v_max, r_max)
483 #define CAP_MIDR_ALL_VERSIONS(model) \
484 .matches = is_affected_midr_range, \
485 .midr_range = MIDR_ALL_VERSIONS(model)
487 #define MIDR_FIXED(rev, revidr_mask) \
488 .fixed_revs = (struct arm64_midr_revidr[]){{ (rev), (revidr_mask) }, {}}
490 #define ERRATA_MIDR_RANGE(model, v_min, r_min, v_max, r_max) \
491 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, \
492 CAP_MIDR_RANGE(model, v_min, r_min, v_max, r_max)
494 #define CAP_MIDR_RANGE_LIST(list) \
495 .matches = is_affected_midr_range_list, \
496 .midr_range_list = list
498 /* Errata affecting a range of revisions of given model variant */
499 #define ERRATA_MIDR_REV_RANGE(m, var, r_min, r_max) \
500 ERRATA_MIDR_RANGE(m, var, r_min, var, r_max)
502 /* Errata affecting a single variant/revision of a model */
503 #define ERRATA_MIDR_REV(model, var, rev) \
504 ERRATA_MIDR_RANGE(model, var, rev, var, rev)
506 /* Errata affecting all variants/revisions of a given a model */
507 #define ERRATA_MIDR_ALL_VERSIONS(model) \
508 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, \
509 CAP_MIDR_ALL_VERSIONS(model)
511 /* Errata affecting a list of midr ranges, with same work around */
512 #define ERRATA_MIDR_RANGE_LIST(midr_list) \
513 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, \
514 CAP_MIDR_RANGE_LIST(midr_list)
516 #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
518 * List of CPUs that do not need any Spectre-v2 mitigation at all.
520 static const struct midr_range spectre_v2_safe_list[] = {
521 MIDR_ALL_VERSIONS(MIDR_CORTEX_A35),
522 MIDR_ALL_VERSIONS(MIDR_CORTEX_A53),
523 MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
527 static bool __maybe_unused
528 check_branch_predictor(const struct arm64_cpu_capabilities *entry, int scope)
532 WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
534 /* If the CPU has CSV2 set, we're safe */
535 if (cpuid_feature_extract_unsigned_field(read_cpuid(ID_AA64PFR0_EL1),
536 ID_AA64PFR0_CSV2_SHIFT))
539 /* Alternatively, we have a list of unaffected CPUs */
540 if (is_midr_in_range_list(read_cpuid_id(), spectre_v2_safe_list))
543 /* Fallback to firmware detection */
544 need_wa = detect_harden_bp_fw();
549 if (__nospectre_v2) {
550 pr_info_once("spectrev2 mitigation disabled by command line option\n");
555 pr_warn_once("ARM_SMCCC_ARCH_WORKAROUND_1 missing from firmware\n");
557 return (need_wa > 0);
561 #ifdef CONFIG_HARDEN_EL2_VECTORS
563 static const struct midr_range arm64_harden_el2_vectors[] = {
564 MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
565 MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
571 #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
573 static const struct midr_range arm64_repeat_tlbi_cpus[] = {
574 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009
575 MIDR_RANGE(MIDR_QCOM_FALKOR_V1, 0, 0, 0, 0),
577 #ifdef CONFIG_ARM64_ERRATUM_1286807
578 MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 0),
585 #ifdef CONFIG_CAVIUM_ERRATUM_27456
586 const struct midr_range cavium_erratum_27456_cpus[] = {
587 /* Cavium ThunderX, T88 pass 1.x - 2.1 */
588 MIDR_RANGE(MIDR_THUNDERX, 0, 0, 1, 1),
589 /* Cavium ThunderX, T81 pass 1.0 */
590 MIDR_REV(MIDR_THUNDERX_81XX, 0, 0),
595 #ifdef CONFIG_CAVIUM_ERRATUM_30115
596 static const struct midr_range cavium_erratum_30115_cpus[] = {
597 /* Cavium ThunderX, T88 pass 1.x - 2.2 */
598 MIDR_RANGE(MIDR_THUNDERX, 0, 0, 1, 2),
599 /* Cavium ThunderX, T81 pass 1.0 - 1.2 */
600 MIDR_REV_RANGE(MIDR_THUNDERX_81XX, 0, 0, 2),
601 /* Cavium ThunderX, T83 pass 1.0 */
602 MIDR_REV(MIDR_THUNDERX_83XX, 0, 0),
607 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003
608 static const struct arm64_cpu_capabilities qcom_erratum_1003_list[] = {
610 ERRATA_MIDR_REV(MIDR_QCOM_FALKOR_V1, 0, 0),
613 .midr_range.model = MIDR_QCOM_KRYO,
614 .matches = is_kryo_midr,
620 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
621 static const struct midr_range workaround_clean_cache[] = {
622 #if defined(CONFIG_ARM64_ERRATUM_826319) || \
623 defined(CONFIG_ARM64_ERRATUM_827319) || \
624 defined(CONFIG_ARM64_ERRATUM_824069)
625 /* Cortex-A53 r0p[012]: ARM errata 826319, 827319, 824069 */
626 MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 2),
628 #ifdef CONFIG_ARM64_ERRATUM_819472
629 /* Cortex-A53 r0p[01] : ARM errata 819472 */
630 MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 1),
636 const struct arm64_cpu_capabilities arm64_errata[] = {
637 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
639 .desc = "ARM errata 826319, 827319, 824069, 819472",
640 .capability = ARM64_WORKAROUND_CLEAN_CACHE,
641 ERRATA_MIDR_RANGE_LIST(workaround_clean_cache),
642 .cpu_enable = cpu_enable_cache_maint_trap,
645 #ifdef CONFIG_ARM64_ERRATUM_832075
647 /* Cortex-A57 r0p0 - r1p2 */
648 .desc = "ARM erratum 832075",
649 .capability = ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE,
650 ERRATA_MIDR_RANGE(MIDR_CORTEX_A57,
655 #ifdef CONFIG_ARM64_ERRATUM_834220
657 /* Cortex-A57 r0p0 - r1p2 */
658 .desc = "ARM erratum 834220",
659 .capability = ARM64_WORKAROUND_834220,
660 ERRATA_MIDR_RANGE(MIDR_CORTEX_A57,
665 #ifdef CONFIG_ARM64_ERRATUM_843419
667 /* Cortex-A53 r0p[01234] */
668 .desc = "ARM erratum 843419",
669 .capability = ARM64_WORKAROUND_843419,
670 ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 4),
671 MIDR_FIXED(0x4, BIT(8)),
674 #ifdef CONFIG_ARM64_ERRATUM_845719
676 /* Cortex-A53 r0p[01234] */
677 .desc = "ARM erratum 845719",
678 .capability = ARM64_WORKAROUND_845719,
679 ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A53, 0, 0, 4),
682 #ifdef CONFIG_CAVIUM_ERRATUM_23154
684 /* Cavium ThunderX, pass 1.x */
685 .desc = "Cavium erratum 23154",
686 .capability = ARM64_WORKAROUND_CAVIUM_23154,
687 ERRATA_MIDR_REV_RANGE(MIDR_THUNDERX, 0, 0, 1),
690 #ifdef CONFIG_CAVIUM_ERRATUM_27456
692 .desc = "Cavium erratum 27456",
693 .capability = ARM64_WORKAROUND_CAVIUM_27456,
694 ERRATA_MIDR_RANGE_LIST(cavium_erratum_27456_cpus),
697 #ifdef CONFIG_CAVIUM_ERRATUM_30115
699 .desc = "Cavium erratum 30115",
700 .capability = ARM64_WORKAROUND_CAVIUM_30115,
701 ERRATA_MIDR_RANGE_LIST(cavium_erratum_30115_cpus),
705 .desc = "Mismatched cache type (CTR_EL0)",
706 .capability = ARM64_MISMATCHED_CACHE_TYPE,
707 .matches = has_mismatched_cache_type,
708 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
709 .cpu_enable = cpu_enable_trap_ctr_access,
711 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003
713 .desc = "Qualcomm Technologies Falkor/Kryo erratum 1003",
714 .capability = ARM64_WORKAROUND_QCOM_FALKOR_E1003,
715 .matches = cpucap_multi_entry_cap_matches,
716 .match_list = qcom_erratum_1003_list,
719 #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
721 .desc = "Qualcomm erratum 1009, ARM erratum 1286807",
722 .capability = ARM64_WORKAROUND_REPEAT_TLBI,
723 ERRATA_MIDR_RANGE_LIST(arm64_repeat_tlbi_cpus),
726 #ifdef CONFIG_ARM64_ERRATUM_858921
728 /* Cortex-A73 all versions */
729 .desc = "ARM erratum 858921",
730 .capability = ARM64_WORKAROUND_858921,
731 ERRATA_MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
734 #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
736 .capability = ARM64_HARDEN_BRANCH_PREDICTOR,
737 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
738 .matches = check_branch_predictor,
741 #ifdef CONFIG_HARDEN_EL2_VECTORS
743 .desc = "EL2 vector hardening",
744 .capability = ARM64_HARDEN_EL2_VECTORS,
745 ERRATA_MIDR_RANGE_LIST(arm64_harden_el2_vectors),
748 #ifdef CONFIG_ARM64_SSBD
750 .desc = "Speculative Store Bypass Disable",
751 .capability = ARM64_SSBD,
752 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
753 .matches = has_ssbd_mitigation,
756 #ifdef CONFIG_ARM64_ERRATUM_1188873
758 /* Cortex-A76 r0p0 to r2p0 */
759 .desc = "ARM erratum 1188873",
760 .capability = ARM64_WORKAROUND_1188873,
761 ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 2, 0),
764 #ifdef CONFIG_ARM64_ERRATUM_1165522
766 /* Cortex-A76 r0p0 to r2p0 */
767 .desc = "ARM erratum 1165522",
768 .capability = ARM64_WORKAROUND_1165522,
769 ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 2, 0),
776 ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr,
779 return sprintf(buf, "Mitigation: __user pointer sanitization\n");