Add the infrastructre for GDB 'p'/'P' packets, used by the client to get
or set individual registers.
Implement a back-end using KVM_{G,S}ET_ONE_REG on AArch64, enabling the
client to access the architecture's numerous system registers.
Add stubs for x86 to please the compiler; leave them unimplemented as,
although the ioctl is available, the architecture doesn't seem to make
use of it.
BUG=b:222222882
BUG=b:240711627
BUG=chromium:1141812
TEST=tools/dev_container ./tools/run_tests
Change-Id: I01968275e88e9d0098de40b3f78e2cd3a61b75da
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3785468
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
A proposed set of kernel patches makes it possible to map anonymous
MAP_SHARED mappings into the IPA space of a virtual machine with MTE
enabled. With these patches we can use most features of crosvm with the
exception of pmem which relies on being able to make file mappings in the
IPA space. Therefore, we make MTE an opt-in feature via the --mte command
line argument and forbid specifying --mte together with --pmem-device
or --rw-pmem-device.
Bug: b:234779841
Change-Id: I70bf2d0a8c1aff7c5956d6009ca5169a623bc6b2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3892141
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Peter Collingbourne <pcc@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
This search/replace updates all copyright notices to drop the
"All rights reserved", Use "ChromiumOS" instead of "Chromium OS"
and drops the trailing dots.
This fulfills the request from legal and unifies our notices.
./tools/health-check has been updated to only accept this style.
BUG=b:246579983
TEST=./tools/health-check
Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
We are going to need to start passing a new arch-dependent configuration
parameter to KvmVm::new in addition to protection_type. Since we can't
[cfg] a function argument, and to avoid churning the tests the next time
we need another argument, let's create a hypervisor::Config struct and
start passing protection_type that way.
Bug: b:234779841
Change-Id: I42ce9438b064658ebb9732e78ee5c82dac2636b6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3892140
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
The haxm vcpu code abused MemoryMapping to hold what is effectively a
raw pointer, not something created by mmap()/MapViewOfFile().
Additionally, the MemoryMapping was converted into a pointer and then
into a Rust &ref, which is inappropriate for memory that can be aliased
by the hypervisor.
Use raw pointers instead of unsoundly casting into a reference and add
unsafe blocks as appropriate.
Change-Id: I218093d512419beb1d9f23df9a45c7413c0f83c0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3827178
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
The functions being called do not have return values (they return the
unit value), so the `let _ =` does nothing and can be removed.
Fixes a new clippy lint:
<https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value>
BUG=b:243677117
TEST=tools/clippy # with Rust 1.62
Change-Id: I6003b162c36e7be1ee71e3edc4e304c86fdc5676
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3854970
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Turn KvmVcpuRegister into an enum that supports any kvm_regs entry (not
just kvm_regs::regs i.e. user_pt_regs).
Improve the abstraction provided by KvmVcpuRegister through the 2-step
conversion "VcpuRegAArch64 -> KvmVcpuRegister -> u8", which allows more
flexibility when KVM doesn't provide 1-to-1 mappings (CCISDR, SVE, ...)
and when other types (e.g. gdbstub) need to be mapped to KVM_SET_ONE_REG
values.
Introduce the firmware pseudo-register type as a KvmVcpuRegister variant
and use it for KVM_ARM_PSCI_VERSION.
BUG=b:222222882
BUG=chromium:1141812
TEST=tools/dev_container ./tools/run_tests
Change-Id: Id11c427fc48f4b6bef9df607eeb73928aa7f5da7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3785463
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Pierre-Clément Tosi <ptosi@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Re-work the API to support non-64-bit registers (e.g. FP & SIMD), as
supported by the architecture and KVM and keep *_u64 helpers for the
common case of 64-bit registers.
Note: no functional change intended.
BUG=b:222222882
BUG=chromium:1141812
TEST=tools/dev_container ./tools/run_tests
Change-Id: I9dd95e96ba4b1f759c603f885ff38aefab52b5cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780661
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Pierre-Clément Tosi <ptosi@google.com>
Commit-Queue: Pierre-Clément Tosi <ptosi@google.com>
Use a single variant to represent a core GPR instead of having one
variant per register. This simplifies manipulating VcpuRegAArch64 at the
expense of needing the instantiating code to ensure that the <u8> is
properly set (i.e. is < 31). This is currently not an issue as the
variant is only instantiated with constant values.
BUG=b:222222882
BUG=chromium:1141812
TEST=tools/dev_container ./tools/run_tests
Change-Id: I0043c101e88794a1661fadbc22b79fc68356270d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3822688
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Tested-by: Pierre-Clément Tosi <ptosi@google.com>
Allocate the same way as the rest of RAM, whether in
unprotected-with-firmware mode or actually protected mode.
TEST=tools/dev_container tools/run_tests --target=vm:aarch64
Change-Id: Ic0ebc0d90e91bd450af55f3252039ddab8d26443
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3827215
Commit-Queue: Andrew Walbran <qwandor@google.com>
Tested-by: Andrew Walbran <qwandor@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Instead of proxying doorbell MMIO writes via the proxy device in crosvm,
register the vring call eventfds with KVM so that the kernel signals the
sibling directly.
BUG=b:240374485
TEST=boot crostini on brya-manatee
Change-Id: I4e33143a38eb01c50fe900a09e8715164792614f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3804519
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Rename the confusing GPR variants from the Wn naming convention (defined
by the architecture as the lower 32 bits of the 64-bit register) to Xn,
which the enum variants actually represent.
Note: no functional change intended.
BUG=b:222222882
BUG=chromium:1141812
TEST=tools/dev_container ./tools/run_tests
Change-Id: I510b93f8aea901dc3707016368c9871392701f51
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780660
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Commit-Queue: Pierre-Clément Tosi <ptosi@google.com>
Tested-by: Pierre-Clément Tosi <ptosi@google.com>
Expose HWP (HW P-State) feature to the guest if enable-hwp is present
and implement these dependencies:
- enable-hwp depends on host-cpu-topology option
- itmt depends on enable-hwp option
Group the CPU configuration entries to a new struct CpuConfigArch,
to simplify APIs in the vCPU configuration path.
BUG=b:199380745
TEST=boot Redrix manatee and verified that intel_pstate driver works
Change-Id: Icdd19190f6a7518492ff5fc54708af40288a1422
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3771065
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Tested-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
- Compiles out pvclock, sandbox and slirp (thereby net device)
- Disables default features on windows (audio and gpu are not ready yet)
- Enables unit tests for crosvm
BUG=b:213146388
TEST=presubmit
Change-Id: I5f4b3d8bf44d9c571c3a191a632e09550a4f1869
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3807045
Tested-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Ran clippy with features that are enabled downstream. Those features
will be enabled upstream in later cls when crosvm starts building.
BUG=b:213146388
TEST=presubmit
Change-Id: I67cb74127a349b572e573c350d69d1611533d961
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3793690
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Tested-by: Vikram Auradkar <auradkar@google.com>
crosvm is switching the import style to use one import per line.
While more verbose, this will greatly reduce the occurence of merge
conflicts going forward.
Note: This is using a nightly feature of rustfmt. So it's a one-off
re-format only. We are considering adding a nightly toolchain to
enable the feature permanently.
BUG=b:239937122
TEST=CQ
Change-Id: Id2dd4dbdc0adfc4f8f3dd1d09da1daafa2a39992
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784345
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
These are only used in KVM, not the other x86 hypervisors, and they
don't really fit into the same category as the rest of Sregs. The
apic_base can be set via set_msrs(), and the interrupt_bitmap is
part of the irqchip state.
To enable this removal, we change the KVM set_sregs() call to retrieve
the current state and use the existing apic_base and interrupt_bitmap.
BUG=b:237095693
TEST=Boot x86-64 kernel on KVM
Change-Id: I275eec83b74f1c364b7a543882f3ac5960201143
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3728988
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Now that we have a Default implementation of Sregs that sets the
architecturally defined reset values, we can initialize the Sregs values
during build_vm(). This allows removal of the set_reset_vector()
function, as all of the values it set are now the defaults in Sregs and
Regs.
This also lets us set up the page tables and GDT only once during
build_vm() instead of rewriting them for every configure_vcpu() call.
This allows consolidation of the BIOS and non-BIOS configure_vcpu()
code.
BUG=b:237095693
TEST=Boot x86-64 Linux kernel
TEST=Boot --bios u-boot.rom
Change-Id: Ief19f983fd252dffa668ff2cfe96a64298e06cf2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723802
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Replace the Sregs Default implementation with one that provides the
register values at reset, based on the Intel software developer
manual.
The x86_64 tests need to be adjusted to only check the CR0 bits they
intend to match, since the default Sregs value now includes other set
bits.
BUG=b:237095693
TEST=Boot x86-64 Linux kernel
TEST=cargo test -p x86_64
Change-Id: If966941df43225572e79ebd9213671348e2846f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3735640
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This matches the reset value of the registers defined by the Intel
manuals. It is currently overwritten on all paths initializing Regs, but
it will be used in an upcoming commit to simplify the BIOS boot path.
BUG=b:237095693
TEST=Boot x86_64 Linux
TEST=cargo test -p x86_64
Change-Id: I7a96882fad05440c98bde2fad7ad15c0890f1cfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3735639
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The MTRR-related MSR setup is split out into its own pub function for
clarity and to allow future reuse. The maximum variable MTRR check is
split out so we can generate MTRRs before having a valid VCPU object.
This unifies the MSR set calls in configure_vcpu() so that the BIOS and
non-BIOS cases use the same code.
BUG=b:237095693
TEST=Boot x86-64 Linux kernel
TEST=Boot x86 u-boot.rom
Change-Id: Ifa0020257a043190de69b7192c2d6b35c01d216e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723800
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
All tests pass on kvm.
`read_only_memory` test does not pass on whpx and haxm, there is a bug
tracking its resolution.
BUG=b:213151455
TEST=Ran `cargo test -p hypervisor` on linux.
Change-Id: Ieb8042c9eb964873b685437f94802fae83765a43
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3739488
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
The registers for cpuid got refactored into a new `cpuid` member. Update
the haxm tests to work with the new structure.
TEST=Ran `tools/run_tests --target=host --arch=win64` by temporarily
TEST=enabling `haxm` in `Cargo.toml`.
Change-Id: I6a70be72fc49015ed2301b422a18b88b374e17c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3737458
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Windows serializes/deserializes these types to send over a Tube.
BUG=b:213146388
TEST=built on downstream windows and presubmit
Change-Id: Ib9ca4cbb2758a997788c4bab46d573a532e8e3d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3735635
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Implement Default for Fpu to initialize the floating point registers to
their officially documented reset values, and use the default Fpu values
to initialize all VCPU floating point state.
These are the same values as used in the previous setup_fpu() function,
so there is no change in behavior. (We now set the FPU state for both
BIOS and non-BIOS, but since the FPU values should match the ones used
at CPU reset, it should not cause any actual behavior change.)
BUG=b:237095693
TEST=boot x86-64 Linux kernel
Change-Id: I4eb656822d8fa4730203970aee178043c19af9ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723799
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Rather than having a single vcpu_init instance that is used for all
VCPUs, make vcpu_init into a Vec so it can store different initial state
for each VCPU. This allows us to set up e.g. bootstrap processor state
differently than other processors, and it also means that the VcpuInit
struct doesn't need to be Copy.
BUG=b:237095693
TEST=Boot Linux with >1 CPU
Change-Id: I0ebfdc2dbd84d0817e3f75c2c852e4320b9e77c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723798
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
At one point the capability was a VmCap and not a HypervisorCap. Because
we don't build these files on Windows yet, this wasn't immediately
obvious. This CL cleans up the issue.
BUG=b:213152505
TEST=fixes applied downstream.
Change-Id: Icdf0c3292ff976ddb74791a158bb65380f1697d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3732380
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Similar to WHPX, haxm requires an accurate (calibrated) leaf value to
make the guest clocksource work accurately.
BUG=b:213152505
TEST=battle tested downstream
Change-Id: I55a45c00758b2112aced6185970ad43df060d0ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3731287
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
There have been two evolutions of providing the TSC cpuid leaf
(aka 0x15) to the guest.
a) For CrosVM on Windows, we have been providing the leaf
unconditionally. Furthermore, we've not been using the
exact host leaf; instead, we calibrate the TSC frequency
and provide that value in the leaf. This was done because
the actual cpuid leaf values are not as accurate as
we needed them to be to drive a guest clocksource.
b) In CrosVM mainline, 4080aaf9b3
introduced the flag enable_pnp / enable_pnp_data, and
provides the exact host 0x15 leaf to the guest if the
flag is enabled.
This CL adds a new hypervisor capability (CalibratedTscLeafRequired) to control
whether or not the calibrated TSC leaf should be used, in addition to a new CLI
option to force it on hypervisors where it isn't enabled by default. The new
option is `--force_calibrated_tsc_leaf`.
BUG=b:213152505
TEST=builds upstream, battletested downstream on WHPX.
Change-Id: I611422808a9e10578c0ddcbd211ae902f937685f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3698993
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This allows passing the entry point of the kernel as the initial
instruction pointer value to each vcpu initialization call.
BUG=b:234155022
TEST=Boot vmlinux ELF kernel on x86-64
Change-Id: I6e7bd710ff304601dc6ec56acc0380cbef72c055
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3711619
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Replace the automatically derived Default with a manual implementation
so we can set bit 1 of the flags register to 1. This is architecturally
defined to be an always-1 bit (for reasons dating back to 8080/8085
source-level compatibility on the 8086), so we should not create a value
where bit 1 isn't set.
BUG=b:234155022
TEST=tools/presubmit
Change-Id: I7835e5a04385654a667b55e2e2ea2121b5807288
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3717524
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
So that a copy becomes a straightforward copy.
We were copy-pasting eax ebx ecx edx many times here.
BUG=None
TEST=build
Change-Id: Ibdabdd0da3876159bda3d29aa2a3927b9a3f40ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3717927
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
We depend on both lazy_static and once_cell, which do basically the same
thing.
The once_cell crate has a few advantages:
- once_cell is on track to be included into libstd.
(https://github.com/rust-lang/rust/issues/74465)
- once_cell doesn't require macro magic.
Replace the uses of lazy_static with their once_cell equivalents so we
don't need to pull in both crates.
BUG=b:236191006
TEST=tools/presubmit --all
TEST=tools/run_tests --target=host --arch=win64 --build-only
TEST=cargo test --features=plugin
Change-Id: I7cabcd837ef4878e8e8ae635bb4f235a58e4cae3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3707624
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Arc::as_ptr() is only available as an associated function.
Fixes compile error:
error[E0599]: no method named `as_ptr` found for struct
`Arc<bindings::WHV_RUN_VP_EXIT_CONTEXT>` in the current scope
BUG=b:213151419
TEST=tools/run_tests --target=host --arch=win64 --build-only
Change-Id: Icc6753e4109b54ca507bb91bc89abd80fae098b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3707626
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
These are currently guarded by a feature flag check that was only
enabled for haxm.
BUG=b:213151419
TEST=tools/run_tests --target=host --arch=win64 --build-only
Change-Id: Id40a29ffd63e378ce1583e56ca0f23914705b6fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3707625
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This will be used to pass the initial register values for each vcpu.
Each architecture can define its own variant of the initial vcpu state.
BUG=b:234155022
TEST=tools/presubmit --all
Change-Id: I696a5ecda202c1ff0681f0b89b89b9eec11e27e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3673615
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Add `whpx` and `whpx_sys` modules that allow using Hyper-V platform as a
hypervisor on Windows. This has been tested running on Windows 19H1 and
above.
BUG=b:213151419
TEST=Compiled and tested on Windows.
Change-Id: If91ea6337876b85c9fdafe6ae4ad39fba40c4979
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3700983
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
The haxm hypervisor introduced a common helper function for this which
is identical to the KVM implementation, so use that everywhere to avoid
duplication.
BUG=None
TEST=cargo build
Change-Id: I346c721cc39b7efdd39f7bb34f78bca203e5a744
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3693051
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Use the upstream style for adding module specific file in the crate
instead of adding a `mod.rs`.
TEST=compiled.
Change-Id: I2225f6615b68738cd3e1cdce68b4d011dfaab790
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3700982
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
The `haxm` implementation depends on `win_util` and `winapi` crates
which are only required on Windows. The `tempfile` crate is used in
testing.
Move `kvm` and `kvm_sys` dependencies for non-windows builds.
BUG=b:213151459
TEST=Compiled on linux.
Change-Id: I55b8ee4ac5da953a17e8bdd063e5ed488e3f53f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3684929
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Don't use box and just use an array.
BUG=b:229770963
TEST=build
Change-Id: I8121e4809e418d7f3e1aa876d567e543ee50693c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3675887
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
The support is behind a feature flag `haxm`. Only tested and works on
Windows. However, it should be easy to make it work on other supported
OSes as well.
This includes the sys bindings for the HAXM interface. Requires that the
haxm driver is already installed on the host.
BUG=b:213151459
BUG=b:213151458
TEST=Compiled
Change-Id: Ifa9ec9236f84156f61443819f97f5d5754e77b93
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3630701
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>