Commit Graph

303 Commits (453122944ce4209bbecd8901acebc2cffa34f25c)

Author SHA1 Message Date
Hugues Kamba 27e4ca18cf Fix inclusion of test related directories by build tool 2019-08-09 10:20:48 +01:00
David Saada fb3559d841 PSA storage: Conform to "PSA 1.0.0" spec release
- Add the no confidentiality & no replay protection flags
- Add actual size parameter in PS/ITS get APIs
- Change a few size parameters from uint32_t to size_t
2019-07-14 18:50:47 +03:00
Martin Kojtal 1aad06b394
Merge pull request #10829 from devran01/feature_trusted-firmware-m_e7efdc6
PSA: TFM import
2019-07-01 14:35:54 +01:00
Martin Kojtal 85c477c1dc
Merge pull request #10609 from kjbracey-arm/us_ticker_optimise
wait_us optimization
2019-06-28 14:29:00 +01:00
Kevin Bracey c5b9779858 Remote "static" from MBED_FORCEINLINE
Static keyword causes problems when trying to use force-inlined
functions from normal inlined functions. This is not legal:

    static inline void forced() { }

    inline void normal() { forced(); }

You cannot reference internal-linkage things from external-linkage
inline functions.

Removal of the static implies that in C there would need to be a
non-inline definition in case anyone calls it non-inlined, but if the
force attribute is doing its job, that should not happen.

Only significant in-tree user of the MBED_FORCEINLINE macro is
the atomic operations - making this change permits atomic operations
from non-static inline functions.
2019-06-27 16:12:30 +03:00
Devaraj Ranganna 6e899b3cc9 TF-M patch/workaround related to (TF-M issue #T240)
- Link to bug tracking: https://developer.trustedfirmware.org/T240

The issue is fixed by TF-M team. However they autogenerate region details
(code, ro, rw, zi and stack ) using linker scripts and in mbed-os we
also autogenerate region details but using mix of service definition in
json file and other template files.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-26 14:58:19 +01:00
Devaraj Ranganna 9a5110561a TF-M patch: Remove secure_fw/core/tfm_func_api.c which is required only
when TFM_PSA_API is not set

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-26 14:23:26 +01:00
Devaraj Ranganna cb748c5608 TF-M patch: Change #if TFM_PSA_API to #ifdef TFM_PSA_API to avoid
compiler errors as mbed-cli only generates "-D" macros only for
"macros" defined in targets.json

TF-M task link: https://developer.trustedfirmware.org/T396

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-26 14:23:26 +01:00
Devaraj Ranganna cb8f2c07a1 1. Include MBEDTLS_CONFIG_FILE before evaluating MBEDTLS_PSA_CRYPTO_C
2. Remove macro MBEDTLS_PSA_CRYPTO_C from PSA targets

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-24 14:33:04 +01:00
Michael Schwarcz 910a402ce6 TF-M patch: Fix tfm_psa_call_venner wrong argument type (TF-M issue #241)
- Link to bug tracking: https://developer.trustedfirmware.org/T241

(cherry picked from commit da01e3411f)
(cherry picked from commit 280715f9b7)
2019-06-06 16:08:34 +01:00
Michael Schwarcz 35938a4071 TF-M patch: Fix service handles not cleared issue (TF-M issue #230)
- Link to bug tracking: https://developer.trustedfirmware.org/T230

(cherry picked from commit 0c23e86989)
(cherry picked from commit 9c1e080e39)
2019-06-06 16:08:33 +01:00
Michael Schwarcz 795e6418d0 TF-M patch: Fix tfm_ns_lock_init issue (TF-M issue #239)
- Link to bug tracking: https://developer.trustedfirmware.org/T239

(cherry picked from commit 5f2e4b3911)
(cherry picked from commit 5d41a2aeae)
2019-06-06 16:08:33 +01:00
Michael Schwarcz 11bff3f3cb TF-M patch: General modifications
- Remove un-needed files
- Disable printf and uart
- Modify include paths
- Guard macros from mbed_lib with ifndef

(cherry picked from commit 1f30b52488)
(cherry picked from commit 71cd34df32)
(cherry picked from commit 185d2865da)
(cherry picked from commit fb068d2cb4)
2019-06-06 14:49:41 +01:00
Devaraj Ranganna b0fe59df00 [trusted-firmware-m]: Updated to e7efdc6 2019-06-06 14:47:00 +01:00
David Saada dcd2c292af PSA protected storage: Add encrypt & RB protect flags by default to set. 2019-06-03 16:32:55 +03:00
Martin Kojtal 303d0f0c0c SPE: fix inject entropy macro
Use new TLS macro
2019-05-27 11:50:09 +01:00
Anna Bridge 9fb4429379
Merge pull request #10520 from kjbracey-arm/build_tz_heuristic
Permit non-TrustZone ARMv8 build
2019-05-17 11:06:55 +01:00
Martin Kojtal 3ea1c56124
Merge pull request #10147 from kjbracey-arm/atomic_bitwise
Assembler atomics
2019-05-13 14:18:05 +01:00
Kevin Bracey 65e0887ef3 Permit non-TrustZone ARMv8 build
Change the heuristic for selection of CMSE in the tools python, so that
a non-TrustZone ARMv8 build can happen.

Ideally we would have more direct flagging in the targets, but this
refines the heuristic so the necessary behaviour can be easily
achieved.

* DOMAIN_NS=1 is based purely on the `-NS` suffix on the core name.

* Enabling CMSE in the compiler and outputting a secure import library
  is now enabled when the core doesn't have an `-NS` suffix by either
  the target label `TFM` being present or the flag `trustzone` being set.

This covers the existing ARMv8-M behaviour - TF-M builds have the TFM
label, as per its documentation; M2351 secure builds have no explicit
flagging, so we ensure that the M2351_NS target has the trustzone flag
set, and the out-of-tree secure target inherits that.
2019-05-03 13:36:38 +03:00
Alexander Zilberkant 117e3e82b6 Update PSA includes to autogenerated files 2019-04-30 14:41:09 +03:00
Alexander Zilberkant 8c5ba9154d Update PSA code generator
Unify TF-M and Mbed-SPM code generators:
 - Unify SPM initialization logic:
   - All partitions are registered at once
   - Test partitions are guarded by #ifndef
   - Introduce single template list
 - Beatify template files and add "Autogen-do not modify" notice
Prepare for integration with mbed-os build system:
 - Generate all the files in a single place
Simplify tools/psa/release.py script
2019-04-30 14:10:23 +03:00
Alexander Zilberkant ab01bea46d Delete autogenerated files 2019-04-30 14:10:23 +03:00
Oren Cohen 5342015bb1 TF-M patch: Add necessary include in tfm_ns_lock.h 2019-04-28 15:45:06 +03:00
Michael Schwarcz ea81bf91c9 TF-M patch: Fix wrong check in tfm_spm_check_client_version (TF-M issue #236)
- Link to bug tracking: https://developer.trustedfirmware.org/T236

(cherry picked from commit 008bf1b2d1)
2019-04-28 15:45:06 +03:00
Michael Schwarcz 280715f9b7 TF-M patch: Fix tfm_psa_call_venner wrong argument type (TF-M issue #241)
- Link to bug tracking: https://developer.trustedfirmware.org/T241

(cherry picked from commit da01e3411f)
2019-04-28 15:45:05 +03:00
Michael Schwarcz 78ed870287 TF-M patch: Fix fixed-size partitions stack size (TF-M issue #240)
- Link to bug tracking: https://developer.trustedfirmware.org/T240

(cherry picked from commit fc78640559)
2019-04-28 15:45:05 +03:00
Michael Schwarcz 9c1e080e39 TF-M patch: Fix service handles not cleared issue (TF-M issue #230)
- Link to bug tracking: https://developer.trustedfirmware.org/T230

(cherry picked from commit 0c23e86989)
2019-04-28 15:45:05 +03:00
Michael Schwarcz 5d41a2aeae TF-M patch: Fix tfm_ns_lock_init issue (TF-M issue #239)
- Link to bug tracking: https://developer.trustedfirmware.org/T239

(cherry picked from commit 5f2e4b3911)
2019-04-28 15:45:04 +03:00
Michael Schwarcz fb068d2cb4 TF-M patch: General modifications
- Remove un-needed files
- Disable printf and uart
- Modify include paths
- Guard macros from mbed_lib with ifndef

(cherry picked from commit 1f30b52488)
(cherry picked from commit 71cd34df32)
(cherry picked from commit 185d2865da)
2019-04-28 15:45:04 +03:00
Oren Cohen ae6bdc311c [trusted-firmware-m]: Updated to f2dea5b 2019-04-28 13:14:35 +03:00
Kevin Bracey 87396e0bf6 Assembler atomics
Reimplement atomic code in inline assembly. This can improve
optimisation, and avoids potential architectural problems with using
LDREX/STREX intrinsics.

API further extended:
* Bitwise operations (fetch_and/fetch_or/fetch_xor)
* fetch_add and fetch_sub (like incr/decr, but returning old value -
  aligning with C++11)
* compare_exchange_weak
* Explicit memory order specification
* Basic freestanding template overloads for C++

This gives our existing C implementation essentially all the functionality
needed by C++11.

An actual Atomic<T> template based upon these C functions could follow.
2019-04-26 13:12:35 +03:00
Oren Cohen f51eb6215a Fix warnings on PSA secure builds 2019-04-17 10:37:51 +03:00
Martin Kojtal c6b917327b
Merge pull request #10232 from itayzafrir/crypto-service-multipart-operation-abort-fix
PSA Crypto Service - multipart operation memory fixes
2019-04-11 11:51:18 +01:00
Michael Schwarcz 5a9dff2e04 TF-M patch: Fix tfm_memory_check issue (TF-M issue #224)
- Add Secure/non-secure code and secure heap to memory check
- Link to bug tracking: https://developer.trustedfirmware.org/T224
2019-04-10 14:20:56 +03:00
Michael Schwarcz 3badc126cf TF-M patch: Fix wrong check in tfm_spm_check_client_version (TF-M issue #236)
- Link to bug tracking: https://developer.trustedfirmware.org/T236

(cherry picked from commit 008bf1b2d1)
2019-04-10 14:20:56 +03:00
Michael Schwarcz ad8ddd8e6e TF-M patch: Fix tfm_psa_call_venner wrong argument type (TF-M issue #241)
- Link to bug tracking: https://developer.trustedfirmware.org/T241

(cherry picked from commit da01e3411f)
2019-04-10 14:20:56 +03:00
Michael Schwarcz f0e4583b72 TF-M patch: Fix fixed-size partitions stack size (TF-M issue #240)
- Link to bug tracking: https://developer.trustedfirmware.org/T240

(cherry picked from commit fc78640559)
2019-04-10 14:20:56 +03:00
Michael Schwarcz 3fbc73e046 TF-M patch: Fix service handles not cleared issue (TF-M issue #230)
- Link to bug tracking: https://developer.trustedfirmware.org/T230

(cherry picked from commit 0c23e86989)
2019-04-10 14:20:56 +03:00
Michael Schwarcz e89c1a68ce TF-M patch: Fix tfm_ns_lock_init issue (TF-M issue #239)
- Link to bug tracking: https://developer.trustedfirmware.org/T239

(cherry picked from commit 5f2e4b3911)
2019-04-10 14:20:56 +03:00
Michael Schwarcz 185d2865da TF-M patch: General modifications
- Remove un-needed files
- Disable printf and uart
- Modify include paths
- Guard macros from mbed_lib with ifndef

(cherry picked from commit 1f30b52488)
(cherry picked from commit 71cd34df32)
2019-04-10 14:20:56 +03:00
Oren Cohen 4e6ed2bb46 [trusted-firmware-m]: Updated to 0101fd37 2019-04-10 14:20:56 +03:00
itayzafrir 2b81588664 Add message context cleanup helper function 2019-03-28 12:53:11 +02:00
Oren Cohen 268b48c2e5 Run autogen 2019-03-28 10:40:56 +02:00
itayzafrir a446ee63c7 Rename internal function destroy_hash_clone to clear_hash_clone 2019-03-27 16:13:46 +02:00
itayzafrir b26890e62d Do not allocate zero sized buffers - generators 2019-03-27 15:43:19 +02:00
itayzafrir 749b1e30bb Do not allocate zero sized buffers - rng 2019-03-27 15:43:18 +02:00
itayzafrir abd9c661ce Do not allocate zero sized buffers - entropy 2019-03-27 15:43:18 +02:00
itayzafrir 19b83812d4 Do not allocate zero sized buffers - keys 2019-03-27 15:43:17 +02:00
itayzafrir f3294ef338 Do not allocate zero sized buffers - cipher 2019-03-27 15:43:16 +02:00
itayzafrir 19952d990c Do not allocate zero sized buffers - aead 2019-03-27 15:43:15 +02:00