Skip to contentSkip to conversation

arm-bsp/corstone1000: support larger secure boot variables

PATCH New Oscar Belshaw 1 participant 3 messages Dec 1

lore
Share & tools
lore
#0 lore raw

cover arm-bsp/corstone1000: support larger secure boot variables

This series enables Corstone1000 to handle the larger authenticated db/dbx updates exercised by the BBSR tests in ACS 3.1.2. The stored signature database is 6776 bytes, exceeding the existing 3500-byte protected storage limit.

The first patch keeps the OP-TEE components aligned on the existing 4.10 baseline. The second increases the MM communication buffer to 16 KiB consistently across U-Boot, libts and the SMM gateway, and raises the stored variable and TF-M protected storage limits to 8 KiB.

Testing: the SIE test suite was run in yocto-ci. VariableUpdates completed with 10 passes and 0 errors, including the two previously failing assertions. Other SIE failures are being tracked separately.

Ahmed Ismail (1):
arm-bsp/corstone1000: keep OP-TEE components on 4.10

Oscar Belshaw (1):
arm-bsp/corstone1000: support larger secure boot variables

 .../conf/machine/include/corstone1000.inc     |  5 ++-
 ...000-enlarge-protected-storage-assets.patch | 32 ++++++++++++++
 .../trusted-firmware-m-corstone1000.inc       |  1 +
 .../u-boot/u-boot-corstone1000.inc            |  1 +
 ...1000-enlarge-MM-communication-buffer.patch | 42 +++++++++++++++++++
 .../trusted-services/libts_%.bbappend         |  4 +-
 .../ts-sp-smm-gateway_%.bbappend              |  5 +++
 7 files changed, 87 insertions(+), 3 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0015-platform-corstone1000-enlarge-protected-storage-assets.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0054-configs-corstone1000-enlarge-MM-communication-buffer.patch

base-commit: 3aa2fc50b7573ef367d0bb356140727762279e0e

Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 arm-bsp/corstone1000: keep OP-TEE components on 4.10

From: Ahmed Ismail <[email protected]>

Pin optee-test, optee-os-tadevkit and optee-examples to 4.10 to align with the existing optee-os and optee-client baseline.

---
 meta-arm-bsp/conf/machine/include/corstone1000.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta-arm-bsp/conf/machine/include/corstone1000.inc +4 -1
index 6a4dc6fbd0..e2aceff27b 100644
@@ -16,9 +16,12 @@ PREFERRED_VERSION_tf-a-tests ?= "2.15.%"
 TFA_BL2_BINARY = "bl2-corstone1000.bin"
 TFA_FIP_BINARY = "fip-corstone1000.bin"
 
-# optee
+# Keep the OP-TEE components aligned with the supported OS version.
 PREFERRED_VERSION_optee-os ?= "4.10.%"
 PREFERRED_VERSION_optee-client ?= "4.10.%"
+PREFERRED_VERSION_optee-os-tadevkit ?= "4.10.%"
+PREFERRED_VERSION_optee-test ?= "4.10.%"
+PREFERRED_VERSION_optee-examples ?= "4.10.%"
 
 # Trusted Services
 TS_PLATFORM = "arm/corstone1000"
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/2 arm-bsp/corstone1000: support larger secure boot variables

In reply to Oscar Belshaw

Increase the MM buffer to 16 KiB in both U-Boot defconfigs, SMM gateway and libts. Move its base to 0x81FFC000 to preserve the end address at 0x82000000. Use the existing UEFI_MAX_VARIABLE_SIZE CMake option to allow 8 KiB stored variables and match that limit in TF-M protected storage. Increase the crypto iovec buffer for a complete asset and framing.

The new BBSR authenticated db/dbx updates introduced in acs 3.1.2 require storing a 6776-byte signature database, which exceeds CS1K's current protected-storage limit of 3500 bytes. Increased this to 8KiB to accommodate this change.

---
 ...000-enlarge-protected-storage-assets.patch | 32 ++++++++++++++
 .../trusted-firmware-m-corstone1000.inc       |  1 +
 .../u-boot/u-boot-corstone1000.inc            |  1 +
 ...1000-enlarge-MM-communication-buffer.patch | 42 +++++++++++++++++++
 .../trusted-services/libts_%.bbappend         |  4 +-
 .../ts-sp-smm-gateway_%.bbappend              |  5 +++
 6 files changed, 83 insertions(+), 2 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0015-platform-corstone1000-enlarge-protected-storage-assets.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0054-configs-corstone1000-enlarge-MM-communication-buffer.patch
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0015-platform-corstone1000-enlarge-protected-storage-assets.patch new file +32 -0
new file mode 100644
index 0000000000..1982bce495
@@ -0,0 +1,32 @@
+From: Oscar Belshaw <[email protected]>
+Date: Tue, 17 Nov 2026 15:00:00 +0000
+Subject: [PATCH] platform: corstone1000: enlarge protected storage assets
+
+The BBSR signed db/dbx updates store a 6776-byte signature database,
+which exceeds the 3500-byte protected storage asset limit. Match the
+SMM gateway limit of 8 KiB and allow crypto input/output vectors for
+encrypting and decrypting an entire asset, including framing overhead.
+Keep the existing isolation level and security partitions enabled.
+
+Upstream-Status: Pending
+Signed-off-by: Oscar Belshaw <[email protected]>
+---
+diff --git a/platform/ext/target/arm/corstone1000/config_tfm_target.h b/platform/ext/target/arm/corstone1000/config_tfm_target.h
+--- a/platform/ext/target/arm/corstone1000/config_tfm_target.h
++++ b/platform/ext/target/arm/corstone1000/config_tfm_target.h
+@@ -27,13 +27,13 @@
+ #define ITS_MAX_ASSET_SIZE   2048
+
+ /* The maximum asset size to be stored in the Protected Storage */
+-#define PS_MAX_ASSET_SIZE   3500
++#define PS_MAX_ASSET_SIZE   8192
+
+ /* This is needed to be able to process the EFI variables during PS writes. */
+ #define CRYPTO_ENGINE_BUF_SIZE 0x5000
+
+ /* This is also has to be increased to fit the EFI variables into the iovecs. */
+-#define CRYPTO_IOVEC_BUFFER_SIZE    7200
++#define CRYPTO_IOVEC_BUFFER_SIZE    (2 * PS_MAX_ASSET_SIZE + 256)
+
+ /* The Mailbox partition is used as an NS Agent so its stack size is used to
+  * determine the PSP and PSPLIM during the SFN backend initialization. It has to
meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc +1 -0
index a12435fd9c..df42d60671 100644
@@ -49,6 +49,7 @@ SRC_URI:append:corstone1000 = " \
     file://0012-plat-cs1k-Add-flash-erase-protection.patch \
     file://0013-platform-corstone1000-Increase-FIP-partition-size.patch \
     file://0014-platform-corstone1000-keep-CM-during-secure-debug.patch \
+    file://0015-platform-corstone1000-enlarge-protected-storage-assets.patch \
     "
 
 FILESEXTRAPATHS:prepend:corstone1000-mps3 := "${THISDIR}/files/corstone1000/psa-adac:"
meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc +1 -0
index f9251c96d5..7c5d4085f0 100644
@@ -101,6 +101,7 @@ SRC_URI:append = " \
     file://0051-doc-bootefi-note-two-phase-runtime-variables-selftes.patch \
     file://0052-efi_loader-align-FF-A-cache-maintenance-with-runtime.patch \
     file://0053-corstone1000-a320-enable-bootefi-selftest.patch \
+    file://0054-configs-corstone1000-enlarge-MM-communication-buffer.patch \
 "
 
 uboot_configure_config:append() {
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0054-configs-corstone1000-enlarge-MM-communication-buffer.patch new file +42 -0

42 lines not on this page · raw message

meta-arm-bsp/recipes-security/trusted-services/libts_%.bbappend +2 -2
index 7871b1e5e5..e708f8c4f8 100644
@@ -1,7 +1,7 @@
 require ts-arm-platforms.inc
 
-EXTRA_OECMAKE:append:corstone1000 = "-DMM_COMM_BUFFER_ADDRESS=0x81FFF000 \
-                                     -DMM_COMM_BUFFER_SIZE=0x1000 \
+EXTRA_OECMAKE:append:corstone1000 = "-DMM_COMM_BUFFER_ADDRESS=0x81FFC000 \
+                                     -DMM_COMM_BUFFER_SIZE=0x4000 \
                                     "
 
 EXTRA_OECMAKE:append:fvp-base = " -DMM_COMM_BUFFER_ADDRESS=0x81000000 \
meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend +5 -0
index b4de372555..f7087992af 100644
@@ -1,6 +1,11 @@
 require ts-arm-platforms.inc
 
+# Keep the MM region in sync with U-Boot and libts. The stored database
+# excludes the authentication descriptor carried in the larger MM request.
 EXTRA_OECMAKE:append:corstone1000 = " -DSMM_GATEWAY_MAX_UEFI_VARIABLES=60 \
+    -DUEFI_MAX_VARIABLE_SIZE=8192 \
+    -DMM_COMM_BUFFER_ADDRESS="0x00000000 0x81FFC000" \
+    -DMM_COMM_BUFFER_PAGE_COUNT=4 \
     "
 
 EXTRA_OECMAKE:append:fvp-base = " -DMM_COMM_BUFFER_ADDRESS="0x00000000 0x81000000" \
Signature · 1 line
2.43.0