x86_64: no network on QEMU microvm with ACPI on
I maintainer di solito rispondono entro 2 giorni
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
- Ambito
- networking, operating-systems
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:
- With the second IOAPIC (
ioapic2=on, the default), Hermit panics at boot. #2775 fixes that. - 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 andioapic2=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 novirtio_mmio.device=on the command line. Only the DSDT says where each transport is and which GSI it uses: each one is anLNRO0005device with a memory range and an interrupt. - 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:
- Send IRQs 0 to 79 to
handle_interrupt. The vectors from 112 up stay with the local APIC. - Without
virtio_mmio.device=arguments, read theLNRO0005devices 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
microvmwith ACPI. Withioapic2=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
microvmwould still needacpi=off, as in CI today.
- Lingua principale
- Rust
- Stelle
- 1.5k
- Fork
- 138
- Merge medio
- 1g 9h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hermit-os/kernel
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
hermit-os/kernel#2747 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 47/100
I maintainer di solito rispondono entro 2 giorni
-
static 10% reserve of heap memory for device & stack is inefficient and causes issues.Forse già presa @jounathaen l’ha presa 27 giorni fa. Aperta
hermit-os/kernel#2740 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
sys_read_entropy silently returns non-cryptographic bytes when no entropy source is availableAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
hermit-os/kernel#2736 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Lost network wakeupAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di hermit-os/kernel
Issue simili
-
Shell `yoyo <verb> <sub>` missing its required argument prints usage and exits 0: `config get`Apertaagent-self
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
yologdev/yoyo-evolve#1154 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
eliasstravik/herdr-projects#789 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Alex-Sebastian-Ene/mind-over-chicken#195 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni