-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make taskYIELD available to unprivileged tasks #817
Conversation
Signed-off-by: Gaurav Aggarwal <[email protected]>
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #817 +/- ##
=======================================
Coverage 93.62% 93.62%
=======================================
Files 6 6
Lines 2508 2508
Branches 598 598
=======================================
Hits 2348 2348
Misses 107 107
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
@aggarg Changes looks good to me. However, using the SVC to raise privilege similar to Armv7-M implementation works in this scenario, I'm wondering would it be worth looking at implementing |
The following happens when a system call executes:
This is done to ensure we do not execute kernel APIs which execute with elevated privilege on an unprivileged stack. This much complexity is not needed if the work is small and can be completed in the SVC handler itself (which happens to be case of yield). Also, returning to Thread mode is necessary for executing kernel APIs primarily for two reasons - one, many of them block and two, they are somewhat larger than what you'd want to execute in Handler mode. Neither of those reasons apply to yield which is a very simple operation and can be completed in the SVC Handler itself. Therefore, I kept it in the SVC handler. |
@aggarg Thanks for the detailed explanation. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
This PR makes taskYIELD available to unprivileged tasks on ARMv8-M ports.
Test Steps
Tested on Cortex-M23 and Cortex-M33 platforms. Calling taskYIELD from an unprivileged task results in fault without these changes and, works normally after these changes.
Checklist:
Related Issue
#788
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.