Skip to content

Add Intel Virtualized PCIE device#5108

Closed
CookieComputing wants to merge 3 commits into
project-oak:mainfrom
CookieComputing:ch_intel_virt_pcie
Closed

Add Intel Virtualized PCIE device#5108
CookieComputing wants to merge 3 commits into
project-oak:mainfrom
CookieComputing:ch_intel_virt_pcie

Conversation

@CookieComputing

Copy link
Copy Markdown
Contributor

We are adding support for stage0 in Cloud Hypervisor and found that we were busy polling for a PCI device on the bridge... Eventually we discovered that Cloud Hypervisor actually has its own PciConfiguration here: https://github.com/cloud-hypervisor/cloud-hypervisor/blob/8248650e799457fee3068b0bf3b54ffcade4bce1/pci/src/bus.rs#L66-L82

Teach Stage0 about this so that we can init the machine with this new type

Changes

  • Moved the mmio64_hole() method to a helper method which introduces an addr_size--This is solely just so that we can customize what arg is passed
  • Added the IntelVirtualPcieHost machine type

Tests

$ nix develop
$ bazel test //stage0
...
INFO: Found 3 targets and 2 test targets...
INFO: Elapsed time: 183.706s, Critical Path: 172.55s
INFO: 1966 processes: 850 internal, 1116 linux-sandbox.
INFO: Build completed successfully, 1966 total actions
//stage0:stage0_test                                                     PASSED in 0.0s
//stage0/testing:stage0_kernel_test                                      PASSED in 0.9s

Executed 2 out of 2 tests: 2 tests pass.

I also launched a SEV-SNP VM using Cloud hypervisor. We're in the midst of adding this support, so please look at the steps in cloud-hypervisor/cloud-hypervisor#7942 (comment) for reproducing the binaries used for testing.

I also used the buildigvm binary from https://gitlab.com/qemu-project/buildigvm, which was checked in recently

stage0_pcie.txt

Cloud hypervisor currently uses an Intel virtualized PCIE host device,
so teach stage0 to recognize it so that stage0 users can also use a new
VMM.

@conradgrobler conradgrobler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks.

Comment thread stage0/src/pci/machine.rs Outdated
@CookieComputing

Copy link
Copy Markdown
Contributor Author
  • Moved the helper function out of I440fx
  • renamed some unit test which had a lint warning
    Re-ran the tests
INFO: Found 3 targets and 2 test targets...
INFO: Elapsed time: 164.315s, Critical Path: 145.89s
INFO: 1966 processes: 850 internal, 1116 linux-sandbox.
INFO: Build completed successfully, 1966 total actions
//stage0:stage0_test                                                     PASSED in 0.1s
//stage0/testing:stage0_kernel_test                                      PASSED in 1.3s

@conradgrobler

Copy link
Copy Markdown
Collaborator

Thank you. Imported as 07ddf17

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