Skip to content

docs: use kvm-arm.vgic_v3_group1_trap=1 for Lima microVM setup on arm64 - #3149

Merged
Scott Funkenhauser (sfunkenhauser) merged 1 commit into
agent-substrate:mainfrom
BenTheElder:docs-lima-vgic-trap
Oct 23, 2026
Merged

Scott Funkenhauser (sfunkenhauser) merged 1 commit into
agent-substrate:mainfrom
BenTheElder:docs-lima-vgic-trap

Conversation

@BenTheElder

Copy link
Copy Markdown
Collaborator

On arm64 kernels 6.19 and newer, KVM clears the active bit on GICv3 LPI list registers during VM exits (Linux commit 73c9726975af, reverting that also works but isn't clearly the right fix).

Under nested virtualization, hardware EOI in the L2 microVM guest does not clear ICH_AP1R0_EL2 and stalls subsequent virtio interrupts, hanging microVM boot.

This was found by bisecting the kernel previously, which we "solved" by pinning to <= 6.18.

This is commonly encountered when setting up limactl defaults, enabling nested virtualization, and then testing substrate on an apple silicon mac.

Setting kvm-arm.vgic_v3_group1_trap=1 on the Lima guest kernel command line traps Group 1 EOI writes to EL2 so KVM clears the active priority in software.


Why is this needed? (Or link the issue. Open one first for features, API, install or CI changes.)

This allows our developer docs to use the default Ubuntu 26.04 Lima image instead of pinning to Ubuntu 24.04 and installing a newer git from a PPA.

FYI Scott Funkenhauser (@sfunkenhauser) I finally got back to this and found a suitable workaround.

Still have not file the kernel bug thread, I haven't had time to figure out how to do that the right way without sending them unwanted ~slop ... we should do that at some point.

AI use: Yes, absolutely, I do not have time to bisect the kernel :-), I however vetted this change.

  • Tests pass
  • Docs updated

On arm64 kernels 6.19 and newer, KVM clears the active bit on GICv3 LPI
list registers during VM exits (Linux commit 73c9726975af). Under nested
virtualization, hardware EOI in the L2 microVM guest does not clear
ICH_AP1R0_EL2 and stalls subsequent virtio interrupts.

Setting kvm-arm.vgic_v3_group1_trap=1 on the Lima guest kernel command
line traps Group 1 EOI writes to EL2 so KVM clears the active priority
in software. This allows docs/dev/microvm-local.md to use the default
Ubuntu 26.04 Lima image instead of pinning to Ubuntu 24.04 and installing
a newer git from a PPA.
Merged via the queue into agent-substrate:main with commit c0451ce Oct 23, 2026
15 checks passed
@BenTheElder

Copy link
Copy Markdown
Collaborator Author

NOTE: Running linux amd64 containers with emulation under rosetta, at least on my M4, will fail on this newer kernel, rosetta is missing some instructions. you can instead use qemu but ... it will be slow.

So there are reasons to hold back, in the short term, and not necessarily rush to adopt this from a working setup.

However, we should just ... NOT do that, it's a huge pitfall, and relatively easily avoided, that one is #3152 but I need to talk to tim/dima/eitan about if this is in scope or post-freeze.

Davanum Srinivas (dims) pushed a commit to dims/substrate that referenced this pull request Oct 23, 2026
…-substrate#3152)

<!-- The PR title becomes the release note. Write it for users. -->

Why is this needed? (Or link the issue. Open one first for features,
API, install or CI changes.)

Upgrading to current Ubuntu in limactl
(agent-substrate#3149) on macOS led to
emulation errors with rosetta.
Using qemu is super slow.

We should just cross-compile, pretty much always, that's a key benefit
of buildx and multi-stage builds.
It's WAY faster. Compiling under emulation is major kludge.

<!-- e.g. "AI-assisted, I reviewed and tested it." No AI co-author
trailers. -->
AI use: Yes, I let it draft this. Then hand edited, bash and dockerfiles
I'm quite familiar with :-)

<!-- Breaking change? Describe what users must do on upgrade and ask for
the `breaking-change` label. -->

- [x] Tests pass
- [x] Docs updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/microVM kind/docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants