◈ Passerelle

Project

ADR-006 — MSI-X is the interrupt path; INTx is the fallback, and the driver never depends on the fragment

Context

QNX 8.0 has no InterruptAttach(): a handler can no longer run in interrupt context, and the only supported shape is an interrupt service thread attached with InterruptAttachThread(). A PCI device can still deliver its interrupt two ways, and the project has to choose an order:

Until now the choice was <em>measured but not decided</em> (gap 77): the code tried MSI-X and fell back to INTx, and the image carried an interrupt fragment for the INTx line, without a record saying which one is the intended path. Here is what is actually measured.

<strong>Measured, guest side (QNX Neutrino 7.1.0, the CI guest):</strong>

  1. QEMU assigns our device `B0:D5:F0`, `IRQ 10`, `pin A` — read back from the host side of the same bus with `info pci` at the QEMU monitor, and captured in the CI artefact `host-qemu-info-pci.txt`.
  2. The guest's own `/proc/boot/pci_hw.cfg` routes **no** interrupt for `B0:D05:F00`: `pci-tool` reports `Interrupt list - 0 assigned` for our device, while the image routes `B0:D17:F0` and `B3:D0:F0` on IRQs 16 to 19.
  3. The hardware module of that image is `pci_hw-Intel_x86.so` 2.4 (2020-06-14), and two of its own strings, read out of the binary, bound what the fragment can do there: `HW config file IRQ %d for B%u:D%u:F%u is invalid. Must >= 16` and `No chipset support found for 0x%x`. Every record the image ships uses 16 to 19.
  4. QEMU only ever routes PCI INTx to a **legacy GSI 0–15**: `IRQ 10` for our device on the `qshare` options, `IRQ 11` on both a bare `pc` and a bare `q35` machine. No QEMU machine type whose INTx line reaches 16 exists.
  5. The same guest proves QNX does allocate MSI-X vectors: the `vmxnet3` device next to ours reports `Interrupt list - 3 assigned` on `IRQ 256`, `257`, `258`, and the image ships the MSI-X capability module `pci_cap-0x11.so`.
  6. Our device advertises MSI-X as its **first** capability (the capability list of the artefact: MSI-X `0x11`, then the five virtio vendor capabilities `0x09`), followed by the three assigned address spaces.

<strong>Measured, host side:</strong> the QEMU 7.1 guest reports the QNX numbering <em>is</em> the GSI: in the same guest the two USB controllers report Interrupt 0 on IRQ 11, exactly what QEMU wired. So "must be >= 16" is a policy of that Intel hardware module — it targets ITSS/PIRQ chipsets (Skylake, Denverton, Apollo Lake, Coffeelake) and knows nothing of the PIIX3 QEMU emulates — not a QNX-wide rule.

<strong>To be measured under the SDP</strong> (nothing below is claimed today):

Decision

<strong>MSI-X is the primary interrupt path. INTx is the fallback. The driver never depends on image/pci_hw.cfg being honoured.</strong>

Concretely:

  1. The driver asks for MSI-X first and programs the table and the capability itself (`pci_msix_program` in `virtio/src/pci_modern.c`). If the capability refuses to enable, the driver logs `MSI-X unavailable, using INTx` and attaches the classic line with `InterruptAttachThread()` — the same interrupt service thread on both paths.
  2. `image/pci_hw.cfg` stays in the tree, but its role is redefined: it **records** the INTx wiring of our device (`B0:D5:F0 A 10`) for the images whose hardware module can declare it, and it is what the CI job cross-checks against what QEMU really assigns. It is *not* the mechanism that delivers interrupts on the QNX 7.1 image we can boot, because measurements 3 and 4 above show that module refuses that IRQ.
  3. No code path is allowed to depend on the fragment: the driver must work on an image where the fragment is absent, ignored or refused. The fragment is an aid for a configuration we cannot boot yet, not a dependency.

Consequences

Revisit when