Repository navigation
PCI root bridges are acpiserver's declaration: each root's _CRS windows and _OSC offer, held by the kernel; the loader's window reads go (PCI apertures stage B) - #935
Conversation
…clare, pcidev state) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
# Conflicts: # kernel/src/pcidev/mod.rs # lib/acpi/tests/resource.rs
…vers map at identity Work in progress before review; the PR body states the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
…the _OSC grant Ruled for lifecycle stage 2, which arms hot-plug ports under a granting root: acpiserver negotiates each root's _OSC under the PCI host bridge UUID (PCI Firmware Specification 3.3 section 4.5) in the pass that reads its _CRS, and the kernel keeps the records and says each grant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
# Conflicts: # kernel/src/arch/aarch64/smmu/domain.rs # kernel/src/arch/x86_64/amdvi/domain.rs # kernel/src/arch/x86_64/amdvi/mod.rs # kernel/src/pcidev/mod.rs # tests/toyos.rs
|
Metal at
|
…eclaration fails every metal boot The AMD bench's root has more memory windows than the per-root bound of 8, so at 4f5142f its declaration was refused, every claim on it would have been, and no row saw it: its boot claims nothing and its row judges kernel-driven domains. The windows are now one list of 64 across every root; acpiserver says each root's count and its _CRS bytes under OWN, so the bench's next boot records them. Every metal boot now fails on the kernel's refused-declaration record, and the AMD row requires the declaration. The host bridge _OSC tests gain QEMU q35's masked shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
Review of #935 at
|
…ried only, the no-acpi-row loss recorded - A declaration whose records the ABI does not name (a count or run past its array, an unnamed _OSC word, a reversed bus range) or whose roots share a bus on one segment is refused through Held like any other refusal: logged, posted, and the answer (toyos_pci::aperture::records). - The root _OSC is a query alone and its offer is recorded; the hot-plug service that acts on native hot-plug control (#934) commits it, so the osc module's condition holds. - issues/an-x86-machine-with-no-acpi-row-hands-over-no-pci-claim.md. - window.rs: Addresses::map's contract stated per arm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
Owner ruling: the kernel stops driving PCI functions (step 10) before this lands, so no kernel driver needs a domain before the declaration. The window rule is the one rule again, for every domain: above the CPU where the unit has room, and otherwise clear of the declared windows, with no domain where nothing is declared. A claim passes its declaration; a kernel driver, which comes up before any declaration, passes none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
|
Round 1 at
Also in this round:
|
So #934 commits through this ABI unchanged: a root's record holds what its query offered and what a commit (Query clear) was granted, none in stage B. A commit beside no offer, or of bits not offered, is a record the ABI does not name, refused by name with the declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1
|
Host tests: an offer with no commit decodes; a commit decodes beside an offer covering it; a commit beside no offer, beyond the offer, or under an unnamed word is none; |
Status: draft, blocked on step 10 (the kernel's xHCI and HDA removed); rebases after. Head
a18b42b88(main3b77b9b2fmerged). Review round 1's items are answered (see the round-1 comment). Host CI and the affected QEMU rows are green at this head. No bench is staged: until step 10 lands, a bench whose IOMMU translates no wider than its CPU (the T14, the AMD bench) gives the kernel's xHCI no domain, because no declaration exists when that driver comes up. Its boot rows would fail by design. The T14 and AMD rows passed at4f5142feaunder the since-withdrawn identity-domain arrangement (readbacks).Problem
cargo run -- --arch aarch64handed over none of its four PCI claims. The loader's window list (each root bridge'sConfiguration()plus every unowned GCD MMIO range) counted ECAM and flash among the declared windows, so BARs were moved into ECAM (#916). The owner's ruling: aperture discovery leaves the loader, AML stays in acpiserver, and a refused or missing declaration fails closed.What this changes
system/acpiserver/src/apertures.rs)._SEG, the bus range and the memory windows of_CRS(toyos_acpi::root_bridge). It reads Word, DWord, QWord and Extended Address Space descriptors and steps over the I/O ones._OSCunder the PCI host bridge UUID: revision 1, Support = extended config space and MSI, Control asked = native hot-plug (bit 0) and the PCIe capability structure (bit 4). It records what the query offers. It makes no commit. Lifecycle 2 (Functions arrive and leave: the device set, native PCIe hot-plug, Gone (lifecycle stage 2) #934), which services hot-plug, commits, so theoscmodule's condition (no capability claimed that ToyOS does not perform) holds._TRAon a memory window, a consumed range, an unknown descriptor, a second or out-of-range bus range, a root with no bus range, more than 16 roots, and more windows than the declaration's bound (MAX_WINDOWS= 64, one list across every root). Measured window counts:virt2, q35 4, the T14 3, the AMD bench more than 8, the per-root bound that refused it at4f5142fea. Any of these refusals declares no root, which the kernel refuses. acpiserver logs each root's window count and its_CRSbytes as the machine's own line.toyos_abi::acpi::Apertures): eachHostBridgecarriessegment,first_bus,last_bus, its_OSCoffer, the grant of a commit (none in stage B; Functions arrive and leave: the device set, native PCIe hot-plug, Gone (lifecycle stage 2) #934 commits and declares it) and its run of one shared window list. A commit beside no offer, or of bits not offered, refuses the declaration. It travels through a newop::DECLAREon the acpi claim. Lifecycle 2 (Functions arrive and leave: the device set, native PCIe hot-plug, Gone (lifecycle stage 2) #934) depends on this shape and consumes the record through an adapter at the declare handler.kernel/src/pcidev):held_by) and only fromUnknown(toyos_pci::aperture::Held).aperture::recordschecks each record against the ABI: counts and window runs inside their arrays, an_OSCword the ABI names, an ordered bus range, and no two roots of one segment sharing a bus. Thenchecktakes every root's windows together: whole, disjoint, none over RAM. Any failure refuses the declaration by name, logs it, wakes the waiters and stands as the answer.pci: root 0000:00 _OSC: native hot-plug offered | not offered | no _OSC, buses 0x00..=0xff.Ended).DECLARATION_DEADLINE, a failure ceiling). A claim that waits out the deadline withholds the declaration for the boot (Unanswered).Readback::declaration_not_refused, run beside the other shared boot checks), and the AMD row requires the declared-windows record. That closes the hole the AMD bench's refused declaration slipped through.acpicase's probe stays the claim's holder, so that image drops diskserver, and the probe's held-function arm moves to the kernel's xHCI. Lost coverage: no booted test exercisespcidev::enumerated's claim-held branch any more.HARDWARE_REDUCED, ECAM for configuration access, firmware's own memory through the direct map, registers refusedNoRegisters, ports refusedNoPorts. No new privilege. acpiserver skips arming and\_S5there.OwnSpace::create(room, Some(windows))). A kernel driver comes up before any declaration and passes none (DeviceSpace::create). The backends keep only their RMRRs and IVMDs.loader/src/gcd.rs,loader/src/rootbridge.rs,PciRootBridgeIo, andKernelArgs::root_bridge_windowswith its count (KernelArgs1488 → 456 bytes), plus the OVMFConfiguration()fixture and its tests.an-aarch64-cargo-run-boot-hands-over-no-pci-claim.mdis deleted; its exit is met.an-x86-machine-with-no-acpi-row-hands-over-no-pci-claim.mdis new. It records the loss on an x86 machine with no acpi row; owner: this track.no-boot-reaches-the-retry-…now says a new way to arrange its case is owed.origin/main, tests included (measured).What each judge establishes
virt,cargo run -- --arch aarch64at4f5142fea(log): all four claims handed over (diskserver's NVMe, soundserver, netstack, vdagent), plus the compositor's virtio-gpu. Since then the IOMMU's kernel-driver path and the_OSCcommit changed; neither affects a claim onvirt, whose unit is wider than its CPU.virt_claim_lpirequirespci: root 0000:00 _OSC: native hot-plug offered. VirtIts has a second root at bus 8.a_drives_row_holds_one_process_per_functionrequires q35'snot offered.a_claim_waits_out_an_undeclared_machine(q35, no acpiserver): the first claim waits 30 s, and both are refused by name.acpi_mediated_accessjudges theEndedtransition.clear_of_host_bridgesreads the acpi claim's declared windows.amdvi_translates_the_stick_controlleralso requires the declaration.Checks
cargo run -- --ci hostde8e9883a(that commit changes one guest judge)virt)virt_claim_lpired on its own judge (log)virt_claim_lpide8e9883a--ci host_CRS: both QEMU DSDTs, every descriptor width,_TRAand hostile lists, an 18-window root, an absurd one, a single-byte sweep._OSC: offered, firmware failure, unrecognised revision, all masked, QEMU's 0x1F and 0x1E masks, extra bits dropped, absent, malformed answers, never committed. Records: each malformed field, shared buses, a refusal being the answer. State machine, RAM fence, ABI records_TRAaccepted, RAM fence off, second declaration replacing, claim not waiting (round 0); old per-root bound,_OSCcommitted, malformed record leftUnknown(round 1): each red4f5142feaRisks and open points
_CRSis still unmeasured byte for byte. Its next boot logs the bytes and the window count. The host case taken from it, which the orchestrator asked for, is owed until then. The 18-window test is crafted.4f5142fea, when it was committed). Lifecycle 2 commits it.🤖 Generated with Claude Code
https://claude.ai/code/session_016UzbDnM9m6nQWhbjGi6Lv1