Skip to content

Conversation

@chris-oo
Copy link
Member

On hardware isolated guests with vtom, the guest may access vpci config space with vtom set. Add this tracking in vpci and register for mmio with vtom, so we can correctly handle guest accesses on SNP & TDX.

This fixes vpci relay on TDX, as both Linux and Windows will access config space with vtom set.

Fixup of a cherry pick from #2306 (required changes in device_builder.rs)

…t#2306)

On hardware isolated guests with vtom, the guest may access vpci config
space with vtom set. Add this tracking in vpci and register for mmio
with vtom, so we can correctly handle guest accesses on SNP & TDX.

This fixes vpci relay on TDX, as both Linux and Windows will access
config space with vtom set.
@chris-oo chris-oo requested a review from a team as a code owner October 29, 2025 23:45
Copilot AI review requested due to automatic review settings October 29, 2025 23:45
@github-actions github-actions bot added the release_2505 Targets the release/2505 branch. label Oct 29, 2025
Copy link
Contributor

Copilot AI left a 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 support for vtom (Virtual Trust Boundary On Memory) to the VPCI device infrastructure. The vtom is a memory bit used in hardware-isolated VMs to distinguish between shared and private memory regions. The PR threads the vtom parameter through the VPCI device creation and initialization paths to enable proper MMIO address handling when vtom is enabled.

Key changes:

  • Added vtom: Option<u64> parameter to VPCI device creation functions
  • Implemented vtom bit stripping logic in MMIO read/write handlers to normalize addresses
  • Created separate MMIO regions for vtom-enabled and non-vtom config space access

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vmm_core/src/device_builder.rs Threads vtom parameter through to VpciBus::new
vm/devices/pci/vpci_relay/src/lib.rs Adds vtom field to VpciRelay and passes it through device creation
vm/devices/pci/vpci_client/src/tests.rs Updates test to pass None for vtom parameter
vm/devices/pci/vpci/src/device.rs Adds VpciConfigSpaceVtom struct and vtom handling in map/unmap operations
vm/devices/pci/vpci/src/bus.rs Implements vtom bit stripping in MMIO handlers and adds vtom tracking
openvmm/hvlite_core/src/worker/dispatch.rs Passes None for vtom in non-isolated VM contexts
openhcl/underhill_core/src/worker.rs Passes vtom value from configuration to VPCI devices

@chris-oo chris-oo merged commit 853fa26 into microsoft:release/2505 Oct 30, 2025
30 checks passed
@chris-oo chris-oo deleted the vpci-relay-vtom-fix-2505 branch October 30, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_2505 Targets the release/2505 branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants