MsvmPkg: Add virtio-blk over PCI support (ported from EDK2 OvmfPkg)#90
Open
jstarks wants to merge 1 commit into
Open
MsvmPkg: Add virtio-blk over PCI support (ported from EDK2 OvmfPkg)#90jstarks wants to merge 1 commit into
jstarks wants to merge 1 commit into
Conversation
Port the virtio-blk-over-PCI driver stack from EDK2 OvmfPkg into MsvmPkg
for both X64 and AARCH64.
Modules added (drivers):
- MsvmPkg/VirtioBlkDxe (OvmfPkg/VirtioBlkDxe)
- MsvmPkg/Virtio10Dxe (OvmfPkg/Virtio10Dxe, modern 1.0 PCI transport)
- MsvmPkg/VirtioPciDeviceDxe (OvmfPkg/VirtioPciDeviceDxe, legacy transport)
Libraries added:
- MsvmPkg/Library/VirtioLib (OvmfPkg/Library/VirtioLib)
- MsvmPkg/Library/BasePciCapLib (OvmfPkg/Library/BasePciCapLib)
- MsvmPkg/Library/UefiPciCapPciIoLib (OvmfPkg/Library/UefiPciCapPciIoLib)
Headers added under MsvmPkg/Include:
IndustryStandard/{Virtio,Virtio095,Virtio10,VirtioBlk}.h,
Protocol/VirtioDevice.h, Library/{VirtioLib,PciCapLib,PciCapPciIoLib}.h
Wiring:
- MsvmPkg.dec: define gVirtioDeviceProtocolGuid (value preserved from OvmfPkg)
- MsvmPkgX64.dsc / MsvmPkgAARCH64.dsc: add VirtioLib/PciCapLib/PciCapPciIoLib
library classes and the three driver components
- MsvmPkgX64.fdf / MsvmPkgAARCH64.fdf: add the three drivers to the DXE FV
The only change to the upstream sources is retargeting each INF's [Packages]
from OvmfPkg/OvmfPkg.dec to MsvmPkg/MsvmPkg.dec; the .c/.h files are verbatim.
Source provenance:
Repository: https://github.com/tianocore/edk2
Tag: edk2-stable202511
Commit: 46548b1adac82211d8d11da12dd914f41e7aa775
chris-oo
reviewed
Jul 10, 2026
chris-oo
left a comment
Member
There was a problem hiding this comment.
This is fine with me, but I did have a question on how we want to handle this code in the future. Is this commit message equivalent or do others think we should have some kind of provenance in the repo for the drivers?
Additionally, I think with the way these drivers bind they will be no-ops if we don't expose any virtio devices, right? Or is there another way we can make sure that these drivers don't load when they're not expected to?
I'd also like Oliver/someone on sean's team to comment as well.
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.
Port the virtio-blk-over-PCI driver stack from EDK2 OvmfPkg into MsvmPkg for both X64 and AARCH64.
Modules added (drivers):
Libraries added:
Headers added under MsvmPkg/Include:
IndustryStandard/{Virtio,Virtio095,Virtio10,VirtioBlk}.h,
Protocol/VirtioDevice.h, Library/{VirtioLib,PciCapLib,PciCapPciIoLib}.h
Wiring:
The only change to the upstream sources is retargeting each INF's [Packages] from OvmfPkg/OvmfPkg.dec to MsvmPkg/MsvmPkg.dec; the .c/.h files are verbatim.
Source provenance:
Repository: https://github.com/tianocore/edk2
Tag: edk2-stable202511
Commit: 46548b1adac82211d8d11da12dd914f41e7aa775