x86_64: no network on QEMU microvm with ACPI on
メンテナーはふだん 2 日以内に返信
関連するプルリクエストがすでにマージされています。
- #2777 @martijnhoekstra による — マージ済み
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- rust
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 1.5k
- フォーク
- 138
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hermit-os/kernel のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
hermit-os/kernel#2747 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
メンテナーはふだん 2 日以内に返信
-
static 10% reserve of heap memory for device & stack is inefficient and causes issues.対応中かも @jounathaen が 28 日前に担当しました。 オープン
hermit-os/kernel#2740 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
hermit-os/kernel#2736 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
Lost network wakeupオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 2 日以内に返信
hermit-os/kernel の issue をすべて見る
似ている issue
-
needs-triage tooling
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
neilsh/stunt-reel#317 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
storytold/craft-fonts#65 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
storytold/craft-libs#723 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
n0-computer/iroh#4669 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信