Repository navigation
Conversation
Generated by AI: GPT-5.6 Terra
The new Cortex-M55 port required GNU C extensions to build. Several assembly files also needed preprocessing, and the port lacked the current secure stack and context save checks used by the maintained ports. Shared memory limits mixed address and MPU attribute bits. Used C99-compatible GNU assembly syntax and preprocessed the mode-specific sources. Applied the maintained checks to GNU and IAR, corrected the MPU limit encoding, and ran the GNU module manager in secure-only mode on the AN547 QEMU machine. Inline CMSE register access retains the existing MISRA C:2023 Rule 1.2 and Directive 4.3 deviations for hardware access. GCC 14 built the dual-state GNU archives in C99 mode. QEMU passed 4/4 on M3, 4/4 on M4, and 3/3 on M55 with PRIMASK and with BASEPRI plus WFI. The M55 MPU limit regression failed before the encoding fix. Secure-only QEMU covered 90/97 executable lines and 30/39 branch outcomes in M55 manager C. IAR and STM32N6 were not run locally. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com>
The M55 module SVC handler skipped secure stack initialization, and the dispatcher validated thread arguments by size. Releasing an active stack left its address in the Secure stack registers. Dispatch the startup SVC by its return address, authenticate live thread objects, and clear the active stack registers and context ownership on release. GNU register access uses MISRA C:2023 Rule 1.2 and Directive 4.3 deviations for hardware access. Rule 11.6 applies to comparing a stack limit address with the register value. QEMU passed 4/4 on M3, 4/4 on M4, and 3/3 in each M55 secure-only and dual-state interrupt configuration. The startup regression failed before the fix. GCC covered 97/97 lines and 39/39 branch outcomes in secure-only GNU M55 manager C and 206/232 lines and 92/121 branch outcomes in dual-state manager C. IAR and STM32N6 testing of this follow-up remains outstanding. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com> Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
The dual-state module tests exercised secure stack allocation and release with room in the allocator and the context pool. They left the startup and interrupt caller checks in the public APIs partly untested. Bounded the QEMU Secure heap and added a regression that exhausts both resources, retries after a release, and calls the public APIs during startup and from timer callbacks. The fixture documents its MISRA C:2023 deviations for the heap's alignment and the newlib system-call interface. GCC 14 and QEMU passed 26/26 across seven Cortex-M configurations. The test failed when allocation stopped returning a context after malloc failure. Combined M55 dual-state manager C coverage reached 216/232 lines and 101/121 branch outcomes. Both secure stack API wrappers reached full line and branch coverage. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com> Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
The dual-state QEMU tests covered normal secure stack operations, resource exhaustion, and timer callers. Secure-side rejection paths remained uncovered. Moved register access into GNU port macros and added a Linux regression that compiles the port source with a simulated register bank and CMSE decisions. The Cortex-M55 object retained identical instructions and relocations. GCC 14 passed 26/26 QEMU tests and 14/14 Linux Module Manager tests. QEMU exercised 216/232 GNU dual-state manager C lines and 101/121 branch outcomes. Combined with the Linux guard test, coverage reached 232/232 lines and 121/121 branch outcomes. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com> Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
Contributor
|
@rahmanih Could you build the updated PR head ( Please share the IAR version, configurations tested, and results here. |
2 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ThreadX Modules lacked a Cortex-M55 port for GNU and IAR. The port needs to build in C99 and preserve the secure stack and context save checks used by the maintained Armv8-M ports.
Added the GNU and IAR module ports, corrected GNU assembly preprocessing and shared MPU limit encoding, and carried forward the maintained checks. The module port initializes secure stacks at startup, validates thread handles, and clears the active Secure stack registers before release. The GNU module harness covers secure-only and dual-state operation on QEMU's AN547 machine. A Linux test exercises the Secure stack guards with simulated registers and CMSE decisions.
GCC 14 passed 26/26 QEMU tests and 14/14 Linux Module Manager tests. The MPU limit and secure stack startup regressions failed before their fixes. The exhaustion regression detected a lost context after Secure heap allocation failed. GNU M55 manager C coverage reached 97/97 lines and 39/39 branch outcomes in secure-only QEMU and 216/232 lines and 101/121 branch outcomes in dual-state QEMU. Combined with the Linux guard test, dual-state coverage reached 232/232 lines and 121/121 branch outcomes. The contributor reported STM32N6 tests with GNU and IAR. The follow-ups ran locally with GNU.