Repository navigation
The ITS under HVF: one declaration picks each machine's interrupt controller, and virt_claim_lpi is back - #912
Conversation
…troller, and virt_claim_lpi is back `cargo run -- --arch aarch64` put an SMMUv3 on `virt` but no ITS. QEMU 11.1 runs HVF guests on Apple's in-kernel vGIC by default, which offers GICv2m and refuses an ITS, so every PCI claim on the interactive machine was refused for want of remapped interrupts. The harness had its own spelling for the one machine that had an ITS (`its=on,kernel-irqchip=off`, under every accelerator, though KVM runs no GICv3 with its irqchip off). `Arch::irqchip(accel, remapped)` is now the one answer both launchers read, beside `Arch::cpu(accel)`: VT-d's split irqchip on x86-64; on AArch64 GICv3, and with `remapped` its ITS through `msi=its` (the `its` property is deprecated), on QEMU's own GIC under HVF alone. KVM keeps its in-kernel GICv3 and TCG emulates the ITS either way. x86-64's machine strings are unchanged. QEMU 11.1.1 answers each combination: under HVF, `gic-version=3,msi=its,kernel-irqchip=off,iommu=smmuv3` builds arm-gicv3 and arm-gicv3-its; the same without `kernel-irqchip=off` exits "ITS not supported on HVF when using the hardware vGIC"; and `gic-version=3` alone builds hvf-arm-gicv3 with arm-gicv2m (`hw/arm/virt.c`, `finalize_msi_controller`). `virt_claim_lpi` is restored by reverting b65ba04 onto the moved paths (`tests/images/virtclaimcase.toml`, `tests/guest/rust-tests`). Its one red was a firmware stall before the loader that about 4,000 deliberate boots never reproduced; it stays open in its issue, which now says the interactive machine runs on the same GIC. The test is the only one of the ITS path. With the HVF arm given the base's machine back, the same test builds and reds: the MADT names no ITS and edu is refused "its interrupts would not be remapped on this machine". Taken in part from Codex's closed #869 (`1c582085d`, `build/qemu.rs`), whose review asked for the choice per accelerator in one declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
|
Review: #912 at ArchitectureThis matches design point 1 of #869 as the owner ruled it: an ITS under HVF alone, in one declaration that both launchers read, and shapes that do not ask for remapping keep their controller. x86-64 strings. I checked these by hand.
So the strings are byte-identical today. The new condition is also the more accurate one. The non-ITS AArch64 strings keep their option order. The restored test. I diffed the three Credit to Codex. The commit message credits Cost of Negative control. The whole-change revert deletes the test, so it cannot serve as the control. The patch instead gives the HVF arm the base's interactive spelling (
The QEMU oracle. The stall issue. Its exit is still honest: reproduce the stall with a deliberate harness, name the cause, fix it. The issue still records that about 4,000 boots did not reproduce it. It now states the remaining risk to the interactive machine as a conditional ("if it is that GIC's"). Restoring the test while the stall stays open is justified: the stall is in firmware, before the loader, and is independent of what the test claims. The test is the only coverage of the ITS path. This answers the owner's condition that the change "accounts for the recorded firmware stall on that configuration". Size. +470 −56. Build production code is about +25 −9. The restored test, its binaries and its image are +387, matching FindingsBLOCKER
SUGGESTION
LAND is withheld until the stale issue paragraph is corrected and the evidence is published with its revision note. SEND BACK |
|
Evidence published by the orchestrator (the implementer's push was refused by a permission check, which the owner called odd and overrode): |
|
Review update for #912 at The evidence is on Evidence BLOCKER, revised:
Still open: the stale-issue BLOCKER at SEND BACK |
…R placement alone The aarch64 claim issue, merged from main, said `cargo run` launched a `virt` with no ITS and refused every claim for want of remapping. With `Arch::irqchip` the machine carries the ITS, so that account goes and the BAR placement it still fails at stays as recorded. The stall issue's history names its machine's spelling as it was then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
One conflict, tests/common/qemu.rs. #912 gave `Smmu` a third state, `WithIts` (virt's SMMUv3 with the ITS behind it, an `edu` and an `e1000e` past a bypassing root port) and built the machine argument from `Arch::irqchip`; this branch had renamed `Smmu` to `Testdevs { Absent, Two }` so a q35 behind AMD-Vi could carry two `iommu-testdev`. Both are kept as one enum, `Probes { Absent, Testdevs, Its }`, under the field `probes`: main's machine-argument code is taken whole with `shape.smmu` read as `shape.probes`, its ITS devices emitted on `Probes::Its`, and the q35 assertion widened to admit `Probes::Testdevs` behind a unit and nothing else. No file under kernel/src/arch/x86_64/amdvi, kernel/src/iommu, kernel/src/arch/x86_64/vtd or kernel/src/arch/aarch64/smmu changed on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
First of the two PRs that redo the closed #869: the GIC ITS under HVF alone. Aperture and ECAM placement are the second, on another branch. This takes up
issues/virt-claim-lpi-boot-stalled-in-firmware-once-under-load.md.Problem
cargo run -- --arch aarch64gavevirtan SMMUv3 but no ITS. QEMU 11.1 runs HVF guests on Apple's in-kernel vGIC by default. That vGIC offers GICv2m and refuses an ITS, so the kernel refused every PCI claim on the interactive machine because its interrupts could not be remapped. The harness had its own spelling for its one ITS machine,its=on,kernel-irqchip=off. That spelling applied under every accelerator, but KVM cannot run a GICv3 with its irqchip off. The two launchers had drifted apart, as #869's review pointed out.Change
Arch::irqchip(accel, remapped)sits besideArch::cpu(accel)and is the one declaration thatcargo run(build/qemu.rs) and the harness (tests/common/qemu.rs) both read:kernel-irqchip=split. The machine strings are unchanged.gic-version=3. Withremappedit adds the ITS throughmsi=its(theitsproperty is deprecated). Under HVF alone it also addskernel-irqchip=off, so QEMU's own GIC is used. KVM keeps its in-kernel GICv3, and TCG emulates the ITS either way.virt_claim_lpiis back: b65ba04 is reverted onto the moved paths (tests/images/virtclaimcase.toml,tests/guest/rust-tests/src/bin/claim_*.rs). It is the only test of the ITS path: a claimed function's LPI, the claim the IORT routes past the SMMUv3, and a fault in a claimed BAR. It needs a guest because these are the live kernel's ITS commands and QEMU's IORT/SMMUv3 routing. Its machine isProfile::VirtIts: HVF on an Apple host, where it was booted; TCG on other hosts and KVM on a Linux arm64 host whose/dev/kvmopens, neither booted here (QEMU's TCGinfo qtreebuilds the same GIC, ITS and SMMUv3).issues/an-aarch64-cargo-run-boot-hands-over-no-pci-claim.md(from main) no longer says the interactive machine lacks an ITS; it keeps the BAR-placement failure that PR2 takes up.Decisions and tradeoffs
cargo run's AArch64 machine. No speed claim is made either way. The alternative is no isolated claims at all.cargo run's HVF machine runs on the same GIC, so if the stall comes from that GIC, it can reach the interactive machine too. I did not attempt another reproduction batch.6fb2ba893(its=onspelling, not rerun here) then found BAR placement exhausted inside ECAM. Fixing that is PR2.Checks (host: 14-core Apple Silicon, macOS, QEMU 11.1.1, HVF)
cargo test --test toyos-build -- virt_claim_lpi: exit 0, at load 30→58. The ITS was armed from the MADT, edu was handed over on slot 0 with LPI 8192 and DeviceID 0x18, 16 messages were read as 16 interrupts, e1000e was refused withNoDeviceId, and two BAR faults were contained.cargo test --test toyos-build -- virt_smmu virt_low_ecam virt_user_mode virt_el2_drop iommu_virtio_platform: exit 0. These are the neighbours whose-machineconstruction was rewritten, covering HVF, TCG at EL2, and x86 with and without VT-d.negative-control.patch, applied, built, then reversed by an EXIT trap):gic-version=3) and drops the test'smsi=itsargv check.virt_claim_lpiwent red with exit 1.ITS: the MADT names none, and every claim was refused: "its interrupts would not be remapped on this machine". This is the refusal the interactive machine had.info qtreeunder HVF):gic-version=3,msi=its,kernel-irqchip=off,iommu=smmuv3builds arm-gicv3 and arm-gicv3-its.kernel-irqchip=off, QEMU exits: "ITS not supported on HVF when using the hardware vGIC".gic-version=3alone builds hvf-arm-gicv3 with arm-gicv2m.msi=itsbuilds the ITS.hw/arm/virt.c:finalize_gic_versionallows only GICv2 when KVM's irqchip is off, andfinalize_msi_controllerhandles the HVF/ITS case.cargo run -- --ci host: exit 0, all 76 steps green.--build-only, because no image content changed.Evidence:
ToyOSOrg/evidencepr-912 at 902ed2117,its-7272d0e8a/. Tested revision: every log ran on the tree staged onef684e4fcthat was committed unchanged as7272d0e8a, apart from a two-line prose reflow in an issue (REVISIONthere).aa4104583merges main and corrects two issues' prose only, so no rerun applies.Lines:
build/arch.rs+17,build/qemu.rs+8 −9.tests/common/qemu.rsis +39 −23, of which the restoredVirtItsprofile accounts for +22 −1 and the shared machine construction for the rest. The restored test and its binaries and image are +387, which matches b65ba04's deletion. The issues are +19 −24.🤖 Generated with Claude Code
https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy