Some hypervisors (presently: Gunyah) will configure boot-time registers
for vCPUs and not allow userspace VMM to set the boot configuration.
If this capability is declared, then crosvm will not try to initialize
vcpu registers upon VM bootup.
BUG=b:232360323
Change-Id: If2f05c832170f75eabfd7f0c63975465ba75aadf
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4379525
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Introduce a struct argument, MemoryRegionInformation, for use with
with_regions.
No functional change intended.
BUG=b:232360323
Change-Id: Icd40630c32878b3bd185aeeedcf9e1e9de20e20b
Suggested-by: Frederick Mayle <fmayle@google.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4379522
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Gunyah hypervisor requires some VM configuration to be described on the
devicetree. Add a trait to VmAArch64 to allow a hypervisor
implementation to provide the needed info.
BUG=b:253416076
Change-Id: I07091518b856add0c1644bf6a857460da7ff2b3b
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4379521
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Add restore to Vcpu to restore VCPU state from snapshot.
Add kick_vcpu to kick a specific vcpu.
BUG=b:266515147
BUG=b:232437513
Test=crosvm run && crosvm snapshot take img_name socket
Change-Id: Ie09419fd50dcecd0226b2b716236d2c8196b58ec
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4260157
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Elie Kheirallah <khei@google.com>
Auto-Submit: Elie Kheirallah <khei@google.com>
Add snapshot to vCPU for x86 and x86_64 arch.
BUG=b:266515147
BUG=b:232437513
Test=crosvm run && crosvm snapshot take img_name socket
Change-Id: I65d059a7537c713e9ef6c1456a7aeae2b6bc4728
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4237759
Auto-Submit: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Elie Kheirallah <khei@google.com>
This is recommended by the kernel KVM documentation, and it also helps
to provide a more meaningful error if the user provides an incorrect KVM
device path for a file that exists but is not actually a KVM device node
("Inappropriate ioctl for device").
BUG=None
TEST=crosvm run --kvm-device=/dev/null ...
Change-Id: If8e505e2945a76bdd6ba2bf559eeeb3a12f77b15
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4363327
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
To support GenieZone (gz) hypervisor as a crosvm hypervisor backend:
- Implement GenieZone hypervisor
- Implement GenieZone’s irqchip
- Create config and feature for GenieZone
- Probe proper hypervisor backend with naive logic
- Inject virtual interrupts
- Bootup guest VM with linux kernel to shell
We still have other todos:
- Integrate with protected VM and pvmfw
- Support multi-core VM
Fixed bugs:
- Replace gz with geniezone in most cases for clarity
- Replace KVM’s ioctl number with GZVM’s ioctl in bindings
Bug: 264630327
TEST:
$ taskset 10 ./crosvm run --disable-sandbox -m 512 -s s1 \
--rwroot alpine-rootfs.img -p 'init=/bin/sh rodata=off' \
--display-window-keyboard Image_515_41_no_numa_20230130 \
--serial type=stdout,hardware=serial,earlycon \
--serial type=stdout,hardware=virtio-console,console,stdin
Change-Id: Ia5d92ba5cbb4198ab7f9f2a778da03b2199892cd
Signed-off-by: Ze-yu Wang <ze-yu.wang@mediatek.com>
Signed-off-by: Yi-de Wu <yi-de.wu@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4170415
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Move generic implementation of BlockedSignal to base sys.
Change-Id: I459ca424a633dc3fc2a5dec625dde8e5878132c0
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
(cherry picked from commit 5f51fa4ae3b979972d273dff4c224c1999b6e641)
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4346950
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Remove KVM-specific code from the generic aarch64 module by providing a
generic enum for hypervisor-specific vCpus to use instead:
VCpuRegAArch64.
(cherry picked from commit cfd5acd14f924fe17f09c007fb20bf2abc632a79)
Change-Id: I486ea24993493c314ed6dacd5cedeeb135225135
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4346944
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This seems to be purely reserved for alignment reasons; the kernel
never touches it, so we don't need to serialize/deserialize it.
BUG=b:266515147
TEST=tools/presubmit
Change-Id: I3074d24f50a8e0e86340c398885c2fbef1410a88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4342173
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Add get/set VCPU_EVENTS as required to snapshot the full state of the
VCPUs for suspend/resume.
BUG=b:266515147
TEST=build and run VM
Change-Id: Iabca21b67a0eb9906d2e639a616e3f0826dfa659
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4327459
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Elie Kheirallah <khei@google.com>
This CL adds trait implementation for PciDevice to handle BAR
reprogramming. When BAR reprogramming is detected, the PciDevice checks
all ioevents needed, and requests ioevent registeration for events that
are in the changed domain. The requests are handled by instances of
PciDevice via the trait function ioevent_register_request.
Before the CL, ioevent re-registering is unhandled, and PciDevice is
broken without notification. After CL, an error message will appear, but
device still would not function as the added trait is not implemented.
Test: Presubmit Tests. Hotplugged virtio device triggers error
IoEventNotSupported as expected.
Bug: 271204121
Change-Id: Ibf4bc00cfdce24e508cd50b5009f148c5a49db30
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4310071
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
use of `unaligned_references` will be blocked soon and spits out a
warning during compiling. fix it in haxm.
Test: Compiled and ran with haxm enabled.
Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Change-Id: Ia887cff1ce01e6c14a9cf4978bf49835e996dd5a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4324279
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This change adds the function get_xsave to the x86/86_64 platform.
get_xsave allows us to get state of the x87 FPU, MMX, XMM and YMM registers.
This change is needed for serializing vCPUs.
Adds also function to check if XSAVE2 Capability is enabled.
get_xsave is not implemented yet for Windows.
BUG=b:266515147
Test=Build and run VM
Change-Id: I5a9d3b2b86bc11a66db331b4b25d0c348459ab69
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4292298
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Elie Kheirallah <khei@google.com>
Switch to the ChromeOS v6.1 branch and regenerate all affected bindings
in the crosvm tree.
Some minor fixes were required in users of the bindings:
- KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2 is available in the kernel now
and was removed from the manually-added section of kvm_sys.
- The KVM system_event now contains an anonymous union, requiring a few
renames.
- IORING_OP_* were moved into an enum, which required the enum name to
be prefixed to the uses of those values.
BUG=None
TEST=tools/presubmit --all
Change-Id: I84568fb76658832130e2e9a631495ba82fd4c3ed
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4285742
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
We will enable clippy checks on those platforms in CI soon.
BUG=b:268356784
TEST=tools/clippy --platform=aarch64/armhf
Change-Id: Icfefdbce7498731d78448b00c7c21a0f86639dff
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4233580
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
- Rust toolchain is updated to 1.65.0
- Catapult dashboard upload tool is added to dev_container
- Bindgen is updated to latest version to support custom derive
- Derive Eq when PartialEq is derived as required by new Clippy
TEST=CQ, bindgen-all-the-things
FIXED=b:260784028
BUG=b:257303497
Change-Id: I2034cd09e0aed84d4e9b30f2e85d84d94a442ea4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228427
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Adds a new hypervisor capability that causes crosvm to statically
allocate the location of the swiotlb buffer.
This will be used by the gunyah hypervisor.
BUG=b:244630071,b:232360323
Change-Id: Ia2f379bb6f2fa89167ddc73d65ec1b8c5494bdf6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4197001
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Move generic implementation of BlockedSignal to base sys.
Change-Id: Ib6b0aae7cf9e1405c83f8b91131e04c765482d9a
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4174622
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Frederick Mayle <fmayle@google.com>
Add a new configure option in CpuConfigX86_64, and use this option to
set hybrid flags in CPUID for vCPU.
The flags include:
1. CPUID.07H.0H:EDX.Hybrid[bit 15];
2. The Atom/Core type flags in CPUID.1AH.EAX.
Co-Developed-by: Zhuocheng Ding <zhuocheng.ding@intel.com>
BUG=b:255908920
TEST=presubmit
Change-Id: I33663b56fd201221c5fa3557f80d1f5ec5a31c03
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4020038
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
The extra vm_evt_wrtube parameter was added in b375cbf575 ("crosvm:
reduce kiwi feature flag usage"), but the WhpxVm::new() function was not
changed and does not take a SendTube parameter.
The cl introduces dormant vm_evt_wrtube too keep the diff minimum.
BUG=None
TEST=cargo build --target=x86_64-pc-windows-gnu --features=whpx
Change-Id: Ic0c77f67b5dfca1cf666caf94c53add0fe2bdf36
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4133835
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
These should be written as ChromeOS and ChromiumOS (without the space)
to match the updated branding. The copyright headers were already
migrated to the new style (https://crrev.com/c/3894243), but there were
some more instances left over.
BUG=None
TEST=tools/cargo-doc
Change-Id: I8c76aea2eb33b2e370ab71ee9b5cc0a4cfd00585
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4129934
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Since the newly-added Vm::enable_capability() function is only required
for hypervisors which support VmCap::BusLockDetect, we can add a default
implementation of the function in the trait for other hypervisors. This
replaces the version from HaxmVm and also implements it for WhpxVm,
which is not enabled by default.
Additionally, handle the VmCap::BusLockDetect case in the WpxVm
check_capability() function to fix compilation.
BUG=None
TEST=Build for Windows with whpx feature enabled
Fixes: 59f6611a74 ("Add bus lock detect support in CROSVM")
Change-Id: I8a4ed7c14a224439dbba79d44134219658786e8f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4087466
Reviewed-by: Clarissa Garvey <clarissagarvey@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Yiming Zhang <yiming.zhang@intel.corp-partner.google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
A bus lock is acquired through either split locked access to writeback
(WB) memory or any locked access to non-WB memory. It is typically >1000
cycles slower than an atomic operation within a cache and can also
disrupts performance on other cores.
Virtual Machines can exploit bus locks to degrade the performance of
system. To address this kind of performance DOS attack coming from the
VMs, bus lock VM exit is introduced in KVM and it can report the bus
locks detected in guest. If enabled in KVM, it would exit to the
userspace to let the user enforce throttling policies once bus locks
acquired in VMs.
The availability of bus lock VM exit can be detected through the
KVM_CAP_X86_BUS_LOCK_EXIT. The returned bitmap contains the potential
policies supported by KVM. The field KVM_BUS_LOCK_DETECTION_EXIT in
bitmap is the only supported strategy at present. It indicates that KVM
will exit to userspace to handle the bus locks.
This patch adds a ratelimit on the bus locks acquired in guest as a
mitigation policy.
Introduce a new field "bus_lock_ratelimit" to record the limited speed
of bus locks in the target VM. The user can specify it through
"bus-lock-ratelimit". In current implementation,
the default value of the speed is 0 per second, which means no
restrictions on the bus locks.
As for ratelimit on detected bus locks, simply set the ratelimit
interval to 1s and restrict the quota of bus lock occurence to the value
of "bus_lock_ratelimit". A potential alternative is to introduce the
time slice as a property which can help the user achieve more precise
control.
Change-Id: I60708cfd056062281d6384a2a3aa9acfe0326af2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3969352
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zhenyu Z Wang <zhenyuw@linux.intel.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
...round 2 because building locally missed some :)
Most are safe, similar to crrev.com/c/4014832
Two require an exception, similar to crrev.com/c/4018392
BUG=b:157245930, crbug:908640
TEST=CQ with needless_return suppression disabled
Change-Id: I0f54ee1e4688afe9c9f596bd32a98070aac20612
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4019273
Commit-Queue: Clarissa Garvey <clarissagarvey@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
These tests require kvm to pass and are not suitable for a unit
test.
In order to move the test, KvmVm::create_vcpu had to be renamed
to prevent conflicts with the trait function VcpuX86_64::create_vcpu,
implemented for the same type.
The aarch64 variant does not actually run in CI since the tests
do not pass in the emulated aarch64 environment. So the
DO_NOT_RUN_AARCH64 flag remains.
BUG=b:244623454
TEST=presubmit
Change-Id: I79bba3926a38d19350e2fd3c7bfa4662499223e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999799
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Use the off64_t versions of libc file functions.
There is no Rust libc crate equivalent of the C _FILE_OFFSET_BITS and
related defines, so we have to use the Linux-specific *64 variants
explicitly.
This extends the size of file offsets to 64 bits instead of 32 on
platforms with 32-bit userspace.
(It also fixes the recently introduced check for non-LFS functions in
ChromeOS - see b/201531268 for details.)
BUG=b:201531268
TEST=emerge-kevin crosvm
TEST=start Crostini on kevin
Change-Id: Ife42917c8896d4fa1ccd78051c2a0b7dd565b2b3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3979975
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The code from configure_vcpu_early() is split into two parts:
1. vcpu_features() returns the `VcpuFeature`s required for vcpu.init()
2. vcpu_init() returns the general register state
This makes use of the new generic vcpu_init code path and moves the
general purpose register initialization into configure_vcpu() rather
than the ARM-specific confgiure_vcpu_early() to be consistent with other
architectures. Only the vcpu.init() call needs to happen before irqchip
is finalized on ARM, not other register setup.
BUG=b:237095693
TEST=tools/presubmit --all
TEST=Boot Crostini on trogdor
Change-Id: Ib3eab946ba9f1e407f339c2119d36d280655066f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786979
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Ensure all of the cfg checks for whpx also validate the target is
Windows when used in generic (non-Windows-platform-specific) code. This
will allow all builds to enable the whpx feature by default.
BUG=b:213151419
TEST=tools/dev_container tools/presubmit --all
Change-Id: I1faebeed227ac5653697195b195b0884e043f110
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3989384
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Trying to reconcile the difference between the linux and windows
implementations.
Code relying on the eventfd count must now use the linux specific
`EventExt` interface.
BUG=b:231344063
TEST=presubmits
Change-Id: I14eb50f7a02d766a00f27aca388823309633e193
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3864030
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Add a mode where the VM is placed in protected mode but the protected
firmware has been provided to crosvm and preloaded at its usual address,
instead of being loaded by the hypervisor at VM boot time. This is
useful for automated testing of firmware builds and development.
BUG=b:243646855
TEST=build
Change-Id: I849f3c6f0de55607893862d1d7739f6e1b410990
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3944853
Commit-Queue: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Andrew Walbran <qwandor@google.com>
Reviewed-by: Jiyong Park <jiyong@google.com>
Introduce a set of helper methods that expose individual characteristics
that particular subsets of the ProtectionType variants share. These will
simplify various match statements into conditionals by encapsulating the
deduction of those characteristics, making the calling code more concise
and robust.
BUG=b:243646855
TEST=build
Change-Id: I65ff3e61c448d90704551b79c21c64d1b4c11dc4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3944852
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Fix a few stray references to "CrosVM" and "CrosVm" so that we refer to
the crosvm project with consistent capitalization.
BUG=None
TEST=None
Change-Id: If5c3c131774d6e5da1d27466810642aec3cb42ac
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3938640
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
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>