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

Morello purecap kernel #369

Merged
merged 3 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pycheribuild/boot_cheribsd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@
CompilationTargets.CHERIBSD_MORELLO_PURECAP,
)}

AUTOBOOT_PROMPT = re.compile(r"(H|, h)it \[Enter] to boot ")
# boot loader without lua: "Hit [Enter] to boot "
# menu.lua before Sep 2019: ", hit [Enter] to boot "
# menu.lua: "[Space] to pause"
AUTOBOOT_PROMPT = re.compile(r"((H|, h)it \[Enter] to boot |\[Space] to pause)")
bsdjhb marked this conversation as resolved.
Show resolved Hide resolved
BOOT_LOADER_PROMPT = "OK "

STARTING_INIT = "start_init: trying /sbin/init"
Expand Down Expand Up @@ -845,6 +848,7 @@ def boot_and_login(child: CheriBSDSpawnMixin, *, starttime, kernel_init_only=Fal
loader_boot_prompt_messages = [*boot_messages, BOOT_LOADER_PROMPT]
loader_boot_messages = [*loader_boot_prompt_messages, AUTOBOOT_PROMPT]
i = child.expect(loader_boot_messages, timeout=20 * 60, timeout_msg="timeout before loader or kernel")
ran_manual_boot = False
if i >= len(boot_messages):
# Skip 10s wait from loader(8) if we see the autoboot message
if i == loader_boot_messages.index(AUTOBOOT_PROMPT): # Hit Enter
Expand All @@ -855,15 +859,18 @@ def boot_and_login(child: CheriBSDSpawnMixin, *, starttime, kernel_init_only=Fal
i = child.expect(loader_boot_prompt_messages, timeout=60,
timeout_msg="timeout before loader prompt")
if i != loader_boot_prompt_messages.index(BOOT_LOADER_PROMPT):
failure("failed to enter boot loader prompt", exit=True)
failure("failed to enter boot loader prompt after stopping autoboot", exit=True)
# Fall through to BOOT_LOADER_PROMPT
else:
child.sendline("\r")
if i == loader_boot_messages.index(BOOT_LOADER_PROMPT): # loader(8) prompt
success("===> loader(8) waiting boot commands")
# Just boot the default kernel if no alternate kernel directory is given
child.sendline("boot {}".format(boot_alternate_kernel_dir or ""))
ran_manual_boot = True
i = child.expect(boot_messages, timeout=5 * 60, timeout_msg="timeout before kernel")
if boot_alternate_kernel_dir and not ran_manual_boot:
failure("failed to enter boot loader prompt", exit=True)
if i == boot_messages.index(TRYING_TO_MOUNT_ROOT):
success("===> mounting rootfs")
if bootverbose:
Expand Down
3 changes: 1 addition & 2 deletions pycheribuild/projects/cross/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,7 @@ def run_tests(self):
self.fatal("running x86 tests is not implemented yet")
return
# testing, not benchmarking -> run only once
test_command = "cd '/build/{dirname}' && ./run_jenkins-bluehive.sh -d0 -r1 -s".format(
dirname=self.bundle_dir.name)
test_command = f"cd '/build/{self.bundle_dir.name}' && ./run_jenkins-bluehive.sh -d0 -r1 -s"
self.target_info.run_cheribsd_test_script("run_simple_tests.py", "--test-command", test_command,
"--test-timeout", str(120 * 60), mount_builddir=True)

Expand Down
11 changes: 4 additions & 7 deletions pycheribuild/projects/cross/libcxx.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,13 @@ def add_cross_flags(self):
elif self.nfs_mounted_path:
self.libcxx_lit_jobs = " -j1" # We can only run one job here since we are using scp
self.fatal("nfs_mounted_path not portend to new libc++ test infrastructure yet")
executor = "SSHExecutorWithNFSMount(\\\"{host}\\\", nfs_dir=\\\"{nfs_dir}\\\"," \
"path_in_target=\\\"{nfs_in_target}\\\", config=self, username=\\\"{user}\\\"," \
" port={port})".format(host=self.qemu_host, user=self.qemu_user, port=self.qemu_port,
nfs_dir=self.nfs_mounted_path, nfs_in_target=self.nfs_path_in_qemu)
executor = f"SSHExecutorWithNFSMount(\\\"{self.qemu_host}\\\", nfs_dir=\\\"{self.nfs_mounted_path}\\\"," \
f"path_in_target=\\\"{self.nfs_path_in_qemu}\\\", config=self," \
f"username=\\\"{self.qemu_user}\\\", port={self.qemu_port})"
else:
self.libcxx_lit_jobs = " -j1" # We can only run one job here since we are using scp
executor = self.commandline_to_str([self.source_dir / "utils/ssh.py",
"--host", "{user}@{host}:{port}".format(host=self.qemu_host,
user=self.qemu_user,
port=self.qemu_port)])
"--host", f"{self.qemu_user}@{self.qemu_host}:{self.qemu_port}"])
if self.target_info.is_baremetal():
target_info = "libcxx.test.target_info.BaremetalNewlibTI"
else:
Expand Down
3 changes: 1 addition & 2 deletions pycheribuild/projects/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ def ensure_cloned(self, current_project: "Project", *, src_dir: Path, base_proje
default_clone_branch = self.get_default_branch(current_project, include_per_target=False)
assert target_override is not None, "Default src != base src -> must have a per-target override"
assert target_override.branch != default_clone_branch, \
"Cannot create worktree with same branch as base repo: {} vs {}".format(target_override.branch,
default_clone_branch)
f"Cannot create worktree with same branch as base repo: {target_override.branch} vs {default_clone_branch}"
if (src_dir / ".git").exists():
return
current_project.info("Creating git-worktree checkout of", base_project_source_dir, "with branch",
Expand Down
3 changes: 1 addition & 2 deletions test-scripts/run_libcxx_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ def run_parallel_impl(args: argparse.Namespace, processes: "list[LitShardProcess
if len(not_booted_processes) == 0:
boot_cheribsd.success("All shards have booted succesfully. Releasing barrier (num_waiting = ",
mp_barrier.n_waiting, ")")
assert mp_barrier.n_waiting == len(processes), "{} != {}".format(mp_barrier.n_waiting,
len(processes))
assert mp_barrier.n_waiting == len(processes), f"{mp_barrier.n_waiting} != {len(processes)}"
mp_barrier.wait(timeout=10)
boot_cheribsd.success("Barrier has been released, tests should run now.")
# assert target_process.stage < shard_result[2], "STAGE WENT BACKWARDS?"
Expand Down