From 6acd208f75ca5fde54a94b0ca50998d7a250cafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20S=C5=82omi=C5=84ski?= Date: Wed, 30 Oct 2024 13:31:36 +0100 Subject: [PATCH 1/4] nic: Disable freebsd-e1000 driver on AArch64 To be done, needs port IO on some cards. --- drivers/nic/freebsd-e1000/meson.build | 4 ++++ servers/netserver/meson.build | 10 ++++++++-- servers/netserver/src/main.cpp | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/nic/freebsd-e1000/meson.build b/drivers/nic/freebsd-e1000/meson.build index d9ee61584..e44fab53c 100644 --- a/drivers/nic/freebsd-e1000/meson.build +++ b/drivers/nic/freebsd-e1000/meson.build @@ -1,3 +1,7 @@ +if host_machine.cpu_family() != 'x86_64' + subdir_done() +endif + import = subproject('freebsd-e1000') inc = ['../../../servers/netserver/include', 'include'] diff --git a/servers/netserver/meson.build b/servers/netserver/meson.build index a72d91715..74dd0cb42 100644 --- a/servers/netserver/meson.build +++ b/servers/netserver/meson.build @@ -14,9 +14,15 @@ src = [ inc = [ 'include', 'src' ] +dep = [ fs_proto_dep, mbus_proto_dep, svrctl_proto_dep, nic_virtio_dep, + nic_usb_net_dep, nic_rtl8168_dep, core_dep ] + +if host_machine.cpu_family() == 'x86_64' + dep += nic_freebsd_e1000_dep +endif + executable('netserver', src, - dependencies : [ fs_proto_dep, mbus_proto_dep, svrctl_proto_dep, nic_virtio_dep, - nic_usb_net_dep, nic_rtl8168_dep, nic_freebsd_e1000_dep, core_dep ], + dependencies : dep, include_directories : inc, install : true ) diff --git a/servers/netserver/src/main.cpp b/servers/netserver/src/main.cpp index 9e5c67c31..e5123634f 100644 --- a/servers/netserver/src/main.cpp +++ b/servers/netserver/src/main.cpp @@ -27,7 +27,9 @@ #include #include #include -#include +#ifdef __x86_64__ +# include +#endif #include #include @@ -179,8 +181,10 @@ async::result doBindPci(mbus_ng::Entity baseEntity) { device = co_await setupVirtioDevice(baseEntity, std::move(hwDevice)); } else if(determineRTL8168Support(vendor_str->value, device_str->value)) { device = nic::rtl8168::makeShared(std::move(hwDevice)); +#ifdef __x86_64__ } else if(vendor_str->value == VENDOR_INTEL) { device = nic::e1000::makeShared(std::move(hwDevice)); +#endif } else { std::cout << std::format("netserver: skipping PCI device {}:{}\n", vendor_str->value, device_str->value); co_return protocols::svrctl::Error::deviceNotSupported; From a03929c923045fd943d06f96f13dc441dc9d8461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20S=C5=82omi=C5=84ski?= Date: Wed, 30 Oct 2024 13:32:20 +0100 Subject: [PATCH 2/4] thor: Add missing methods to UartLogHandler on AArch64 --- kernel/thor/arch/arm/debug.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/thor/arch/arm/debug.cpp b/kernel/thor/arch/arm/debug.cpp index 8adcbeedd..26cce96d4 100644 --- a/kernel/thor/arch/arm/debug.cpp +++ b/kernel/thor/arch/arm/debug.cpp @@ -39,4 +39,11 @@ void UartLogHandler::printChar(char c) { space.store(reg::data, c); } +void UartLogHandler::setPriority(Severity prio) { + (void)prio; +} + +void UartLogHandler::resetPriority() { +} + } // namespace thor From afc628d28e942a27d3be45868fde8d74b102fe06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20S=C5=82omi=C5=84ski?= Date: Wed, 30 Oct 2024 13:32:43 +0100 Subject: [PATCH 3/4] posix: Detach when waiting for power management lane This never comes up on AArch64 due to no ACPI. --- posix/subsystem/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posix/subsystem/src/main.cpp b/posix/subsystem/src/main.cpp index f2869307a..8ab80966c 100644 --- a/posix/subsystem/src/main.cpp +++ b/posix/subsystem/src/main.cpp @@ -159,7 +159,7 @@ async::result enumeratePm() { async::detached runInit() { co_await enumerateKerncfg(); - co_await enumeratePm(); + async::detach(enumeratePm()); co_await clk::enumerateTracker(); async::detach(net::enumerateNetserver()); co_await populateRootView(); From 7d7a3cdae8134fb33c944fe53494661cf18382c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20S=C5=82omi=C5=84ski?= Date: Wed, 30 Oct 2024 13:37:03 +0100 Subject: [PATCH 4/4] github: Install y4 and switch to Ubuntu 24.04 for CI workflows --- .github/workflows/ci.yml | 9 +++++++-- .github/workflows/docs.yml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 362afea9c..554cf21fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,14 +48,19 @@ jobs: mlibc mlibc-headers name: Build ${{ matrix.pkg }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: + - name: Permit unprivileged user namespaces + run: | + set -x + sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 - name: Install prerequisites run: | set -x sudo apt-get update sudo apt-get install qemu-system-x86 pcre2-utils - pip3 install xbstrap + pip3 install xbstrap y4 xbstrap prereqs cbuildrt xbps - name: Check for requested bootstrap-managarm PR env: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e987f2f64..6210e300e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build-docs: name: Build documentation - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Install prerequisites run: |