crosvm/hypervisor
Ryan Neph d93be1b11d virtio: optional prepare of pci bar mapping with explicit MemCacheType
Lazy-init of VirtioPciDevice shared memory region (to setup hypervisor
mapping) would previously use the MemCacheType seen on first mapping,
which could be anything -- this behavior is never desired, but grew from
a later addition of MemCacheType workaround to the existing Virtio "Fixed
Mapping" optimization.

On devices where the single hypervisor mapping's MemCacheType matters
(e.g. for devices that must configure it with
MemCacheType::CacheNonCoherent), if the first mapping attempted is for a
shmem with WB caching, all later mappings with WC or UC memtype would be
configured incorrectly.

Instead, query the VirtioDevice Trait implementator whether lazy-init of
a single hypervisor mapping should be used (the default), and with which
MemCacheType.

Attempting to later add a `CacheNonCoherent` mapping for a device that
explicitly declared `SingleMappingOnFirst(CacheCoherent)` is invalid,
and would lead to bugs, so we now treat this as an error and fail the
mapping altogether.

VirtioGpu device implementations will use this for devices with either
mandatory or optional-but-enabled non-coherent DMA (e.g. Intel devices
without coherent LLC shared between CPU/GPU, or that may opt to bypass
LLC coherency for optimal perf).

BUG=b:360295883, b:246334944
TEST=Builds

Change-Id: If41d238fd3c220e45c61d78da4a2505572709053
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5871721
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
2024-09-20 00:33:26 +00:00
..
hypervisor_test_macro hypervisor: convenient macro to generate an array from inline assemblies 2024-05-21 19:31:17 +00:00
src virtio: optional prepare of pci bar mapping with explicit MemCacheType 2024-09-20 00:33:26 +00:00
tests hypervisor: allow test to config the TR register 2024-09-10 00:01:48 +00:00
Cargo.toml hypervisor: TLB flush test 2024-07-10 20:42:34 +00:00
README.md hypervisor/README.md: add qualcomm contacts for gunyah 2023-11-29 19:20:17 +00:00

Hypervisor Support

Multiple hypervisor backends are supported. See Advanced Usage for overriding the default backend.

Hypervisors added to crosvm must meet the following requirements:

  • Hypervisor code must be buildable in crosvm upstream.
    • Within reason, crosvm maintainers will ensure the hypervisor's code continues to build.
  • Hypervisors are not required to be tested upstream.
    • We can't require testing upstream because some hypervisors require specialized hardware.
    • When not tested upstream, the hypervisor's maintainers are expected to test it downstream. If a change to crosvm breaks something downstream, then the hypervisor's maintainers are expected to supply the fix and can't expect a revert of the culprit change to be accepted upstream.

KVM

  • Platforms: Linux
  • Tested upstream: yes

KVM is crosvm's preferred hypervisor for Linux.

WHPX

HAXM

Android Specific

The hypervisors in this section are used as backends of the Android Virtualization Framework.

Geniezone

Gunyah