Skip to content

lazy Scheduling Context rebind + improve tool <-> monitor ABI#439

Open
dreamliner787-9 wants to merge 1 commit intoseL4:mainfrom
au-ts:lazy_sc_rebind
Open

lazy Scheduling Context rebind + improve tool <-> monitor ABI#439
dreamliner787-9 wants to merge 1 commit intoseL4:mainfrom
au-ts:lazy_sc_rebind

Conversation

@dreamliner787-9
Copy link
Contributor

@dreamliner787-9 dreamliner787-9 commented Mar 15, 2026

Applied seL4/seL4#523 to workaround seL4/seL4#1617, and improved tool <-> monitor ABI by creating a metadata struct per PD, rather than adding a new symbol for every type of metadata.

@dreamliner787-9 dreamliner787-9 changed the title monitor: lazy Scheduling Context rebind lazy Scheduling Context rebind + improve tool <-> monitor ABI Mar 16, 2026
Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Copy link

@Indanz Indanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, this really should be two separate commits, not lumped together like this.

Secondly, I'm missing creating a notifications object for passive servers that don't otherwise have one already, and binding the SC to the notification object if the PD is passive.

That last thing is really the only change you need compared to active PDs for setup.

Only other change needed is that you bind the SC when restarting the task, but I don't think Microkit does that yet, but rust-sel4 does I think.

Comment on lines +896 to +918
/* If there are passive PDs in the system, lazily rebind it's Scheduling Context and resume TCB.
* To workaround https://github.com/seL4/seL4/issues/1617 by applying https://github.com/seL4/seL4/pull/523
*/
for (unsigned idx = 0; idx < pd_metadata_len; idx++) {
if (pd_metadata[idx].passive) {
seL4_Error err = seL4_SchedContext_Bind(BASE_SCHED_CONTEXT_CAP + idx, BASE_NOTIFICATION_CAP + idx);
if (err != seL4_NoError) {
puts("MON|ERROR: could not bind scheduling context to notification object\n");
continue;
}

err = seL4_TCB_Resume(BASE_PD_TCB_CAP + idx);
if (err != seL4_NoError) {
puts("MON|ERROR: could not bind resume passive PD TCB\n");
continue;
}

puts("MON|INFO: PD '");
puts(pd_metadata[idx].name);
puts("' is now passive!\n");
}
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to do this resume and you can bind the SC to the notification when you create the notification for a passive thread. This feels like the wrong place for that.

Comment on lines +982 to +983
// Passive PDs are resumed by the Monitor
pd_tcb.extra.resume = !pd.passive;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

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

Successfully merging this pull request may close these issues.

2 participants