Skip to content

Commit

Permalink
build_sdk.py: enable building kernels with domains
Browse files Browse the repository at this point in the history
This commit adds two additional command line arguments to
build_sdk.py:

    --experimental-num-domains: the number of kernel domains;
    --experimental-domain-schedule: path to a C file with the domain
    schedule configuration.

These flags must be used together; neither makes sense on its
own. When these flags are provided, build_sdk.py will build all kernel
images with domains enabled and with the provided configuration. The
flags correspond to the kernel build flags "KernelNumDomains" and
"KernelDomainSchedule", respectively.

All kernels contained in the SDK will have this domain
configuration. There is no way to have some kernels have the domain
configuration and others not, or to have different kernels with
different domain configurations.

These flags are intended as a stopgap solution until the kernel allows
configuration of the domain schedule at runtime. Once that is enabled
in mainline seL4, these flags can be removed from Microkit.

Signed-off-by: James Archer <[email protected]>
  • Loading branch information
JE-Archer committed Jul 17, 2024
1 parent d5fb249 commit 027e372
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ def main() -> None:
parser.add_argument("--skip-tool", action="store_true", help="Tool will not be built")
parser.add_argument("--skip-docs", action="store_true", help="Docs will not be built")
parser.add_argument("--skip-tar", action="store_true", help="SDK and source tarballs will not be built")
parser.add_argument("--experimental-num-domains", type=int, help="[EXPERIMENTAL] Number of kernel domains")
parser.add_argument("--experimental-domain-schedule", type=Path, help="[EXPERIMENTAL] Path to C file specifying kernel domain schedule")

args = parser.parse_args()

Expand All @@ -451,6 +453,15 @@ def main() -> None:
else:
selected_configs = SUPPORTED_CONFIGS

if args.experimental_num_domains is not None:
if args.experimental_domain_schedule is None:
raise Exception("User must specify --experimental-domain-schedule when specifying --experimental-num-domains")
for config in selected_configs:
config.kernel_options["KernelNumDomains"] = str(args.experimental_num_domains)
config.kernel_options["KernelDomainSchedule"] = args.experimental_domain_schedule
elif args.experimental_domain_schedule is not None:
raise Exception("User must specify --experimental-num-domains when specifying --experimental-domain-schedule")

sel4_dir = args.sel4.expanduser()
if not sel4_dir.exists():
raise Exception(f"sel4_dir: {sel4_dir} does not exist")
Expand Down

0 comments on commit 027e372

Please sign in to comment.