roadmap

Milestone 317 appendix: x86_64, where the premise was false

An appendix to milestone 317 (the interrupt-remapping flags). §212 (a prose budget) moved it out. The main page is complete without it. This is the x86_64 measurement in full: the register readings, the knob and its default, the suite on both machines, and why the runner does not add kernel-irqchip=split.

The premise was false, and that is the finding

§86 said interrupt remapping is off in every x86_64 boot this tree runs. It has been on the whole time.

That section reached its conclusion by reading helpers/qemu-runner-x86_64.sh, which attaches -device intel-iommu with no intremap=on. The reading of the file is correct. The conclusion drawn from it is not, and the difference only shows up when you boot the machine and read the register. ECAP printed from inside the guest, QEMU 11.1.1, q35 under TCG on patagonia:

invocation ECAP IR (bit 3)
-device intel-iommu (the default, and what every boot before this ran) 0xf00f4a set
-device intel-iommu,intremap=on 0xf00f4a set
-device intel-iommu,intremap=off 0xf42 clear

QEMU's intremap property is tri-state and defaults to auto, which resolves ON when there is no in-kernel irqchip to conflict with. patagonia has no KVM, so it has always resolved ON. Adding intremap=on is a no-op here. Nothing in this kernel read ECAP.IR, so nobody could have noticed, which is the whole reason this lane's first job was to make the guest say what it sees.

What the knob actually is, given that

NIFE_INTREMAP (provisional name) passes intremap= through; on and off are the only values it accepts, and unset leaves QEMU's default. The useful value is off, because it is the only way to reach a machine without the capability, and a comparison needs both sides. The default does not move: unset is what the tree already ran, so this adds a knob and changes no existing boot.

The guest reports what it found, which is the part that makes any of this checkable:

iommu           : VT-d drhd at 0x00000000fed90000, root table default-deny, translating, interrupt remapping offered (unused)
iommu           : VT-d drhd at 0x00000000fed90000, root table default-deny, translating, interrupt remapping absent (unused)

arch::x86_64::iommu::interrupt_remapping_available is the query; print_summary and one test are its callers. That test asserts GSTS.IRES is clear whatever ECAP.IR says, so the claim that nothing here remaps an interrupt cannot quietly stop being true.

The suite passes on both machines

script/test --arch x86_64                      -> 0
NIFE_INTREMAP=off script/test --arch x86_64    -> 0

A green suite proves nothing about remapping either way, which is milestone 202's hazard (every confinement test is a ritual until somebody breaks the confinement). It proves only that removing a capability nothing uses breaks nothing, which is what you would expect and is worth having measured rather than assumed.

kernel-irqchip=split is not needed here, and that is measured

The advice that pairs intremap=on with -machine kernel-irqchip=split is real and is a KVM constraint: QEMU refuses interrupt remapping with an in-kernel irqchip. patagonia has no KVM, so q35 under TCG emulates the whole irqchip in the QEMU process and the check never fires. Started with -S and quit from the monitor, so machine init runs and nothing executes:

-machine q35 -device intel-iommu,intremap=on                      # starts, no diagnostic
-machine q35,kernel-irqchip=split -device intel-iommu,intremap=on # starts, no diagnostic
-machine q35,kernel-irqchip=on -device intel-iommu,intremap=on    # starts, no diagnostic

The runner does not add the flag. A Linux host running this suite under KVM would need it, and adding it here would assert a machine fact nobody on this machine can check.

Default-on versus opt-in, which the correction mostly dissolved

The question the brief asked was whether intremap=on should be the default. It is moot: it is already the effective default, and stating it changes nothing. What is left is the real choice, which is whether the knob defaults to on, off, or QEMU's own answer.

Unset, deferring to QEMU. Any other default would change every existing x86_64 boot to buy nothing. Pinning on re-states what already happens, and would silently become a real change if this suite ever ran under KVM. Pinning off would remove a capability from every boot to protect against nothing, since no code reads it. The knob earns its keep as a way to ask a question on purpose, not as a new default posture.