1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-06-05 14:30:10 +00:00

arm-bsp/optee-os: cherry pick fixes from upstream integration branch

These changes are to fix missing error check during sp init
and add support for defining memory regions

Change-Id: I381ff9805288590809471494bdff5e7f62232f7c
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Vishnu Banavath
2021-12-11 10:02:23 +00:00
committed by Jon Mason
parent 56d2e4e79c
commit 13e4bd913b
2 changed files with 42 additions and 1 deletions
@@ -0,0 +1,40 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From 4617f85b70c7e4206b244f3eaffdc62ac3744a17 Mon Sep 17 00:00:00 2001
From: Jelle Sels <jelle.sels@arm.com>
Date: Mon, 10 May 2021 11:37:23 +0200
Subject: [PATCH] Fix: add missing error check during SP init
Error checking during SP initialization (sp_init_uuid()) was lacking.
As a result an out of CORE HEAP situation resulted in a panic. This was
due to lack of memory in the inflate() function of zlib.
Signed-off-by: Jelle Sels <jelle.sels@arm.com>
Change-Id: I287e2e2dd507feb45991b32ed264b3b6ad6fcd39
diff --git a/core/arch/arm/kernel/sp.c b/core/arch/arm/kernel/sp.c
index 4acbc2e2..23532a01 100644
--- a/core/arch/arm/kernel/sp.c
+++ b/core/arch/arm/kernel/sp.c
@@ -383,10 +383,14 @@ static TEE_Result __attribute__((unused)) sp_init_uuid(const TEE_UUID *uuid)
cancel_req_to,
&param);
- args.a0 = sp_get_session(sess->id)->sp_regs.x[0];
- sp_thread(sess->id, FFA_NW_ID, &args);
+ if (res == TEE_SUCCESS) {
+ args.a0 = sp_get_session(sess->id)->sp_regs.x[0];
+ sp_thread(sess->id, FFA_NW_ID, &args);
- thread_spmc_msg_recv(&args, sess->id);
+ thread_spmc_msg_recv(&args, sess->id);
+ } else {
+ EMSG("SP initialization failed, try increasing CFG_CORE_HEAP_SIZE");
+ }
return res;
}
--
2.25.1
@@ -11,7 +11,8 @@ SRC_URI:append = " \
file://0002-plat-corstone1000-reserve-3MB-CVM-memory-for-optee.patch \
file://0003-plat-corstone1000-add-a-rule-in-Makefile-to-SP_MAKEF.patch \
file://0004-plat-corstone1000-increase-OPTEE-core-heap-size.patch \
"
file://0005-Fix-add-missing-error-check-during-SP-init.patch \
"
COMPATIBLE_MACHINE = "corstone1000"