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

priority checks in seL4_TCB_SetSchedParams() #1254

Closed
hexcoder- opened this issue May 26, 2024 · 2 comments
Closed

priority checks in seL4_TCB_SetSchedParams() #1254

hexcoder- opened this issue May 26, 2024 · 2 comments

Comments

@hexcoder-
Copy link
Contributor

While doing a small review on the user manual, I saw in section 10.3.7.13 (seL4_TCB_SetSchedParams) that parameters mcp and priority are checked against authority, which is fine. But the relation mcp >= priority is not enforced, so for example the call would be accepted with authority->priority=10, priority=10, and mcp=9, thus yielding an inconsistent internal state (i think), where priority > mcp.

I consulted the source code for decodeSetSchedParams (

tcb_t *authTCB = TCB_PTR(cap_thread_cap_get_capTCBPtr(authCap));
and the next lines). There are two calls for checkPriority(), each against authority.

invokeTCB_ThreadControl, which is called at the end of seL4_TCB_SetSchedParams seems to have the precondition that these values (mcp and priority) are already checked.

@Indanz
Copy link
Contributor

Indanz commented May 26, 2024

There is nothing wrong with a state where priority > mcp, it just means a task is allowed to drop the priority, but not to increase it back to the original level.

@hexcoder-
Copy link
Contributor Author

Thanks, this issue can than be closed.

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

No branches or pull requests

2 participants