From 027e37239ca4f71c243e36a40cefdace2cab3ee3 Mon Sep 17 00:00:00 2001 From: James Archer Date: Wed, 17 Jul 2024 13:51:56 +1000 Subject: [PATCH] build_sdk.py: enable building kernels with domains 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 --- build_sdk.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build_sdk.py b/build_sdk.py index b3d19d553..6df5684ad 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -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() @@ -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")