-
Notifications
You must be signed in to change notification settings - Fork 158
openvmm/pcie: refactor pcie config space emulator, properly implement slot and link capabilities, add MSI capability #2325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds PCIe hotplug support to OpenVMM's PCIe infrastructure, enabling dynamic device attachment and removal. The key changes include:
- Adding MSI capability support for interrupts
- Implementing PCIe hotplug slot capabilities and presence detection
- Refactoring configuration space emulators to share common functionality
- Adding CLI options for enabling hotplug on root ports and switches
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vm/devices/pci/pcie/src/switch.rs | Updated downstream switch port to support hotplug parameters |
| vm/devices/pci/pcie/src/root.rs | Added hotplug support and extensive tracing to root complex |
| vm/devices/pci/pcie/src/port.rs | Added hotplug and MSI capability, plus presence detect handling |
| vm/devices/pci/pci_core/src/spec.rs | Added MSI capability structures and PCIe link speed/width enums |
| vm/devices/pci/pci_core/src/msi.rs | Added Debug and Inspect derives for MSI types |
| vm/devices/pci/pci_core/src/cfg_space_emu.rs | Major refactoring to extract common header emulator, added presence detect support |
| vm/devices/pci/pci_core/src/capabilities/read_only.rs | Added capability_id support and as_any methods |
| vm/devices/pci/pci_core/src/capabilities/pci_express.rs | Implemented hotplug support with slot capabilities and link speed management |
| vm/devices/pci/pci_core/src/capabilities/msix.rs | Added capability_id and as_any methods |
| vm/devices/pci/pci_core/src/capabilities/msi_cap.rs | New file implementing MSI capability |
| vm/devices/pci/pci_core/src/capabilities/mod.rs | Added capability_id and as_any methods to trait |
| openvmm/openvmm_entry/src/lib.rs | Wired hotplug config through entry point |
| openvmm/openvmm_entry/src/cli_args.rs | Added CLI parsing for hotplug options |
| openvmm/hvlite_defs/src/config.rs | Added hotplug fields to config structs |
| openvmm/hvlite_core/src/worker/dispatch.rs | Wired hotplug config through worker dispatch |
Comments suppressed due to low confidence (3)
vm/devices/pci/pci_core/src/capabilities/pci_express.rs:1
- Using
unreachable!()with user/guest-provided data violates the trust boundary principle. If a guest provides an invalid link speed value that doesn't match any of the defined encodings, this will panic. Replace with a safe default or error handling to prevent guest-triggered panics.
// Copyright (c) Microsoft Corporation.
vm/devices/pci/pci_core/src/capabilities/pci_express.rs:1
- Similar issue as previous comment - using
unreachable!()infrom_bitsmethods for SupportedLinkSpeedsVector and LinkWidth. Guest-provided values could trigger panics. These should return safe defaults or use Result types instead.
// Copyright (c) Microsoft Corporation.
vm/devices/pci/pci_core/src/capabilities/pci_express.rs:1
- Similar issue as previous comment - using
unreachable!()infrom_bitsmethods for SupportedLinkSpeedsVector and LinkWidth. Guest-provided values could trigger panics. These should return safe defaults or use Result types instead.
// Copyright (c) Microsoft Corporation.
Uh oh!
There was an error while loading. Please reload this page.