Reduce SVCall priority on ARMv8-M - #1481
Open
jefftenney wants to merge 4 commits into
Open
Conversation
After this commit, configMAX_SYSCALL_INTERRUPT_PRIORITY must have a zero in the least-significant implemented preemption-priority bit in Trustzone applications. This change ensures that interrupts of higher priority are not masked as a result of non-secure interrupt de-prioritization. For example, consider a PE with 4 preemption-priority bits implemented. If configMAX_SYSCALL_INTERRUPT_PRIORITY is 0x50, then non-secure interrupts that use priority 0x40 would also be masked by FreeRTOS critical sections. This is unexpected because 0x40 is a higher priority than 0x50. De-prioritization changes both 0x50 and 0x40 into 0xA0.
1 task
Contributor
Author
|
These changes test OK in some basic testing. One TZ application and one non-TZ application on STM32U585 (CM33). Note that pre-existing TZ applications that have set |
|
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.



Description
Instead of using the maximum priority for SVCall, use a priority just sufficient for preemption wherever SVC may be used. After this change, the developer can now assign some interrupts to higher priorities than SVC.
Also require configMAX_SYSCALL_INTERRUPT_PRIORITY to have a zero in the least-significant implemented preemption-priority bit in TrustZone applications. This change prevents confusion caused by the hardware de-prioritizing non-secure interrupts, which coalesces neighboring preemption priority groups. This change also simplified the determination of the optimal priority setting for SVCall.
Test Steps
Test two existing applications - one TZ and one non-TZ. (Neither uses the MPU though.)
Checklist:
Related Issue
#1470
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.