scheduling: Create a secondary sandbox scheduling domain

This updates the kernel configs to setup two domains instead of one,
and also defines a bare-bones domain scheduler that simply round-
robins through the domains.

Bug: 238811077
Change-Id: Ibb49f10265c38dc26235fc246f6147b306055bcb
GitOrigin-RevId: 6b17211d8866bec9207f78dc61c4840c6da9537d
This commit is contained in:
June Tate-Gans
2022-07-20 16:34:10 -05:00
committed by Sam Leffler
parent ce1543c466
commit be8c32c874
7 changed files with 47 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
#include <model/statedata.h>
#include <object/structures.h>
/* Dual-domain schedule for Kata to isolate third party applications from system
* applications.
*
* Note that this doesn't actually implement the schedule -- that's hardwired in
* seL4's kernel source. See also kata/kernel/src/kernel/thread.c, in the
* nextDomain function around line 302 and the timerTick function around 630.
*
* Effectively this is a round-robin scheduler, so half of the CPU time is given
* to system applications, while third party applications are allocated the
* other half. Note that even if there's nothing to run in the third-party
* application domain, the scheduler will schedule an idle thread to ensure that
* domain gets it's allocated share of time.
*/
const dschedule_t ksDomSchedule[] = {
{.domain = 0, .length = 1}, // System domain
{.domain = 1, .length = 1}, // Third party application domain
};
const word_t ksDomScheduleLength = sizeof(ksDomSchedule) / sizeof(dschedule_t);