瀏覽代碼

arm-bsp/trusted-services: corstone1000: increase comm buffer size

The increased EFI variable metadata need bigger buffer so it can
be transfered to the Secure Enclave without memory overflow
issues. The heap and buffer sizes had to be aligned with the.

Signed-off-by: Bence Balogh <bence.balogh@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Bence Balogh 1 年之前
父節點
當前提交
a9a3c53ea6

+ 37 - 0
meta-arm-bsp/recipes-security/trusted-services/corstone1000/0018-Change-RSS_COMMS-cmake-variables-to-cahce-vars.patch

@@ -0,0 +1,37 @@
+From e8b577d02d1d4ed2492bb0b6c3a5bb7d2656f13a Mon Sep 17 00:00:00 2001
+From: Bence Balogh <bence.balogh@arm.com>
+Date: Fri, 17 May 2024 13:21:07 +0200
+Subject: [PATCH] Change RSS_COMMS cmake variables to cahce vars
+
+This way they can be set externally as well for the corstone1000
+platform.
+
+Signed-off-by: Bence Balogh <bence.balogh@arm.com>
+Upstream-Status: Pending
+---
+ platform/providers/arm/corstone1000/platform.cmake | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/platform/providers/arm/corstone1000/platform.cmake b/platform/providers/arm/corstone1000/platform.cmake
+index 16139c80e..82ac14f0b 100644
+--- a/platform/providers/arm/corstone1000/platform.cmake
++++ b/platform/providers/arm/corstone1000/platform.cmake
+@@ -9,11 +9,13 @@
+ set(SMM_GATEWAY_MAX_UEFI_VARIABLES 80 CACHE STRING "Maximum UEFI variable count")
+ set(SMM_RPC_CALLER_SESSION_SHARED_MEMORY_SIZE 4*4096 CACHE STRING "RPC caller buffer size in SMMGW")
+ set(SMM_SP_HEAP_SIZE 80*1024 CACHE STRING "SMM gateway SP heap size")
++set(PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE 0x43C0 CACHE STRING "Size of the RSS_COMMS_PAYLOAD buffer")
++set(COMMS_MHU_MSG_SIZE 0x4500 CACHE STRING "Max message size that can be transfered via MHU")
+ 
+ target_compile_definitions(${TGT} PRIVATE
+ 	SMM_VARIABLE_INDEX_STORAGE_UID=0x787
+-	PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE=0x2080
+-	COMMS_MHU_MSG_SIZE=0x3500
++	PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE=${PLAT_RSS_COMMS_PAYLOAD_MAX_SIZE}
++	COMMS_MHU_MSG_SIZE=${COMMS_MHU_MSG_SIZE}
+ )
+ 
+ get_property(_platform_driver_dependencies TARGET ${TGT}
+-- 
+2.25.1
+

+ 1 - 0
meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc

@@ -19,6 +19,7 @@ SRC_URI:append:corstone1000  = " \
     file://0015-Add-timestamp-validation-for-uefi-variables.patch \
     file://0016-Isolate-common-uefi-variable-authentication-steps.patch \
     file://0017-Implement-Private-Authenticated-Variable-verificatio.patch \
+    file://0018-Change-RSS_COMMS-cmake-variables-to-cahce-vars.patch \
     "
 
 

+ 1 - 0
meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend

@@ -2,6 +2,7 @@ require ts-arm-platforms.inc
 
 EXTRA_OECMAKE:append:corstone1000 = " -DMM_COMM_BUFFER_ADDRESS="0x00000000 0x81FFF000" \
     -DMM_COMM_BUFFER_PAGE_COUNT="1" \
+    -DSP_HEAP_SIZE=70*1024 \
     "
 
 # Proxy is pointless on fvp-base as there is no dedicated security subsystem. It could be