roadmap BUILT

303. x86_64's FS service has a server and no disk it can find

Promoted from design/roadmap/proposals/an-fs-service-with-no-disk-on-x86-64.md, written by milestone 184's lane on 2026-09-14. Minted Gate: NONE, on the grounds that milestone 215 had already routed a PCI function's interrupt to a userspace driver on this port and milestone 164 had already packed redoxfs_server in the x86_64 archive, so nothing here needed a board. That held: the whole milestone was made on patagonia.

The title is a statement about the past. x86_64's FS service mounts a RedoxFS image off a virtio-blk-pci function, std::fs runs there, and unmodified ripgrep 14.1.1 prints the same 62 bytes it prints on aarch64 and riscv64.

The result that was the point

design/fatal-risks/README.md risk 1 ("only software written for nife runs on nife") had two legs of three. Here is the third, from the x86_64 leg of script/test:

test kernel::user::ripgrep_tests::unmodified_ripgrep_runs_and_has_no_arguments_to_run_on ...
    rg printed 62 bytes:
rg: ripgrep requires at least one pattern to execute a search

ok

Byte for byte what the other two architectures print, from a third separately built binary (4.1 MB, zero source changes, helpers/build-ripgrep.sh and nothing else). Compared rather than recalled: rg was built for all three triples on this tree and the test run on each, and the three transcripts hash to one value (fa4b3016bc8a8335d12df349facc4379), 62 bytes, cmp clean in both directions. Three ELFs of three different instruction sets, 4.7, 10.7 and 4.1 MB, from the same unpatched crates.io source. notes/ripgrep-on-nife.md's parity table now reads "built and run" on all three rows. Risk 1's green no longer needs the words "on two of three architectures" that DECISIONS §19 would have made an overclaim.

The three pieces the proposal named

  1. The lookup is transport-blind, and the ordering is the contract that made it safe. virtio::find_block_device_n walked virtio-mmio slots and returned a VirtualIoMmioDevice. It now returns a BlockDevice (provisional name): a resolved Transport, the interrupt to bind, and the IOMMU requester id when there is one, which are exactly the three things fs_service::spawn_block_server and virtual_io_service::wire already needed. fs_service::spawn_block_server takes that instead of an mmio slot, which is the transport seam doing for the FS server's disk what it already did for the PCIe transport tests' disk.

The ordering is mmio slots in slot order, then modern virtio-pci functions in bus:device.function order. It was chosen rather than invented: it is the order disk_service::devices already lists the milestone-57 roster in, and that function's own comment already called the agreement between a listing and a wiring a promise. So the flat ordinal is the roster's row index, and the two records cannot drift.

Nothing moved on aarch64 or riscv64, and the reason is structural rather than lucky. Both virt boards carry five virtio-mmio block devices. Every ordinal any wiring asks for (0 the nifefs disk, 1 the RedoxFS image, 2 milestone 37's crash disk, 3 and 4 milestone 57's GPT and blank disks) is answered before the PCI half of the ordering is reached. Measured, not asserted: both legs pass unchanged, below.

  1. The runner attaches the fixture. helpers/qemu-runner-x86_64.sh attaches -redoxfs.img as a second virtio-blk-pci function, behind the same iommu_platform=on the first one uses, and cargo xtask test's x86_64 leg calls mkredoxfs so a fresh fixture exists to attach. The order of the two -device arguments is load-bearing (q35 has no mmio bus, so ordinal 0 is the nifefs image and ordinal 1 the RedoxFS one) and the file says so where a reader meets it.

The end-of-run image consistency check now runs for --arch x86_64 too, on the RedoxFS image alone: that leg writes it, so the check has a subject. The crash and blank images stay aarch64's and riscv64's. No x86_64 runner attaches those fixtures, and a check whose subject did not happen is worse than no check.

And the test that writes the disk had to be widened, which the proposal did not foresee. std_fs_reads_a_file_through_a_granted_directory_capability was #[cfg(target_arch = "aarch64")], with riscv64 keeping its own copy in riscv_virtual_io_tests; x86_64 ran neither, so the std::fs half this milestone exists to exercise would have been compiled and skipped on the one architecture that had just been given a disk. It now runs on x86_64 as well. That is also what keeps xtask::redoxfs_check_after_run honest: it is the only thing on this leg that writes scratch, and the x86_64 leg runs last and regenerates the fixture. Without it the end-of-run host check would open an image whose write never happened. The rest of the family (the per-file grant attacks) stays on two architectures, for the "a second copy proves nothing new" reason those tests already carry.

  1. VT-d wanted nothing. This was the piece the proposal could not price, and the answer is that a second function behind the IOMMU needs no new mechanism: virtio::register already takes an Option<rid> and iommu::confine already builds one domain per requester id. The second disk's rid (0x20, for 00:04.0) is carried through from pci::find_block_device_n the same way the first one's always was, and the block server's 17-page DMA region is confined before the device is entered in the table. Two virtio functions on one bus, each in its own domain, is the first time this tree has done that on any architecture.

What the second function on the bus turned out to say, which is a finding

Wiring the disk produced one line of QEMU stderr that milestone 164's lane had also seen and could not explain:

qemu-system-x86_64: vtd_iommu_translate: detected translation failure (dev=00:03:00, iova=0xffde000)

It is the IOMMU refusing a device this kernel does not drive, which is default-deny working. Three measurements say so and they were worth taking, because "an unexplained IOMMU fault beside a confinement claim" is the shape of exactly the finding this project must not tidy away:

215's reading of the neighboring Interrupt Mask set, irq is not generated line was right and this is its sibling. Both come out of the VT-d unit itself. Neither is a confinement gap. What is new is the recommendation below, that an unclaimed function should be confined to an empty domain rather than left to be refused one request at a time.

What it delivered, measured

script/test, green end to end (exit 0, the post-run RedoxFS consistency check included), against the same command on the base commit this branch was cut from (4aad545e), also green, on this machine an hour earlier:

leg after before
aarch64 321 passed, 2 skipped 320 passed, 3 skipped
riscv64 328 passed, 1 skipped 327 passed, 2 skipped
x86_64 (PVH) 238 passed, 40 skipped 208 passed, 69 skipped
x86_64 (OVMF) 208 passed, 69 skipped 208 passed, 69 skipped

The before column is a measured run, not a recollection, and the two device-tree rows move by exactly one test each for a reason that is not this milestone. It is ripgrep_tests, which skipped in the baseline because rg had been built for x86_64-unknown-nife only at that point and was built for all three triples afterwards. helpers/build-ripgrep.sh is not part of any gate (DECISIONS §46 (thin primitives or whole subsystems)), so which triples carry an rg is a property of the machine rather than of the tree. This branch run in the baseline's configuration reads 320 / 3 and 327 / 2 exactly. Both were measured that way before the binaries existed. Nothing this milestone changed moves either leg. That is what DECISIONS §19 wanted from a change that widened a lookup they both depend on.

Thirty x86_64 tests moved into the pass column and twenty-nine out of the skip column, and the one that is in neither count is std_fs_reads_a_file_through_a_granted_directory_capability, which did not exist on this architecture before (277 tests compiled here, now 278). Unlike milestone 164's eleven, the twenty-nine really ran: they are skip!() sites that now execute, and they are what a directory capability unlocks (dir_capability_tests, login_tests, rm_program_tests, sink_tests, shell_navigation_tests, session_reviver_tests) plus ripgrep_tests.

The OVMF row did not move, and that is a gap rather than a result. helpers/qemu-uefi-x86_64.sh attaches the nifefs -pci.img and the NVMe controller and no RedoxFS image, so the suite under real firmware still takes the "no RedoxFS disk attached" arm throughout. It is one -device line in that script, deliberately not added here: milestone 195 put the suite under firmware to prove the kernel works on a machine whose PCIe window and ACPI root came from firmware. Adding a disk to it is a claim about firmware that wants its own run rather than a line smuggled into a milestone whose subject is the PVH leg. Recorded below.

BUGS

Follow-on

Index row

x86_64's FS service mounts a real RedoxFS image and unmodified ripgrep 14.1.1 prints the same 62 bytes there that it prints on aarch64 and riscv64. That is the third leg design/fatal-risks/README.md risk 1 was waiting on and the one DECISIONS §19 would not let the other two claim without. Three pieces, and the ordering was the only hard one: virtio::find_block_device_n now spans both buses, ordered mmio-slots-then-PCI-functions, which is the order milestone 57's roster already promised its readers. aarch64 and riscv64 resolve every ordinal they ever did before the PCI half is reached and neither leg moved. VT-d wanted no new mechanism, only a second requester id. The unexplained QEMU fault milestone 164 (x86_64 userspace can't build aes) saw is now explained and measured. It is the unit refusing a virtio function nothing drives (rid 0x18, context entry not present, logged at confine time and absent entirely when that function is not on the bus). That is default-deny working rather than a confinement gap.