-
Notifications
You must be signed in to change notification settings - Fork 7
support for PSPLIM hardware overflow check register #128
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,37 @@ size_t mgr_task_get_text_region_size(const task_meta_t *meta) | |
| /* got and data in flash are excluded (no need) */ | ||
| } | ||
|
|
||
| /*@ | ||
| assigns \nothing; | ||
|
|
||
| behavior ok: | ||
| assumes stack_limit != \null; | ||
| assigns *stack_limit; | ||
| behavior err: | ||
| assumes stack_limit == \null; | ||
| assigns \nothing; | ||
|
|
||
| complete behaviors; | ||
| disjoint behaviors; | ||
| */ | ||
|
PThierry marked this conversation as resolved.
|
||
| kstatus_t mgr_task_get_stack_size(const taskh_t h, size_t* stack_limit) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. function |
||
| { | ||
| kstatus_t status = K_ERROR_INVPARAM; | ||
| task_t *tsk = task_get_from_handle(h); | ||
|
PThierry marked this conversation as resolved.
|
||
| if (unlikely(tsk == NULL)) { | ||
| pr_err("invalid task handle!"); | ||
| goto err; | ||
| } | ||
| if (unlikely(stack_limit == NULL)) { | ||
| pr_err("invalid stack limit pointer!"); | ||
| goto err; | ||
| } | ||
| *stack_limit = tsk->stack_limit; | ||
| status = K_STATUS_OKAY; | ||
|
Comment on lines
+108
to
+119
|
||
| err: | ||
| return status; | ||
| } | ||
|
|
||
| void task_dump_table(void) | ||
| { | ||
| #ifndef CONFIG_BUILD_TARGET_RELEASE | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,7 +254,11 @@ kstatus_t task_do_initiate_localinfo(task_meta_t const * const meta, task_t *tas | |
| */ | ||
| task_ctx->sp = mgr_task_initialize_sp(0UL, stack_top, (meta->s_text + meta->entrypoint_offset), meta->s_got); | ||
| #endif | ||
|
|
||
| if (unlikely(stack_top < meta->stack_size)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very (very) unlikely for task, lower memory should always be reserved for kernel. |
||
| pr_err("security invalid stack size, not mappable "); | ||
| panic(PANIC_CONFIGURATION_MISMATCH); | ||
| } | ||
| task_ctx->stack_limit = stack_top - meta->stack_size; | ||
|
Comment on lines
+257
to
+261
|
||
| task_ctx->state = JOB_STATE_READY; | ||
| task_ctx->sysretassigned = SECURE_FALSE; | ||
| task_ctx->returncode = 0UL; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is avaiable for armv8.1m too
To be checked for armv8m-baseline (i.e. cortex m23).
May be use a dedicated config entry (e.g.
HAS_STACK_LIMIT_REGwhich is set toyin the corresponding arch or family config entry)