roadmap

P1: before the tag

An appendix to the milestone.

3. read_bars turns any writable-bits mask into a size, and the size is a power of two only when the mask is contiguous. Where: crates/pci_configuration_space/src/lib.rs lines 401 to 408 and 411 to 419. Why: the specification says the writable bits of a memory BAR are the high bits above the size, and the crate computes size = !mask + 1 on that assumption. A function that answers the probe with a non-contiguous mask, or a 64-bit BAR whose upper dword reads back with no writable bit, gets a Bar whose size is not a power of two and may be near u64::MAX. Every consumer then trusts that size: place_bars aligns to it and checks the window against it, and the capability resolver checks offset + length <= bar.size against it. The proof read_bars_is_total_for_any_device proves no panic in the decoder, which is true, and says nothing about the shape of the answer. Linux and OpenBSD both take the lowest set bit of the masked value as the size, which tolerates a non-contiguous mask; the stricter answer is to refuse one. Fix: compute the size from the lowest set bit of the mask (both BSDs' PCI_MAPREG_MEM_SIZE shape). Return None for a 64-bit BAR whose upper mask is not all-ones above the size (the 64-bit type says the upper dword is address, so a hard-wired zero there is a malformed function). Prefer refusing a non-contiguous mask over tolerating it, since loosening later is compatible and tightening is not. Add a proof a_decoded_bar_size_is_a_power_of_two_of_at_least_sixteen with its falsification patch, and unit tests for a non-contiguous mask and for an upper half that reads zero. Effort: S. Door: two-way.

4. read_bars probes six slots on any header, and a 64-bit type in the sixth slot probes a seventh. Where: crates/pci_configuration_space/src/lib.rs lines 373 to 425 (the loop), :394-399 (the upper half at off + 4). Why: on a type-1 header, slots 2 through 5 are the bus numbers, the I/O base and limit and the memory base and limit. The write-ones probe rewrites them and restores them, which is a transient misrouting of everything behind the bridge. The doc comment says "a type-0 header" and every caller in the tree happens to pass an endpoint found by vendor id or class, but nothing in the signature or the code says so, and Function.header_type is available to say it. Separately, a 64-bit type bit in slot 5 makes the probe read and write offset 0x28, the CardBus CIS pointer, one past the BAR slots. The test a_64_bit_bar_in_the_first_slot_keeps_its_high_half asserts the probe never touches it, but only for a fixture whose slot 5 is not 64-bit. pci_types avoids both by typing the endpoint header separately. Fix: take the header type (or the Function) and return [None; 6] for anything but a type-0 header, documented as the precondition it is. Treat a 64-bit type in slot 5 as malformed and return None for it without probing 0x28. Extend the proof in item 3 with "no read or write beyond `BAR0

5. Names the template's gates refuse at a ceiling of zero. Where and what, each a rename:

6. Names outside the gates that the naming rules still rule against. Where and what, with the recommendation:

7. The documentation assumes this tree, and 26 public items have none. Where: crates/pci_configuration_space/src/lib.rs line 18 (#![allow(missing_docs)] against a 24-item worklist), the undocumented fields of Bdf, BridgeBuses, Function and VirtualIoCapability, and the constants at :45-54, :95, :104, :126, :133-136. Doc comments at :4, :38, :79, :131, :514, :566, :638, :656, :711-713 cite notes/pcie.md, kernel/src/iommu.rs, kernel/src/virtual_io.rs, design/roadmap/0215-..., arch::x86_64::interrupt_controller::initialize_io_apic, tests/qemu_virt_dtb.rs, a bench machine, and milestones 16b, 29, 30, 56, 215, 242 and 320. Why: a stranger cannot follow one of these references, and the template's check / standalone counts them. The crate's two documentation tests are good; nothing else introduces the crate. Fix: document every public item (what it is, which register and bit, which specification section). Replace each tree reference with the specification or with a sentence that stands on its own. Drop the allow. Write the README from item 2 so its EXAMPLES section is the enumerate doctest and its "What is proven" section is the ten harness names in plain words. Effort: M. Door: two-way.

8. The MSI capability walk has no proof, and nothing proves the ceiling. Where: crates/pci_configuration_space/src/lib.rs lines 598 to 619 (msi_capability), :256-303 (walk). Why: msix_capability and virtual_io_capabilities each prove termination on any device; msi_capability is the same loop written a third time, and neither harness covers it. A future edit that drops its hop bound goes unnoticed. One fixture test holds the ceiling property (walk never reads a bus at or above ceiling), and the doc comment argues it. A proof would need the device loop unrolled 32 times per bus and may not finish (unverified), which is the kind of limit the proofs module should state. Fix: add the_message_signaled_interrupt_walk_terminates_on_any_device with a falsification patch; factor the three capability walks over one private capabilities(bdf, read32, &mut dyn FnMut(offset, head) -> bool) so one proof covers all three; try a ceiling proof at ceiling <= 2 and record the result either way in the module's doc comment. Effort: S. Door: two-way.