crosvm/hypervisor
Daniel Verkamp 2fc3047b9b hypervisor: x86_64: clarify Segment limit units
The limit value in a kvm_segment is intended to be in bytes, meaning it
should already include the scale factor from the G (granularity) field.
This is basically undocumented, but this is based on observation of the
values assigned to kvm_segment limit fields inside the kernel being
larger than 20 bits.

Rename the field in the generic Segment struct to "limit_bytes" to make
its units clear and match the KVM behavior.

I could not find documentation for either WHPX or HAXM to determine
whether their limit fields should be in units of bytes or not, so those
hypervisors currently perform the conversion to maintain the previous
behavior of using the raw limit field as encoded in the GDT entry.

This mostly does not matter for 64-bit guests, since segment limit
fields are ignored in long mode, but it does matter in 32-bit protected
mode.

BUG=b:354053941

Change-Id: I1e464d3e1b8556184c732adea034b326e5ed6a72
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5727075
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-07-26 21:20:39 +00:00
..
hypervisor_test_macro hypervisor: convenient macro to generate an array from inline assemblies 2024-05-21 19:31:17 +00:00
src hypervisor: x86_64: clarify Segment limit units 2024-07-26 21:20:39 +00:00
tests hypervisor: x86_64: clarify Segment limit units 2024-07-26 21:20:39 +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