Skip to content

wip: sivm vbs bars - #5295

Draft
emirceski (emirceski) wants to merge 8 commits into
microsoft:mainfrom
emirceski:sivm-vbs-bars
Draft

emirceski (emirceski) wants to merge 8 commits into
microsoft:mainfrom
emirceski:sivm-vbs-bars

Conversation

@emirceski

Copy link
Copy Markdown
Contributor

No description provided.

@emirceski
emirceski (emirceski) requested review from Sunil Muthuswamy (sunilmut) and a balanced review from Copilot November 26, 2026 22:27
@github-actions github-actions Bot added Guide unsafe Related to unsafe code labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

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

Unattested devices can reach Run yet fail isolation-resource queries, and the shared-MMIO test does not verify the acceptance hook needed to keep VBS BARs accessible.

2 open issues
What changed in this PR

This PR adds VBS support to OpenHCL’s PCI relay for SIVM hosts that lack TDISP attestation and cannot make device BARs private.

Changes:

  • Add measured policy options for unattested devices and shared BARs, enabled in SIVM manifests.
  • Implement VBS BAR acceptance and DMA authorization, with policy plumbing through the PCI relay.
  • Extend policy and client tests and document the security implications.
File Description
vm/​loader/​manifests/​openhcl-x64-cvm-sivm-release.toml Enable unattested devices and shared BARs in release images.
vm/​loader/​manifests/​openhcl-x64-cvm-sivm-dev.toml Enable the same policy in development images.
vm/​loader/​igvmfilegen/​src/​product_policy_initrd.rs Encode the new policy fields and extend round-trip tests.
vm/​loader/​igvmfilegen_config/​src/​lib.rs Define manifest options with false defaults.
vm/​hv1/​hvdef/​src/​lib.rs Define the VBS device-I/O authorization hypercall.
vm/​devices/​pci/​vpci_relay/​src/​tests.rs Update relay test initialization and probing arguments.
vm/​devices/​pci/​vpci_relay/​src/​lib.rs Pass policy and MMIO ranges through relay initialization.
vm/​devices/​pci/​vpci_client/​src/​tests.rs Update client tests for the new initialization options.
vm/​devices/​pci/​vpci_client/​src/​lib.rs Forward policy options and identify MSI-X BARs.
openhcl/​underhill_mem/​src/​lib.rs Preserve private visibility when accepting RAM pages.
openhcl/​underhill_core/​src/​worker.rs Supply measured policy and guest MMIO windows to the relay.
openhcl/​product_policy/​src/​lib.rs Add measured permissions and policy accessors.
openhcl/​openhcl_tdisp/​src/​vbs.rs Implement VBS BAR acceptance and DMA authorization.
openhcl/​openhcl_tdisp/​src/​lib.rs Register the VBS validator and shared-MMIO acceptance hook.
openhcl/​openhcl_tdisp/​src/​client.rs Add unattested-device and shared-BAR flows with unit tests.
openhcl/​openhcl_tdisp/​Cargo.toml Add the GUID dependency for VBS device identification.
openhcl/​hcl/​src/​ioctl.rs Expose page-acceptance visibility and device-I/O authorization.
Guide/​src/​reference/​architecture/​openhcl/​product_policy.md Explain the new controls and their trust implications.
Cargo.lock Record the added GUID dependency.

Review effort: Balanced

Comment thread openhcl/openhcl_tdisp/src/client.rs Resolved
Comment thread openhcl/openhcl_tdisp/src/client.rs Resolved
Comment thread openhcl/openhcl_tdisp/src/client.rs Resolved
Comment thread openhcl/openhcl_tdisp/src/client.rs Resolved
Accept an unattested device's BARs shared under allow_unattested_devices,
replacing the separate allow_shared_bars flag and the MSI-X intercept walk.
Report its isolation as shared without a TDI report, record shared accepts
in the no-op validator, and accept BARs again after unbind.
Copilot AI balanced review requested due to automatic review settings November 27, 2026 22:23

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

Unresolved issues can monopolize the polling thread during BAR validation, enable guest-controlled log flooding, and cause initialization to panic when the mocked TDISP flow is enabled on SIVM.

3 open issues
2 resolved since last review

Review effort: Balanced

Comment on lines +98 to +99
let page = chunk.start() + output.elements_processed() as u64 * hvdef::HV_PAGE_SIZE;
let end = page + hvdef::HV_PAGE_SIZE;
let skipped = accept_mapped_pages(&self.hvcall, range)
.with_context(|| format!("failed to accept BAR {range_id} at {range}"))?;
let skipped = skipped.iter().map(|r| r.to_string()).collect::<Vec<_>>();
tracing::info!(
resource_validator,
self.isolation_type,
hvdef::Vtl::Vtl0,
self.options.allow_unattested_devices,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Guide unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants