Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arch/arm/core/cortex_m/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions modules/trusted-firmware-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions modules/trusted-firmware-m/interface/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions samples/tfm_integration/tfm_psa_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/tfm_integration/tfm_psa_test/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion submanifests/optional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down