Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b8d1491
ci: reproducible musl static builds for clone across x86_64 / aarch64…
sysretq0 Nov 10, 2026
e6d58eb
fix: musl portability — route libc ioctl/renameat2/iopl through sys shim
sysretq0 Nov 10, 2026
344ce57
fix(clone-init): gate COM1 port-I/O serial to x86 — arm64 guests have…
sysretq0 Nov 10, 2026
9bb657d
ci: aarch64-musl via plain cargo + rust-lld (no qemu emulation)
sysretq0 Nov 10, 2026
d88d737
feat: arm64 boot path — Image loader + hand-built FDT + vGICv3 (kvmho…
sysretq0 Nov 11, 2026
b6341ba
fix: remaining aarch64-musl errors (wave 2)
sysretq0 Nov 11, 2026
379f15e
fix: E0499 nested &mut in FDT prop(); Self:: qualifier; jailer syscal…
sysretq0 Nov 11, 2026
ab33cde
fix: arm64 module path resolution — modules are not values
sysretq0 Nov 11, 2026
8a72453
fix: arm64 runtime — memory slot @0x40000000, Image header fields, SP…
sysretq0 Nov 11, 2026
6a55ab6
fix: move set_spi_line to module level; fill GuestMem base field
sysretq0 Nov 11, 2026
25faab4
fix: drop redundant explicit format args captured implicitly by named…
sysretq0 Nov 11, 2026
d6c9043
fix(arm64): correct kvm_vcpu_init size and uapi ioctl numbers
sysretq0 Nov 11, 2026
88b92ca
fix(arm64): KvmVcpuInit features literal [u32;7] to match new struct
sysretq0 Nov 11, 2026
d8bcda1
fix(arm64): KVM_ARM_VCPU_INIT nr is 0xAE — ioctl number 0x4020AEAE
sysretq0 Nov 11, 2026
e38ba49
fix(arm64): FDT builder wrote struct/strings past the blob end; PL011…
sysretq0 Nov 11, 2026
216a6dd
fix(arm64): FDT redist region must cover ncpus GICR frames; handle PS…
sysretq0 Nov 11, 2026
25b4bc4
fix(arm64): set KVM_ARM_VCPU_POWER_OFF for non-BSP vCPUs so PSCI CPU_…
sysretq0 Nov 11, 2026
aac5cbd
feat(rootfs): embed guest-kernel modules in the initrd; insmod ext4/v…
sysretq0 Nov 11, 2026
d16ac66
fix(arm64): GIC #interrupt-cells must be 3 — 1 cell garbles all IRQ s…
sysretq0 Nov 11, 2026
1c1472e
fix(virtio): subtract guest-memory base in all GPA→HVA translations (…
sysretq0 Nov 11, 2026
6680d5f
fix(virtio): init VirtioVsock.mem_base field
sysretq0 Nov 11, 2026
f0af01c
fix(arm64): inject virtio kick IRQs as SPIs — raw set_irq_line is IRQ…
sysretq0 Nov 11, 2026
f941bd0
fix(arm64): KVM_IRQ_LINE SPI injection needs INTID (SPI+32), not the …
sysretq0 Nov 11, 2026
b32ccff
debug: log QUEUE_NOTIFY and set_irq_line results (temp)
sysretq0 Nov 11, 2026
c905e7c
debug: log virtio-mmio handle_write inject gate (temp)
sysretq0 Nov 11, 2026
87b4f38
debug: dump vGIC state (CTLR/ISENABLER/ISPENDR/IROUTER) after SPI inj…
sysretq0 Nov 11, 2026
8db2c17
debug: x86 no-op for dbg_vgic_dump_spi
sysretq0 Nov 11, 2026
9360a12
debug: log vgic GET_DEVICE_ATTR errno (temp)
sysretq0 Nov 11, 2026
850ef66
debug: fix KVM_GET_DEVICE_ATTR ioctl number (dir=_IOC_READ=2)
sysretq0 Nov 11, 2026
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
96 changes: 96 additions & 0 deletions .github/workflows/build-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: build-static

# Reproducible musl static builds for `clone` + its guest-side helpers.
#
# The workflow never runs on our own hosts: GitHub Actions runners carry the
# toolchain (rustup targets + cross-rs toolchain container), so developer
# giga machines stay clean of rust toolchain installs entirely.
#
# Targets:
# x86_64-unknown-linux-musl static x86_64 host builds
# aarch64-unknown-linux-musl static arm64 thin-Dom0 host builds (current phone EL2 kernel 5.10)
# arm-unknown-linux-musleabihf static arm32 (experimental; the VMM core is x86-only so this will
# stay red until the arm32 port lands in-tree)

on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
workflow_dispatch:

jobs:
musl-static:
name: static ${{ matrix.target }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
experimental: false
- target: aarch64-unknown-linux-musl
experimental: false
- target: arm-unknown-linux-musleabihf
experimental: true

steps:
- name: Checkout ${{ github.repository }} @ ${{ github.sha }}
uses: actions/checkout@v4

- name: Install Rust stable + ${{ matrix.target }} target
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Cache cargo registry + target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-v1-${{ matrix.target }}
restore-keys: ${{ runner.os }}-cargo-v1-

- name: cross-rs setup
uses: taiki-e/install-action@v2
with:
tool: cross

- name: cargo build (static musl) — workspace
if: matrix.target != 'aarch64-unknown-linux-musl'
run: |
cross build --release --target ${{ matrix.target }} --workspace

- name: cargo build (static musl) — aarch64, plain cargo + rust-lld
# cross's user-mode emulation of aarch64 build scripts dies against
# the host glibc (gettid GLIBC_2.30 relocation). Plain cargo compiles
# build scripts on the host and links the final binaries against the
# musl libc that ships inside the rustup target — self-contained,
# no cross gcc or qemu needed.
if: matrix.target == 'aarch64-unknown-linux-musl'
run: |
cargo build --release --target aarch64-unknown-linux-musl --workspace \
--config 'target.aarch64-unknown-linux-musl.linker="rust-lld"'

- name: static-link sanity check (file + ldd)
run: |
for b in clone clone-init clone-agent; do
f=target/${{ matrix.target }}/release/$b
if [ -f "$f" ]; then
echo "== $b =="
file "$f"
if command -v ldd >/dev/null; then ldd "$f" || true; fi
else
echo "MISSING expected binary: $f"
fi
done

- name: Upload artifact — ${{ matrix.target }}
uses: actions/upload-artifact@v4
with:
name: clone-${{ matrix.target }}
path: target/${{ matrix.target }}/release/clone*
if-no-files-found: warn
30 changes: 25 additions & 5 deletions crates/clone-init/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ fn msg(s: &str) {
}

/// Write a string directly to COM1 (I/O port 0x3F8) using port I/O.
/// Requires iopl(3) to have been called first.
#[cfg(target_os = "linux")]
/// Requires iopl(3) to have been called first. x86-only: port I/O has no
/// arm64 equivalent (guest earlycon there is PL011 MMIO, reachable via
/// /dev/console once the kernel has it mapped).
#[cfg(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86")))]
fn serial_write(s: &str) {
for &b in s.as_bytes() {
// Wait for THR empty (LSR bit 5)
Expand All @@ -57,18 +59,20 @@ fn serial_write(s: &str) {
}
}

#[cfg(not(target_os = "linux"))]
#[cfg(not(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86"))))]
fn serial_write(_s: &str) {}

/// Call iopl(3) to enable I/O port access for direct serial writes.
#[cfg(target_os = "linux")]
/// x86-only syscall: on aarch64 (and any other arch) libc doesn't even
/// declare it — early serial out there goes through /dev/console instead.
#[cfg(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86")))]
fn enable_iopl() {
unsafe {
libc::iopl(3);
}
}

#[cfg(not(target_os = "linux"))]
#[cfg(not(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "x86"))))]
fn enable_iopl() {}

fn main() {
Expand Down Expand Up @@ -106,6 +110,22 @@ fn main() {
if Path::new("/lib/modules/overlay.ko").exists() {
load_module("/lib/modules/overlay.ko");
}
// Boot-critical modules for kernels where ext4/virtio are =m (Debian
// arm64). Dependency order matters: crc32c -> crc16 -> jbd2 -> mbcache
// -> ext4; virtio_mmio/virtio_blk have no deps (core virtio built-in).
for module in &[
"/lib/modules/crc32c-cryptoapi.ko",
"/lib/modules/crc16.ko",
"/lib/modules/jbd2.ko",
"/lib/modules/mbcache.ko",
"/lib/modules/ext4.ko",
"/lib/modules/virtio_mmio.ko",
"/lib/modules/virtio_blk.ko",
] {
if Path::new(module).exists() {
load_module(module);
}
}

// Parse kernel command line
let cmdline = read_cmdline();
Expand Down
Loading
Loading