Skip to content

vfio_assigned_device: virtualize guest memory-space enable - #4476

Open
kong-ms wants to merge 1 commit into
microsoft:mainfrom
kong-ms:ek/virtualize-guest-mse
Open

kong-ms wants to merge 1 commit into
microsoft:mainfrom
kong-ms:ek/virtualize-guest-mse

Conversation

@kong-ms

@kong-ms kong-ms commented Sep 17, 2026

Copy link
Copy Markdown

Clearing Memory Space Enable on an assigned device triggers a physical MSE clear which in turn triggers an expensive BAR map/unmap on the L1R. OpenVMM only needs to change the guest-visible state while probing and reprogramming BARs.

Return the shadowed MSE bit on Command-register reads. Guest BAR mappings continue to follow virtual MSE transitions, while reset, PCI power-state, and ownership transfer paths retain their existing behavior.

Clearing Memory Space Enable on an assigned device triggers a physical
MSE clear which in turn triggers an expensive BAR map/unmap on the L1R.
OpenVMM only needs to change the guest-visible state while probing
and reprogramming BARs.

Return the shadowed MSE bit on Command-register reads. Guest BAR
mappings continue to follow virtual MSE transitions, while reset, PCI
power-state, and ownership transfer paths retain their existing behavior.
Copilot AI lite review requested due to automatic review settings September 17, 2026 17:51
@kong-ms
kong-ms requested a review from a team as a code owner September 17, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Core MSE virtualization behavior lacks regression tests for byte-enabled command accesses and mapping transitions.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Virtualizes PCI Memory Space Enable for VFIO-assigned devices, avoiding costly physical BAR remapping during guest probing.

Changes:

  • Shadows MSE on command-register reads.
  • Keeps physical MSE enabled while tracking guest MSE transitions for BAR mappings.
File summaries
File Description
vm/devices/pci/vfio_assigned_device/src/lib.rs Implements virtual MSE handling and mapping updates.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1542 to +1544
let physical_value =
ByteEnabledDwordWrite::new(value.extract() | mse_mask, value.byte_enable());
self.write_phys_config(offset, physical_value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants