vpci: add the ability to defer write results to configuration space#3207
Open
mfrohlich-msft wants to merge 4 commits intomicrosoft:mainfrom
Open
vpci: add the ability to defer write results to configuration space#3207mfrohlich-msft wants to merge 4 commits intomicrosoft:mainfrom
mfrohlich-msft wants to merge 4 commits intomicrosoft:mainfrom
Conversation
699be8e to
fddff48
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the VPCI bus MMIO config-space write path to support devices that return deferred completion for PCI config writes, by aggregating multiple deferred write tokens into a single deferred operation that vmotherboard can poll to completion.
Changes:
- Teach
VpciBusDevice::mmio_writeto handleIoResult::Deferfrompci_cfg_writeinstead of panicking. - Add a
VmTaskDriverspawner toVpciBusDeviceand spawn a task to await multiple deferred write tokens, completing an outer deferred write token. - Add
futuresandpal_asyncdependencies to support polling and spawning.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| vm/devices/pci/vpci/src/bus.rs | Collect deferred config-write tokens and return a combined deferred write to the motherboard, driven by a spawned task. |
| vm/devices/pci/vpci/Cargo.toml | Add futures and pal_async dependencies required by the new deferred-write combiner. |
8aac5f0 to
65b9964
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.
Currently, vpci bus mmio writes do not allow deferral of pci config space writes because an unwrap() call will panic on the deferred access.
This change allows emulated configuration space accesses for VPCI devices to defer their configuration space write requests to be completed asynchronously. If multiple chunked accesses result in deferred writes, collects the tasks and polls them to completion in a separate deferred task returned to the vmotherboard.
This retains the same expectation that all deferred writes must return
IoResult::Okor it panics.