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

Revert "Default to purecap kernels for CheriBSD" #397

Merged
merged 1 commit into from
May 9, 2024
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
2 changes: 1 addition & 1 deletion pycheribuild/projects/cross/cheribsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ def setup_config_options(cls, kernel_only_target=False, install_directory_help=N
_allow_unknown_targets=True,
only_add_for_targets=cls.purecap_kernel_targets,
kind=KernelABI,
default=KernelABI.PURECAP,
default=KernelABI.HYBRID,
enum_choices=[KernelABI.HYBRID, KernelABI.PURECAP],
help="Select default kernel to build",
)
Expand Down
54 changes: 29 additions & 25 deletions tests/test_argument_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def test_kernconf():
freebsd_native = _get_target_instance("freebsd-amd64", config, BuildFreeBSD)
assert config.freebsd_kernconf is None
assert freebsd_riscv.kernel_config == "QEMU"
assert cheribsd_riscv_hybrid.kernel_config == "CHERI-PURECAP-QEMU"
assert cheribsd_riscv_hybrid.kernel_config == "CHERI-QEMU"
assert freebsd_native.kernel_config == "GENERIC"

# Check that --kernconf is used as the fallback
Expand Down Expand Up @@ -816,23 +816,20 @@ def test_disk_image_path(target, expected_name):
pytest.param(
"cheribsd-riscv64-purecap",
["--cheribsd/no-build-alternate-abi-kernels"],
["CHERI-PURECAP-QEMU"],
["CHERI-QEMU"],
),
pytest.param(
"cheribsd-riscv64-purecap",
["--cheribsd/build-fpga-kernels"],
[
"CHERI-PURECAP-QEMU",
"CHERI-QEMU",
"CHERI-PURECAP-QEMU",
],
),
pytest.param(
"cheribsd-riscv64-purecap",
[],
[
"CHERI-PURECAP-QEMU",
"CHERI-QEMU",
],
["CHERI-QEMU", "CHERI-PURECAP-QEMU"],
),
pytest.param(
"cheribsd-riscv64-purecap",
Expand All @@ -846,34 +843,35 @@ def test_disk_image_path(target, expected_name):
"cheribsd-riscv64-purecap",
["--cheribsd/build-fett-kernels", "--cheribsd/no-build-alternate-abi-kernels"],
[
"CHERI-PURECAP-QEMU",
"CHERI-QEMU",
"CHERI-QEMU-FETT",
],
),
pytest.param(
"cheribsd-riscv64-purecap",
["--cheribsd/build-fett-kernels"],
[
"CHERI-PURECAP-QEMU",
"CHERI-QEMU",
"CHERI-QEMU-FETT",
"CHERI-PURECAP-QEMU",
],
),
pytest.param(
"cheribsd-riscv64-purecap",
["--cheribsd/build-bench-kernels", "--cheribsd/no-build-alternate-abi-kernels"],
[
"CHERI-PURECAP-QEMU",
"CHERI-PURECAP-QEMU-NODEBUG",
"CHERI-QEMU",
"CHERI-QEMU-NODEBUG",
],
),
pytest.param(
"cheribsd-riscv64-purecap",
["--cheribsd/build-bench-kernels"],
[
"CHERI-PURECAP-QEMU",
"CHERI-PURECAP-QEMU-NODEBUG",
"CHERI-QEMU",
"CHERI-QEMU-NODEBUG",
"CHERI-PURECAP-QEMU",
"CHERI-PURECAP-QEMU-NODEBUG",
],
),
pytest.param(
Expand All @@ -884,19 +882,20 @@ def test_disk_image_path(target, expected_name):
"--cheribsd/no-build-alternate-abi-kernels",
],
[
"CHERI-PURECAP-QEMU",
"CHERI-PURECAP-FETT",
"CHERI-QEMU",
"CHERI-QEMU-FETT",
"CHERI-FETT",
],
),
pytest.param(
"cheribsd-riscv64-purecap",
["--cheribsd/build-fett-kernels", "--cheribsd/build-fpga-kernels"],
[
"CHERI-PURECAP-QEMU",
"CHERI-QEMU",
"CHERI-QEMU-FETT",
"CHERI-PURECAP-FETT",
"CHERI-PURECAP-QEMU",
"CHERI-FETT",
"CHERI-PURECAP-FETT",
],
),
pytest.param(
Expand All @@ -907,14 +906,16 @@ def test_disk_image_path(target, expected_name):
# Morello kernconf tests
pytest.param("cheribsd-aarch64", [], ["GENERIC"]),
pytest.param(
"cheribsd-morello-purecap", ["--cheribsd/no-build-alternate-abi-kernels"], ["GENERIC-MORELLO-PURECAP"]
"cheribsd-morello-purecap",
["--cheribsd/no-build-alternate-abi-kernels"],
["GENERIC-MORELLO"],
),
pytest.param(
"cheribsd-morello-purecap",
[],
[
"GENERIC-MORELLO-PURECAP",
"GENERIC-MORELLO",
"GENERIC-MORELLO-PURECAP",
],
),
pytest.param(
Expand Down Expand Up @@ -957,16 +958,19 @@ def test_kernel_configs(target, config_options: "list[str]", expected_kernels: "
"--cheribsd-mfs-root-kernel-riscv64-purecap/build-fpga-kernels",
"--cheribsd-mfs-root-kernel-riscv64-purecap/no-build-alternate-abi-kernels",
],
["CHERI-PURECAP-QEMU-MFS-ROOT", "CHERI-PURECAP-GFE"],
[
"CHERI-QEMU-MFS-ROOT",
"CHERI-GFE",
],
),
pytest.param(
"cheribsd-mfs-root-kernel-riscv64-purecap",
["--cheribsd-mfs-root-kernel-riscv64-purecap/build-fpga-kernels"],
[
"CHERI-PURECAP-QEMU-MFS-ROOT",
"CHERI-QEMU-MFS-ROOT",
"CHERI-PURECAP-GFE",
"CHERI-PURECAP-QEMU-MFS-ROOT",
"CHERI-GFE",
"CHERI-PURECAP-GFE",
],
),
pytest.param(
Expand All @@ -992,10 +996,10 @@ def test_kernel_configs(target, config_options: "list[str]", expected_kernels: "
"cheribsd-mfs-root-kernel-riscv64-purecap",
["--cheribsd/build-nocaprevoke-kernel"],
[
"CHERI-PURECAP-QEMU-MFS-ROOT",
"CHERI-PURECAP-NOCAPREVOKE-QEMU-MFS-ROOT",
"CHERI-QEMU-MFS-ROOT",
"CHERI-NOCAPREVOKE-QEMU-MFS-ROOT",
"CHERI-PURECAP-QEMU-MFS-ROOT",
"CHERI-PURECAP-NOCAPREVOKE-QEMU-MFS-ROOT",
],
),
],
Expand Down Expand Up @@ -1327,7 +1331,7 @@ def test_mfs_root_kernel_inherits_defaults_from_cheribsd():
],
)
assert cheribsd_riscv64_purecap.kernel_config == "BASE_CONFIG_RISCV64"
assert cheribsd_riscv64_hybrid.kernel_config == "CHERI-PURECAP-QEMU"
assert cheribsd_riscv64_hybrid.kernel_config == "CHERI-QEMU"
assert mfs_riscv64.kernel_config is None
assert mfs_riscv64_hybrid.kernel_config == "MFS_CONFIG_RISCV64_HYBRID"
_parse_arguments(
Expand Down
Loading