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
- The lookup is transport-blind, and the ordering is the contract that made it safe.
virtio::find_block_device_nwalked virtio-mmio slots and returned aVirtualIoMmioDevice. It now returns aBlockDevice(provisional name): a resolvedTransport, the interrupt to bind, and the IOMMU requester id when there is one, which are exactly the three thingsfs_service::spawn_block_serverandvirtual_io_service::wirealready needed.fs_service::spawn_block_servertakes 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.
- The runner attaches the fixture.
helpers/qemu-runner-x86_64.shattaches-redoxfs.imgas a secondvirtio-blk-pcifunction, behind the sameiommu_platform=onthe first one uses, andcargo xtask test's x86_64 leg callsmkredoxfsso a fresh fixture exists to attach. The order of the two-devicearguments is load-bearing (q35has 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.
- 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::registeralready takes anOption<rid>andiommu::confinealready builds one domain per requester id. The second disk's rid (0x20, for00:04.0) is carried through frompci::find_block_device_nthe 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:
- The kernel's own fault register records
rid 0x18, code 0x2, addr 0xffde000.0x18is00:03.0, the first virtio-blk function, the one the PCIe transport tests own and which nothing brought up in this run. Fault code 2 is "the context entry is not present": the unit was asked to translate for a device that has no domain, and refused. - It is logged at confine time, before any block I/O, immediately after
virtio::registerbuilds the second disk's domain and invalidates. That is the shape of QEMU replaying mappings into every address space it has instantiated, not of a transfer going astray. - With only one virtio-blk function on the bus,
ripgrepruns and prints the same 62 bytes and no fault is logged at all. The fault needs an unclaimed function beside a claimed one. That is a configuration no architecture in this tree had before today.
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
- A positional ordinal shifts silently when a fixture is missing, and the fall-through to PCI
widened what it can shift into.
find_block_device_n(2)means "the third block device", not "the crash disk". On a boot where the runner built no crash image, ordinal 2 used to resolve to the GPT disk. It can now resolve to a virtio-pci function instead, and resolving a PCI ordinal brings the function up (sizes its BARs, enables bus mastering) where the mmio half reads two identity registers. Every runner in this tree builds every fixture, so no gate meets it. The contract is documented onfind_block_device_nitself. The fix is a wiring that names a disk rather than counting to it, which is milestone 57's roster half-built already and not this milestone's work. - The suite under real firmware still has no RedoxFS disk.
helpers/qemu-uefi-x86_64.shattaches the nifefs image and the NVMe controller only, socargo xtask uefi-testis unchanged at 208 / 69 while the PVH leg is at 237 / 40. The twenty-nine tests this milestone recovered are recovered on one of the two x86_64 boots. Adding the disk there is one-deviceline and a claim about firmware rather than about QEMU's loader, which is worth its own run. - x86_64 gets one fixture of five. The RedoxFS image is attached; milestone 37's crash disk and
milestone 57's GPT and blank disks are not, so
crash_disk_present,disk_service::startanddisk_service::blank_diskstill answer "no such disk" on this architecture and their tests still skip. Nothing structural is in the way now that the lookup spans both buses: it is three more-devicelines and three moremk*diskcalls, deliberately not taken here so that one milestone proves one thing. - An unclaimed virtio function on the bus is refused one request at a time rather than confined
once. The VT-d record above is correct behavior with an avoidable shape: a function nothing
drives has no context entry, so every DMA it attempts faults individually and QEMU's log is the
only place a reader meets it. Entering every enumerated function into an empty domain at boot
would make default-deny explicit. It would turn the log line into a fault the kernel raised on purpose.
That is a change to the confinement posture on three architectures and is a proposal
(
design/roadmap/proposals/an-unclaimed-function-behind-the-iommu.md), not a fix smuggled in here. BlockDeviceis a provisional name, along withvirtio::find_block_device_n's widened meaning andpci::find_block_device_n. calef names types and public functions (AGENTS.md); this lane shipped names and says so rather than waiting.- The x86_64
ripgrepbinary is not in any gate.helpers/build-ripgrep.shfetches from crates.io and nothing inscript/testruns it, so the transcript above is reproducible only after somebody buildsrg. That is DECISIONS §46's posture and unchanged by this milestone; what changed is that building it is now sufficient.
Follow-on
- Milestone 325. An unclaimed PCI function behind the IOMMU gets an empty domain rather than a fault per request, in. The VT-d record above is correct behavior reached by absence, and making it a decision would turn a QEMU log line into a fault the kernel raised on purpose.
- Milestone 420. The remaining x86_64 fixtures and devices (milestone 37's crash disk, milestone
57's GPT and blank disks, and the NIC, GPU, keyboard and RNG milestone 215 listed). Nothing
structural is in the way
now that the lookup spans both buses; it is
-devicelines andmk*diskcalls, left out here so that one milestone proves one thing. - Done.
design/fatal-risks/README.mdrisk 1 now reads green on all three architectures instead of two, and this lane made that edit rather than leaving it to the integrator, because the gate required it. A developer does not editdesign/outside its own roadmap block (AGENTS.md), so the intention was to name it here and stop.script/lint's fatal-risks check refused: risk 1 cited the proposal this milestone consumed, and the check's own message is that "a proposal cited as pending work stops existing the day it is promoted to a numbered milestone". The same forced the two**Proposed.**dispositions in blocks 121 and 184 that named the same file; both are now**Milestone 303.**and nothing else in either block was touched. Three edits outside this block, each one a consequence of the promotion rather than a judgment about somebody else's milestone, and all three named here so a reviewer can find them without reading the diff. - Done. Every test that needs a directory capability now runs on three architectures rather than
two,
std_exerciser'sstd::fshalf among them. Milestone 87 (the x86_64 bare-metal machine) gains a boot that mounts a real filesystem rather than one that finds no disk.
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.