x86_64: no network on QEMU microvm with ACPI on

Aperta
#2,776 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@martijnhoekstra ci sta già lavorando.

Dal 6/11/2026.

  • #2777 di @martijnhoekstra — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
rust

Direzione di ricerca

The issue describes IRQ dispatch and virtio-mmio discovery through ACPI DSDT LNRO0005 devices, but names no source files or tests. Start by tracing the x86_64 interrupt handler and virtio-mmio probe path, then inspect the linked pull request #2777, which already implements the proposed fixes. Done means networking works on QEMU microvm with ACPI enabled and with ioapic2=off, under KVM and TCG.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

On QEMU's microvm machine with ACPI on, which is QEMU's default, a Hermit application built without pci has no working network. Hermit's CI boots microvm with acpi=off, where this doesn't happen.

There are three separate problems:

  1. With the second IOAPIC (ioapic2=on, the default), Hermit panics at boot. #2775 fixes that.
  2. Hermit probes the virtio-mmio transports and assumes transport n uses IRQ 5 + n. QEMU only numbers them that way with acpi=off. With ACPI and ioapic2=off, transport n uses GSI 16 + n. With the second IOAPIC there are 24 transports on GSIs 24 to 47, and Hermit only probes the first 8. With ACPI on, QEMU puts no virtio_mmio.device= on the command line. Only the DSDT says where each transport is and which GSI it uses: each one is an LNRO0005 device with a memory range and an interrupt.
  3. Hermit only sends IRQs 0 to 15 to handle_interrupt. Any higher IRQ goes to the exception handler, which stops the core.

To reproduce on main, build an application without pci and boot it with -machine microvm,ioapic2=off -global virtio-mmio.force-legacy=false. Hermit finds the NIC, installs its handler on IRQ 12, and stops when the NIC raises GSI 23:

[INFO  mmio      ] Found Virtio Net device: 0xfeb00e00
[INFO  virtio    ] Virtio interrupt handler at line 12
[ERROR interrupts] Exception 55

With -machine microvm and #2775, Hermit boots but doesn't find the NIC, which is transport 23 at 0xfeb02e00. The application fails with "Network is down".

Fix

#2777 fixes 2 and 3 in two commits:

  1. Send IRQs 0 to 79 to handle_interrupt. The vectors from 112 up stay with the local APIC.
  2. Without virtio_mmio.device= arguments, read the LNRO0005 devices from the DSDT with the acpi crate's AML interpreter. Probe only if there are none.

With both commits and #2775, an echo application passes TCP and UDP tests on microvm with default options and with ioapic2=off, under KVM and TCG.

The cost is size. The second commit links the AML interpreter into x86_64 builds with acpi and without pci. The echo application grew by 227 KB, from 1.31 MB to 1.54 MB.

Only the first commit

The first commit could also go in on its own.

What it gains:

  • An IRQ above 15 no longer stops the core. That is a bug on any machine, not only on microvm.
  • No size cost.

What it loses:

  • The NIC still doesn't work on microvm with ACPI. With ioapic2=off, the application starts, but the NIC's handler is still on IRQ 12, so Hermit never sees its interrupts. In my test under KVM, every TCP and UDP echo failed. With the second IOAPIC, Hermit still doesn't find the NIC.
  • Networking on microvm would still need acpi=off, as in CI today.
Lingua principale
Rust
Stelle
1.5k
Fork
138
Merge medio
1g 9h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hermit-os/kernel

Tutte le issue di hermit-os/kernel

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.