fix(fvp): avoid stack usage in check_cpupwrctrl_el1_is_available()
The function is called from assembly language before the stack is set
up. This fix prevents accessing unmapped memory at 0xffffffff_ffffffxx
by not storing the midr_no_cpupwrctl array on the stack.
Change-Id: I920e32c34bddf86a1dbf05b7115026413483b3c1
Signed-off-by: Linus Nielsen <linus@haxx.se>
diff --git a/plat/arm/board/fvp/fvp_cpu_pwr.c b/plat/arm/board/fvp/fvp_cpu_pwr.c
index f2771c2..a294534 100644
--- a/plat/arm/board/fvp/fvp_cpu_pwr.c
+++ b/plat/arm/board/fvp/fvp_cpu_pwr.c
@@ -20,8 +20,8 @@
bool check_cpupwrctrl_el1_is_available(void)
{
- /* Poupulate list of CPU midr that doesn't support CPUPWRCTL_EL1 */
- const unsigned int midr_no_cpupwrctl[] = {
+ /* Populate list of CPU midr that doesn't support CPUPWRCTL_EL1 */
+ static const unsigned int midr_no_cpupwrctl[] = {
BASE_AEM_MIDR,
CORTEX_A35_MIDR,
CORTEX_A53_MIDR,