diff --git a/arch/arm/core/cortex_m/fpu.c b/arch/arm/core/cortex_m/fpu.c index b937d725c28..0b8499afd6e 100644 --- a/arch/arm/core/cortex_m/fpu.c +++ b/arch/arm/core/cortex_m/fpu.c @@ -16,7 +16,7 @@ void z_arm_save_fp_context(struct fpu_ctx_full *buffer) { -#if defined(CONFIG_FPU_SHARING) +#if defined(CONFIG_FPU) __ASSERT_NO_MSG(buffer != NULL); uint32_t CONTROL = __get_CONTROL(); @@ -44,7 +44,7 @@ void z_arm_save_fp_context(struct fpu_ctx_full *buffer) void z_arm_restore_fp_context(const struct fpu_ctx_full *buffer) { -#if defined(CONFIG_FPU_SHARING) +#if defined(CONFIG_FPU) if (buffer->ctx_saved) { /* Set FPCA first so it is set even if an interrupt happens * during restoration. diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index c76812198a3..5e066130b26 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -26,6 +26,11 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() + # Treat any warning as error + if (CONFIG_COMPILER_WARNINGS_AS_ERRORS) + list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_WARNINGS_ARE_ERRORS:BOOL=ON) + endif() + if (CONFIG_TFM_SFN) list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="SFN") else() # CONFIG_TFM_IPC diff --git a/modules/trusted-firmware-m/interface/interface.c b/modules/trusted-firmware-m/interface/interface.c index abff7efdc72..027985b9e9b 100644 --- a/modules/trusted-firmware-m/interface/interface.c +++ b/modules/trusted-firmware-m/interface/interface.c @@ -53,13 +53,17 @@ int32_t tfm_ns_interface_dispatch(veneer_fn fn, #endif } +#if defined(CONFIG_FPU_SHARING) struct fpu_ctx_full context_buffer; z_arm_save_fp_context(&context_buffer); +#endif result = fn(arg0, arg1, arg2, arg3); +#if defined(CONFIG_FPU_SHARING) z_arm_restore_fp_context(&context_buffer); +#endif if (!isr_mode) { #if !defined(CONFIG_ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS) diff --git a/samples/tfm_integration/tfm_psa_test/CMakeLists.txt b/samples/tfm_integration/tfm_psa_test/CMakeLists.txt index 03f55dccad1..8b05afab3aa 100644 --- a/samples/tfm_integration/tfm_psa_test/CMakeLists.txt +++ b/samples/tfm_integration/tfm_psa_test/CMakeLists.txt @@ -63,6 +63,17 @@ set_property(TARGET zephyr_property_target -DTEST_PSA_API=${TEST_PSA_API} ) +# Workaround: The TF-M tests require the large TF-M profile because it supports +# the full list of crypto algorithms needed, not because of the isolation level. +# For the TF-M tests the isolation level is irrelevant so we set it to 2 here so +# that we don't exclude the platforms which don't support the isolation level 3. +# This is a short lived workaround because the TF-M cmake logic will do this workaround +# automatically in the future. +set_property(TARGET zephyr_property_target + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DTFM_ISOLATION_LEVEL=2 +) + include(ExternalProject) ExternalProject_Add(tfm_psa_arch_test_app diff --git a/samples/tfm_integration/tfm_psa_test/prj.conf b/samples/tfm_integration/tfm_psa_test/prj.conf index bab1254229d..ba515d542c8 100644 --- a/samples/tfm_integration/tfm_psa_test/prj.conf +++ b/samples/tfm_integration/tfm_psa_test/prj.conf @@ -5,7 +5,7 @@ # CONFIG_BUILD_WITH_TFM=y -CONFIG_TFM_PROFILE_TYPE_NOT_SET=y +CONFIG_TFM_PROFILE_TYPE_LARGE=y CONFIG_TFM_USE_NS_APP=y CONFIG_QEMU_ICOUNT_SHIFT=1 diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index af2d68d0ef5..8e8d7904ac5 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -41,7 +41,7 @@ manifest: groups: - optional - name: tf-m-tests - revision: c712761dd5391bf3f38033643d28a736cae89a19 + revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 path: modules/tee/tf-m/tf-m-tests remote: upstream groups: