Skip to content

Commit 69196ec

Browse files
karstenkoenignordicjm
authored andcommitted
sdfw_services: psa_crypto: Bounce buffer handling
Added bounce buffers for any field written from secure domain to local domain, as we can't prevent the local domain to have dirty data in the DataUnit that the secure domain writes to. Signed-off-by: Karsten Koenig <[email protected]>
1 parent 0edccfe commit 69196ec

File tree

2 files changed

+696
-117
lines changed

2 files changed

+696
-117
lines changed

subsys/sdfw_services/services/psa_crypto/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,30 @@ service_version = 2
1111
service_buffer_size = 128
1212
service_name_str = PSA Crypto
1313
rsource "../Kconfig.template.service"
14+
15+
if SSF_PSA_CRYPTO_SERVICE_ENABLED
16+
17+
config SSF_PSA_CRYPTO_SERVICE_OUT_BOUNCE_BUFFERS
18+
bool "Make sure that all output buffers can be written cache-safe from the crypto engine"
19+
default y
20+
depends on DCACHE
21+
help
22+
When this option is enabled, the PSA Crypto service will allocate bounce buffers for
23+
all PSA [inout] and [out] structures that are not aligned to the DCache DataUnit size.
24+
When this option is disabled, the PSA Crypto service will never use bounce buffers,
25+
and the application must ensure that the structures are cache-safe.
26+
The structures are cache-safe if there are no writes locally to any of the DataUnits
27+
that contain the structure getting written from the remote.
28+
29+
if SSF_PSA_CRYPTO_SERVICE_OUT_BOUNCE_BUFFERS
30+
31+
config SSF_PSA_CRYPTO_SERVICE_OUT_HEAP_SIZE
32+
int "Size of the heap used to buffer output from PSA function calls"
33+
default 4096
34+
help
35+
Size of the heap buffer used for out buffer.
36+
Reducing the size may trigger PSA_ERROR_INSUFFICIENT_MEMORY in PSA calls.
37+
38+
endif # SSF_PSA_CRYPTO_SERVICE_OUT_BOUNCE_BUFFERS
39+
40+
endif # SSF_PSA_CRYPTO_SERVICE_ENABLED

0 commit comments

Comments
 (0)