ext/pci: fix crash on devices with non-standard PCI segment#802
Open
bartlomiejkida wants to merge 1 commit intoQubesOS:mainfrom
Open
ext/pci: fix crash on devices with non-standard PCI segment#802bartlomiejkida wants to merge 1 commit intoQubesOS:mainfrom
bartlomiejkida wants to merge 1 commit intoQubesOS:mainfrom
Conversation
Contributor
|
PipelineRetryFailed |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #802 +/- ##
==========================================
- Coverage 70.12% 70.11% -0.01%
==========================================
Files 61 61
Lines 14001 14004 +3
==========================================
+ Hits 9818 9819 +1
- Misses 4183 4185 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
On Dell Latitude 5420 (and likely other Tiger Lake laptops), Intel VMD (Volume Management Device) is enabled by default in BIOS. VMD creates a virtual PCI segment 10000: for the storage devices it manages:
When qubesd enumerates PCI devices, sbdf_to_path() hits an AssertionError on these devices because their bus topology doesn't match the expected hierarchy. This crashes the entire admin.vm.device.pci.Available API call, making qvm-pci unusable.
Full lspci on this machine:
Fix
Catch the AssertionError from sbdf_to_path() in PCIDevice.init and convert it to UnsupportedDevice. The existing handler in on_device_list_pci already skips unsupported devices gracefully with a warning log. VMD-managed devices cannot be passed through to VMs via standard PCI passthrough anyway, so skipping them is the correct behavior.
This patch fixes qvm-pci, but also qubes-global-config, which needs to load the PCI device list first.
Closes QubesOS/qubes-issues#10847