fix(x86_64/qemu): use q35 PCI windows#340
Closed
tiniham wants to merge 2 commits into
Closed
Conversation
d3b5abf to
d8bf8a2
Compare
d8bf8a2 to
6d5ff3b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
platform.mkalready tells QEMU to use-machine q35, butboard.rs'sPCI config didn't get the memo —
ecam_basewas set to0xe0000000, whichisn't where q35 actually puts its ECAM region. QEMU/SeaBIOS/OVMF program
q35's PCIEXBAR at
0xb0000000by default, and that's also what shows up inthe ACPI MCFG table, so any guest that reads MCFG instead of trusting a
hardcoded value would compute extended-config-space addresses that land
0x30000000away from where hvisor's own root-zone config expects them.Separately, there was no passthrough memory region for q35's PCIe 32-bit
MMIO BAR window (
0xfe000000, size0xc00000) — right below the existingHPET/IOAPIC entries at the top of the address space. Without an entry
there, any device whose BAR firmware places in that window (which, again,
is exactly where q35 puts them) has nothing backing it in the guest's
stage-2 tables.
Fixed both:
ecam_basecorrected to0xb0000000, and an 11th region addedto
ROOT_ZONE_MEMORY_REGIONScovering the MMIO window.This isn't Asterinas-specific — it's a bug in the existing qemu board's own
PCI config, equally wrong for the current Linux root zone. Verified:
make ARCH=x86_64 BOARD=qemu MODE=release all,cargo fmt --all -- --check, both clean.