xref: /linux/arch/arm/include/asm/spectre.h (revision cdd5b5a9761fd66d17586e4f4ba6588c70e640ea)
19dd78194SRussell King (Oracle) /* SPDX-License-Identifier: GPL-2.0-only */
29dd78194SRussell King (Oracle) 
39dd78194SRussell King (Oracle) #ifndef __ASM_SPECTRE_H
49dd78194SRussell King (Oracle) #define __ASM_SPECTRE_H
59dd78194SRussell King (Oracle) 
69dd78194SRussell King (Oracle) enum {
79dd78194SRussell King (Oracle) 	SPECTRE_UNAFFECTED,
89dd78194SRussell King (Oracle) 	SPECTRE_MITIGATED,
99dd78194SRussell King (Oracle) 	SPECTRE_VULNERABLE,
109dd78194SRussell King (Oracle) };
119dd78194SRussell King (Oracle) 
129dd78194SRussell King (Oracle) enum {
139dd78194SRussell King (Oracle) 	__SPECTRE_V2_METHOD_BPIALL,
149dd78194SRussell King (Oracle) 	__SPECTRE_V2_METHOD_ICIALLU,
159dd78194SRussell King (Oracle) 	__SPECTRE_V2_METHOD_SMC,
169dd78194SRussell King (Oracle) 	__SPECTRE_V2_METHOD_HVC,
17b9baf5c8SRussell King (Oracle) 	__SPECTRE_V2_METHOD_LOOP8,
189dd78194SRussell King (Oracle) };
199dd78194SRussell King (Oracle) 
209dd78194SRussell King (Oracle) enum {
219dd78194SRussell King (Oracle) 	SPECTRE_V2_METHOD_BPIALL = BIT(__SPECTRE_V2_METHOD_BPIALL),
229dd78194SRussell King (Oracle) 	SPECTRE_V2_METHOD_ICIALLU = BIT(__SPECTRE_V2_METHOD_ICIALLU),
239dd78194SRussell King (Oracle) 	SPECTRE_V2_METHOD_SMC = BIT(__SPECTRE_V2_METHOD_SMC),
249dd78194SRussell King (Oracle) 	SPECTRE_V2_METHOD_HVC = BIT(__SPECTRE_V2_METHOD_HVC),
25b9baf5c8SRussell King (Oracle) 	SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
269dd78194SRussell King (Oracle) };
279dd78194SRussell King (Oracle) 
2868453767SRandy Dunlap #ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
299dd78194SRussell King (Oracle) void spectre_v2_update_state(unsigned int state, unsigned int methods);
3068453767SRandy Dunlap #else
spectre_v2_update_state(unsigned int state,unsigned int methods)3168453767SRandy Dunlap static inline void spectre_v2_update_state(unsigned int state,
3268453767SRandy Dunlap 					   unsigned int methods)
3368453767SRandy Dunlap {}
3468453767SRandy Dunlap #endif
359dd78194SRussell King (Oracle) 
36b9baf5c8SRussell King (Oracle) int spectre_bhb_update_vectors(unsigned int method);
37b9baf5c8SRussell King (Oracle) 
38*ae1f8d79SArnd Bergmann void cpu_v7_ca8_ibe(void);
39*ae1f8d79SArnd Bergmann void cpu_v7_ca15_ibe(void);
40*ae1f8d79SArnd Bergmann void cpu_v7_bugs_init(void);
41*ae1f8d79SArnd Bergmann 
429dd78194SRussell King (Oracle) #endif
43