me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Allow KVM for matching-architecture package guests

diviocity committed 5 days ago · daee226afba9244c07085305f54b0437890f82c5 View patch
Unverified signature 2 files changed +7 -2
tests/FEED.md +1 -1

@@ -155,6 +155,6 @@ Changing the netbase archive after signing caused assembly to fail its signed in

155155

156156The installed-root auditor checks each nonempty ELF load segment against the released kernel page size, 4 KiB on x86_64 and 16 KiB on aarch64. It also checks required symbol-version namespaces against the actual resolved package-owned provider using GNU readelf and objdump. The 106-package x86_64 root and the corrected arm64 loader passed. An old arm64 BusyBox failed its segment congruence check. An x86_64 libcrypto with its original SONAME and a changed version tag failed the OpenSSL consumer check. See `foundation/load-and-versions-02`, receipt SHA-256 `fd32f6b69db215ff6b79ec1f58c8457cf7f514dd162fbde410d9f6882072b979`. Use `tests/exec-linkage.py` as well to exercise actual dynamic symbol resolution.

157157

158-Run the target vpac binary on the release kernel with `python3 tests/vpac-guest.py "$arch" "$repo" "$test_keys" "$fingerprint_file" "$update_receipt" "$auditor" "$boot" "$iso" "$output"`. Use a signed initial feed containing netbase and CA bundle release 2 and pass the receipt for CA bundle release 3. The guest has no network interface. The fixture tests a same-length package modification, authentic installation, local and remote lookup, and a signed in-place upgrade. Pass `--scenario install` or `--scenario upgrade` to replay either operation on a fresh copy of the same image inputs. The runner defaults to 720 seconds under QEMU TCG. `VINIX_QEMU_TIMEOUT` overrides that limit in seconds.

158+Run the target vpac binary on the release kernel with `python3 tests/vpac-guest.py "$arch" "$repo" "$test_keys" "$fingerprint_file" "$update_receipt" "$auditor" "$boot" "$iso" "$output"`. Use a signed initial feed containing netbase and CA bundle release 2 and pass the receipt for CA bundle release 3. The guest has no network interface. The fixture tests a same-length package modification, authentic installation, local and remote lookup, and a signed in-place upgrade. Pass `--scenario install` or `--scenario upgrade` to replay either operation on a fresh copy of the same image inputs. The runner defaults to 720 seconds under QEMU TCG. `VINIX_QEMU_TIMEOUT` overrides that limit in seconds. Set `VINIX_QEMU_ACCEL=kvm` when the host matches the guest architecture and the worker can open `/dev/kvm`.

159159

160160To exercise the original release binaries against the installed libraries on a worker of the same architecture, run `python3 tests/exec-linkage.py "$arch" "$client" "$auditor" --proot "$proot" --release "$archive" "$sha256" "$report"`. The probe binds one original executable over its guest path and runs the installed musl loader with `--list`. A negative control changed a library import in the original input and verified that the installed loader diagnosed the changed SONAME. In the 129-package x86_64 root, 52 of 95 dynamic image executables relocated, 27 reported failures and 16 fixed-address executables needed direct execution. Twelve of 17 X11 sidecar executables relocated. See `foundation/release-binary-relocation-02`, receipt SHA-256 `8483666ef4294f1ac5d44c1eb637a8f5200be4e613e635d835ef4f86e7ffa37b`. Directly starting the release `cpp` and `cc1` in that root expanded `__SIZEOF_POINTER__` to 8. See `foundation/release-original-exec-02`, receipt SHA-256 `b9f1659e4669df9f3d4aeddea37fd9b85abc40f9d55045fff1fc7096f091a209`.

tests/busybox/boot.v +6 -1

@@ -25,6 +25,11 @@ fn boot_image(root string, iso string, output string, mode string, fixture strin

2525 userland := mode in ['--userland', '--aarch64-userland'] || fixture != ''

2626 musl := mode in ['--musl', '--aarch64-musl']

2727 machine := if arm { 'aarch64' } else { 'x86_64' }

28+ acceleration := os.getenv_opt('VINIX_QEMU_ACCEL') or { 'tcg' }

29+ if acceleration !in ['tcg', 'kvm'] || (acceleration == 'kvm' && os.uname().machine != machine) {

30+ return error('VINIX_QEMU_ACCEL must be tcg or kvm on a matching host')

31+ }

32+ cpu := if acceleration == 'kvm' { 'host' } else { 'max' }

2833 loader := '/lib/ld-musl-${machine}.so.1'

2934 if root == '/' || output == root || output.starts_with(root + '/') {

3035 return error('place the output outside a separate BusyBox package root')

@@ -132,7 +137,7 @@ fn boot_image(root string, iso string, output string, mode string, fixture strin

132137 } else {

133138 '1024'

134139 }

135- emulator << ['-accel', 'tcg', '-cpu', 'max', '-m', memory, '-smp', '2', '-nic', 'none', '-display',

140+ emulator << ['-accel', acceleration, '-cpu', cpu, '-m', memory, '-smp', '2', '-nic', 'none', '-display',

136141 'none', '-monitor', 'none', '-serial', 'file:' + log, '-no-reboot']

137142 run(['timeout', '${deadline}s', ...emulator])!

138143 lines := os.read_lines(log)!.map(it.trim_space())