From patchwork Tue Dec 1 10:00:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Belshaw X-Patchwork-Id: 106777 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.7687.1796119261487243593 for ; Tue, 01 Dec 2026 02:01:01 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=vTOJsNJN; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: oscar.belshaw@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1CB49176B for ; Tue, 1 Dec 2026 02:00:58 -0800 (PST) Received: from e142471.cambridge.arm.com (e142471.arm.com [10.2.210.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FDB83F7D8 for ; Tue, 1 Dec 2026 02:01:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796119260; bh=MXW6sPjgi/EjuQOcaCenL86TjebSUemOiBgK0INP+Ug=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vTOJsNJNS1dOcZrsDBRZAtBqR39sUkr+z65ualncgkjlyYa7B2/fFzt5K9f+IPJji XUoG/3kRwkYvlfRDj7cA2zQhTYViwdxwR8ToJbpEIewLFQsUp7+J61bgXnDkk76ggR 2v1yPtOfpat/Rf9LwjFs5M01nLmUvf9IyMa0dgak= From: Oscar Belshaw To: meta-arm@lists.yoctoproject.org Subject: [PATCH 2/2] arm-bsp/corstone1000: support larger secure boot variables Date: Tue, 1 Dec 2026 10:00:57 +0000 Message-ID: <20261201100057.136741-3-Oscar.Belshaw@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261201100057.136741-1-Oscar.Belshaw@arm.com> References: <20261201100057.136741-1-Oscar.Belshaw@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 10:01:10 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/7228 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. Signed-off-by: Oscar Belshaw --- ...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 diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0015-platform-corstone1000-enlarge-protected-storage-assets.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0015-platform-corstone1000-enlarge-protected-storage-assets.patch new file mode 100644 index 0000000000..1982bce495 --- /dev/null +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0015-platform-corstone1000-enlarge-protected-storage-assets.patch @@ -0,0 +1,32 @@ +From: Oscar Belshaw +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 +--- +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 diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc index a12435fd9c..df42d60671 100644 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc @@ -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:" diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc index f9251c96d5..7c5d4085f0 100644 --- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc +++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc @@ -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() { diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0054-configs-corstone1000-enlarge-MM-communication-buffer.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0054-configs-corstone1000-enlarge-MM-communication-buffer.patch new file mode 100644 index 0000000000..bd61152b51 --- /dev/null +++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0054-configs-corstone1000-enlarge-MM-communication-buffer.patch @@ -0,0 +1,42 @@ +From: Oscar Belshaw +Date: Tue, 17 Nov 2026 15:00:00 +0000 +Subject: [PATCH] configs: corstone1000: enlarge MM communication buffer + +The BBSR signed db/dbx updates contain 7982 bytes, before MM request +headers. Reserve 16 KiB for the complete authenticated request and move +the base down so the buffer still ends at 0x82000000. Keep this region +in sync with the Trusted Services SMM gateway and libts. + +Upstream-Status: Pending +Signed-off-by: Oscar Belshaw +--- +diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig +--- a/configs/corstone1000_defconfig ++++ b/configs/corstone1000_defconfig +@@ -16,9 +16,9 @@ + # CONFIG_EFI_DEBUG_SUPPORT is not set + CONFIG_EFI_SET_TIME=y + CONFIG_EFI_MM_COMM_TEE=y +-CONFIG_FFA_SHARED_MM_BUF_SIZE=4096 ++CONFIG_FFA_SHARED_MM_BUF_SIZE=16384 + CONFIG_FFA_SHARED_MM_BUF_OFFSET=0 +-CONFIG_FFA_SHARED_MM_BUF_ADDR=0x81FFF000 ++CONFIG_FFA_SHARED_MM_BUF_ADDR=0x81FFC000 + CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y + CONFIG_EFI_CAPSULE_ON_DISK=y + CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y +diff --git a/configs/corstone1000-a320_defconfig b/configs/corstone1000-a320_defconfig +--- a/configs/corstone1000-a320_defconfig ++++ b/configs/corstone1000-a320_defconfig +@@ -16,9 +16,9 @@ + # CONFIG_EFI_DEBUG_SUPPORT is not set + CONFIG_EFI_SET_TIME=y + CONFIG_EFI_MM_COMM_TEE=y +-CONFIG_FFA_SHARED_MM_BUF_SIZE=4096 ++CONFIG_FFA_SHARED_MM_BUF_SIZE=16384 + CONFIG_FFA_SHARED_MM_BUF_OFFSET=0 +-CONFIG_FFA_SHARED_MM_BUF_ADDR=0x81FFF000 ++CONFIG_FFA_SHARED_MM_BUF_ADDR=0x81FFC000 + CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y + CONFIG_EFI_CAPSULE_ON_DISK=y + CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y diff --git a/meta-arm-bsp/recipes-security/trusted-services/libts_%.bbappend b/meta-arm-bsp/recipes-security/trusted-services/libts_%.bbappend index 7871b1e5e5..e708f8c4f8 100644 --- a/meta-arm-bsp/recipes-security/trusted-services/libts_%.bbappend +++ b/meta-arm-bsp/recipes-security/trusted-services/libts_%.bbappend @@ -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 \ diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend b/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend index b4de372555..f7087992af 100644 --- a/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend +++ b/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend @@ -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" \