diff options
Diffstat (limited to 'include/lib/el3_runtime/aarch64/context.h')
-rw-r--r-- | include/lib/el3_runtime/aarch64/context.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/lib/el3_runtime/aarch64/context.h b/include/lib/el3_runtime/aarch64/context.h index 5f6bdc97..5b608e13 100644 --- a/include/lib/el3_runtime/aarch64/context.h +++ b/include/lib/el3_runtime/aarch64/context.h @@ -124,8 +124,8 @@ * Constants that allow assembler code to access members of and the 'fp_regs' * structure at their correct offsets. ******************************************************************************/ -#if CTX_INCLUDE_FPREGS #define CTX_FPREGS_OFFSET (CTX_SYSREGS_OFFSET + CTX_SYSREGS_END) +#if CTX_INCLUDE_FPREGS #define CTX_FP_Q0 U(0x0) #define CTX_FP_Q1 U(0x10) #define CTX_FP_Q2 U(0x20) @@ -166,8 +166,14 @@ #else #define CTX_FPREGS_END U(0x210) /* Align to the next 16 byte boundary */ #endif +#else +#define CTX_FPREGS_END U(0) #endif +#define CTX_CVE_2018_3639_OFFSET (CTX_FPREGS_OFFSET + CTX_FPREGS_END) +#define CTX_CVE_2018_3639_DISABLE U(0) +#define CTX_CVE_2018_3639_END U(0x10) /* Align to the next 16 byte boundary */ + #ifndef __ASSEMBLY__ #include <cassert.h> @@ -191,6 +197,7 @@ #define CTX_FPREG_ALL (CTX_FPREGS_END >> DWORD_SHIFT) #endif #define CTX_EL3STATE_ALL (CTX_EL3STATE_END >> DWORD_SHIFT) +#define CTX_CVE_2018_3639_ALL (CTX_CVE_2018_3639_END >> DWORD_SHIFT) /* * AArch64 general purpose register context structure. Usually x0-x18, @@ -223,6 +230,9 @@ DEFINE_REG_STRUCT(fp_regs, CTX_FPREG_ALL); */ DEFINE_REG_STRUCT(el3_state, CTX_EL3STATE_ALL); +/* Function pointer used by CVE-2018-3639 dynamic mitigation */ +DEFINE_REG_STRUCT(cve_2018_3639, CTX_CVE_2018_3639_ALL); + /* * Macros to access members of any of the above structures using their * offsets @@ -247,6 +257,7 @@ typedef struct cpu_context { #if CTX_INCLUDE_FPREGS fp_regs_t fpregs_ctx; #endif + cve_2018_3639_t cve_2018_3639_ctx; } cpu_context_t; /* Macros to access members of the 'cpu_context_t' structure */ @@ -272,6 +283,8 @@ CASSERT(CTX_FPREGS_OFFSET == __builtin_offsetof(cpu_context_t, fpregs_ctx), \ #endif CASSERT(CTX_EL3STATE_OFFSET == __builtin_offsetof(cpu_context_t, el3state_ctx), \ assert_core_context_el3state_offset_mismatch); +CASSERT(CTX_CVE_2018_3639_OFFSET == __builtin_offsetof(cpu_context_t, cve_2018_3639_ctx), \ + assert_core_context_cve_2018_3639_offset_mismatch); /* * Helper macro to set the general purpose registers that correspond to |