Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules: openthread: platform: optimize stack usage in crypto_psa #20840

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

Damian-Nordic
Copy link
Contributor

A PSA crypto operation object can be initialized in multiple ways according to the documentation. For example,

  1. Using a dedicated psa_xxx_operation_init() function that returns an initialized object.
  2. Using memset() to zero out the operation object.

For some PSA crypto driver implementations, using the first method causes an excessive stack usage if the operation object is large and psa_xxx_operation_init() is not inlined. Instead, it is better to stick to memset() for this purpose.

@Damian-Nordic Damian-Nordic marked this pull request as ready for review March 10, 2025 15:40
@Damian-Nordic Damian-Nordic requested a review from a team as a code owner March 10, 2025 15:40
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 10, 2025
@Damian-Nordic Damian-Nordic removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 10, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Mar 10, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 2

Inputs:

Sources:

sdk-nrf: PR head: 3af32a3cd1860c705d6e48dbf1298964cd29b013

more details

sdk-nrf:

PR head: 3af32a3cd1860c705d6e48dbf1298964cd29b013
merge base: d5e534ece58f2d3d537cd312fbea9f5b0b18ad04
target head (main): 8dc58a8fe049cfe41bea4d9a23628557923b304c
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (1)
modules
│  ├── openthread
│  │  ├── platform
│  │  │  │ crypto_psa.c

Outputs:

Toolchain

Version: acee3b0b2b
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:acee3b0b2b_bece0367df

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 104
  • ✅ Integration tests
    • ✅ test-fw-nrfconnect-thread
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

A PSA crypto operation object can be initialized in multiple
ways according to the documentation. For example,
1. Using a dedicated psa_xxx_operation_init() function that
   returns an initialized object.
2. Using memset() to zero out the operation object.

For some PSA crypto driver implementations, using the first
method causes an excessive stack usage if the operation
object is large and psa_xxx_operation_init() is not inlined.
Instead, it is better to stick to memset() for this purpose.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 11, 2025
@Damian-Nordic Damian-Nordic removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 11, 2025
@nordicjm nordicjm merged commit 13cdec8 into nrfconnect:main Mar 11, 2025
14 checks passed
@Damian-Nordic Damian-Nordic deleted the ot_stack_usage branch March 11, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants