18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci#ifndef __ASM_SPECTRE_H
48c2ecf20Sopenharmony_ci#define __ASM_SPECTRE_H
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_cienum {
78c2ecf20Sopenharmony_ci	SPECTRE_UNAFFECTED,
88c2ecf20Sopenharmony_ci	SPECTRE_MITIGATED,
98c2ecf20Sopenharmony_ci	SPECTRE_VULNERABLE,
108c2ecf20Sopenharmony_ci};
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cienum {
138c2ecf20Sopenharmony_ci	__SPECTRE_V2_METHOD_BPIALL,
148c2ecf20Sopenharmony_ci	__SPECTRE_V2_METHOD_ICIALLU,
158c2ecf20Sopenharmony_ci	__SPECTRE_V2_METHOD_SMC,
168c2ecf20Sopenharmony_ci	__SPECTRE_V2_METHOD_HVC,
178c2ecf20Sopenharmony_ci	__SPECTRE_V2_METHOD_LOOP8,
188c2ecf20Sopenharmony_ci};
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cienum {
218c2ecf20Sopenharmony_ci	SPECTRE_V2_METHOD_BPIALL = BIT(__SPECTRE_V2_METHOD_BPIALL),
228c2ecf20Sopenharmony_ci	SPECTRE_V2_METHOD_ICIALLU = BIT(__SPECTRE_V2_METHOD_ICIALLU),
238c2ecf20Sopenharmony_ci	SPECTRE_V2_METHOD_SMC = BIT(__SPECTRE_V2_METHOD_SMC),
248c2ecf20Sopenharmony_ci	SPECTRE_V2_METHOD_HVC = BIT(__SPECTRE_V2_METHOD_HVC),
258c2ecf20Sopenharmony_ci	SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
268c2ecf20Sopenharmony_ci};
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
298c2ecf20Sopenharmony_civoid spectre_v2_update_state(unsigned int state, unsigned int methods);
308c2ecf20Sopenharmony_ci#else
318c2ecf20Sopenharmony_cistatic inline void spectre_v2_update_state(unsigned int state,
328c2ecf20Sopenharmony_ci					   unsigned int methods)
338c2ecf20Sopenharmony_ci{}
348c2ecf20Sopenharmony_ci#endif
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciint spectre_bhb_update_vectors(unsigned int method);
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#endif
39