Add support for running protected VMs with pKVM on Intel x86 [1].
The --protected-vm option is not workable yet, since loading pvmfw into
guest memory via pKVM is not implemented yet, but the developer options
--protected-vm-without-firmware and --protected-vm-with-firmware are
working.
Following the approach used for pKVM on arm64, the KVM uAPI used for
running protected VMs on x86 is a "stable temporary" uAPI: the
KVM_X86_PKVM_PROTECTED_VM value shall be updated when upstreaming pKVM
to the mainline kernel (see also [2]).
[1] https://android-review.git.corp.google.com/c/kernel/common/+/3351287
[2] https://android-review.git.corp.google.com/c/kernel/common/+/3351286
BUG=b:349990461
TEST=On an Intel device with kernel compiled with pKVM-IA patches [1]
and kvm-intel.pkvm=1 added to kernel command line, run a VM with
--protected-vm-without-firmware or with --protected-vm-with-firmware
with the same test pvmfw image as in TEST= in CL:5797353.
Change-Id: I625f5eb9a38eaef9312ba62308739efb66f163b0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6022852
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dmytro Maluka <dmaluka@chromium.org>
Refactor `init` and add function `get_features` to get the Vcpu features.
Previously some features were only retrieved as part of `init`.
Add function `finalize` which is required for SVE support. SVE requires
`KVM_ARM_VCPU_INIT` to be called first, which gives access to the SVE
config, specifically `KVM_REG_ARM64_SVE_VLS`, which is a
pseudo-register that allows discovering and configuring the vector
lengths by userspace. After `finalize` is called,
`KVM_REG_ARM64_SVE_VLS` is no longer accessible, and the config is
final. In this patch, we are not modifying the vector lengths, reason
behind this is `KVM_ARM_VCPU_INIT` initializes `KVM_REG_ARM64_SVE_VLS`
to the best set of vector lengths that the host supports.
BUG=b:375372656
TEST=presubmit
Change-Id: Ibd0902ad68f28b9d4e9a595070fe972e620e5572
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5973935
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Elie Kheirallah <khei@google.com>
Replace the ioctl definition using a magic number with the appropriate
macro call. Note that this commit also limits the availability of the
constant to AArch64 Android, the only builds using it as per the cfg
attributes of KvmVfioPviommu::ioctl_kvm_pviommu_set_config().
TEST=m crosvm # in AOSP, then validated the constant using decompilation
Change-Id: I6099a69419c5c562b0c5ce5b27ac3f24b73c9244
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5750141
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Update the ioctl number to a well-formed value, following the similar
fix to the experimental Android kernel. Obviously, this is a breaking
change rendering new (resp. old) versions of that kernel incompatible
with version of crosvm missing (resp. including) this commit.
However, this is fine because both the kernel and this support for
pKVM-VFIO are experimental, as stated in fdb527c202 ("vfio: Add
support for pKVM-VFIO pvIOMMUs").
TEST=Commit-Queue
Bug=b:278039964
BUG=b:306110430
Change-Id: Iefdebfb3df41aa647fac43eab50e379ca7821817
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5739077
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
For ioctl numbers that do not require any parameters, make ioctl_io_nr
and related macros generate a constant rather than a function with no
parameters. This makes the code that uses these constants more idiomatic
and also allows using the constants in match statements (see an example
in virtio/fs/passthrough.rs).
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: Id52817528d770c5dbbe2ce7928c9f31a15c83d83
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5648647
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Ensure that every Cargo.toml dependency on a third-party crates.io crate
specifies at least a major version, or a minor version for 0.x crates,
to ensure that if a new major version is published, it cannot cause API
breaks.
The versions are selected to match the ones already in Cargo.lock, so
this should have no functional change, but it will help prevent new "*"
versions from being introduced via copy-and-paste.
For rationale, see the Cargo FAQ:
<https://doc.rust-lang.org/cargo/faq.html#can-libraries-use--as-a-version-for-their-dependencies>
`minijail`, `audio_streams`, and `cras` are left as "*" for now, since
they have unusual situations (imported from a submodule and/or replaced
at build time with ebuild magic).
BUG=None
TEST=tools/dev_container tools/presubmit
TEST=verify Cargo.lock is unchanged
Change-Id: Ifa18199f812f01d2d10bfb4146b3353c1a76527c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5555656
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
A few x86-specific definitions are moved inside `mod x86`.
The cfg checks for `KVM_GET_REGS` are removed, since this ioctl is in
fact available on aarch64 (arm64); possibly the original confusion was
due to the fact that this ioctl is not available on 32-bit arm, but we
don't support the 32-bit arm ioctl interface.
The arch-specific re-exports are moved to immediately follow the
relevant module for consistency (and to ensure `cargo fmt` doesn't
rearrange them in a confusing way).
Outdated bindgen commands in comments are removed; the bindings are now
generated by an automated script.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: I9b0072e7dc90e7b328652dc39d5d82b30ba8d462
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5518125
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
On Intel, new noncoherent DMA mem flag can be set to allow KVM to
recognize guest cache setting for EPT, which allows WC attribute to be
applied to ensure guest memory access is synchronized in noncoherent DMA.
Unlike previous POC for new device attribute, this uses new added flag
for mem slot.
BUG=b:316337317
TEST=cargo build and run GPU workload
Change-Id: If16d61031bdb2cf0252a57e99d4b6725a89dd38a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5171312
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Stanisław Kardach <skardach@google.com>
This generates riscv64/bindings.rs from the kernel headers to bring it
in line with the other auto-generated bindings, which is possible now
that we are generating the bindings from new enough kernel headers
(Linux 6.6).
BUG=b:287496832
TEST=tools/dev_container tools/presubmit crosvm_unit_tests_riscv64
Change-Id: I86c17d75a467368dcc99e616a2dfd31ee8cb1071
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4676074
Reviewed-by: Dylan Reid <dgreid@rivosinc.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The obsolete KVM_SET_MEMORY_ALIAS ioctl was removed from the kernel; it
was already unused in crosvm, so remove the corresponding ioctl macro.
Change-Id: I1ecfce4b8df886680154c567f82ab7f006fbfd1f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5178535
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This removes some auto-generated safety comments, but should otherwise
be a no-op.
Change-Id: Ibfcf75c6e296367fe1a6114ce2047fb79e34041b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5178534
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This was missing the most recent additions from kvm_sys/bindgen.sh.
The changes are not relevant for x86, but it is useful to keep the
generated file up to date to avoid confusion when the bindings are
modified in the future.
TEST=kvm_sys/bindgen.sh
Fixes: fdb527c202 ("vfio: Add support for pKVM-VFIO pvIOMMUs")
Change-Id: I9305150506785c2b4b4d0e25e88b2c2b365bf80c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5178532
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Teach crosvm to spawn para-virtualized IOMMUs emulated by pKVM, which
are used by protected VMs to control the DMA translation regime of their
assigned (physical) devices without relying on the (untrusted) host or
VMM.
Implement a virtual topology with a 1-to-1 mapping between VFIO devices
and pvIOMMUs (i.e. no support for multiple devices per pvIOMMU nor for
multiple pvIOMMUs per device).
To allow guests to refer to individual pvIOMMUs in calls to the
hypervisor (for example, to map/unmap DMA), they are given an ID, which
the uAPI defines as the FD returned from one of its ioctls.
Like the rest of pKVM, this feature is specific to Android on AArch64.
Note: This makes use of a uAPI that is currently only available on some
experimental (non-production) Android kernels and is likely to
change!
TEST=tools/run_tests
BUG=b:306110430
Change-Id: I00c065754cffa39307272ad00698647e56404894
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5009546
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Updates are made to source and documentation.
This more accurately represents the currently supported platforms of
Android/Linux and Windows, without unexpectedly including other
unix-like operating systems.
Command to reproduce:
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -i 's/cfg(unix)/cfg(any(target_os = "android", target_os = "linux"))/g' {}
$ cargo fmt
md files manually updated to fix line lengths.
Renaming `unix` modules to `linux` will be done in a later CL.
Test: ./tools/dev_container ./tools/presubmit
Bug: b/298269162
Change-Id: I42c1bf0abf80b9a0df25551613910293217c7295
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4909059
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
In particular, this fixes the Clone impl for __BindgenUnionField, which
triggers clippy's incorrect_clone_impl_on_copy_type in Rust 1.73.
Additionally, --size_t-is-usize became the default and the option was
removed in bindgen 0.65.0, so the flag is dropped from our bindgen
command line.
BUG=None
TEST=tools/bindgen-all-the-things
Change-Id: I40a26cd4a9e2897af8a354f454f4909429d2feda
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4927831
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
DataInit type is finally completely eliminated from crosvm. No
traces, not even in comments, were left.
BUG=b:300969352
BUG=b:204409584
Change-Id: I79742f8e06b90afd53fab338d9052b25ae0af84e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4878508
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Update bindings for new kernel to seprate from change to bindings
due to modified bindgen script.
TEST=CQ
BUG=b:300969352
Change-Id: I8a1ff5c1e7cc25b0af3b25b6509c693b3c0e1f95
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4928008
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Zihan Chen <zihanchen@google.com>
crosvm has never actually supported running on a 32-bit x86 host, only
x86-64. Remove the cfg(target_arch = "x86") checks throughout the tree
to make this clear (and to simplify the code).
This doesn't affect the code running inside the guest, which can still
be a 32-bit x86 operating system if launched via --bios, for example.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: Ifd888db54c58ec8a5fcf840871ef564771d9066b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4794387
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This is not in upstream Linux, only used by crosvm-direct, which is
being removed. Partially reverts commit f622e504d3 ("crosvm/kvm:
enable runtime detection of IOAPIC pins").
BUG=b:276993009
BUG=b:279663365
TEST=tools/dev_container tools/presubmit
Change-Id: I2d6501a268c635145d8cd25944b5c82fc82b4ec4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4615556
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This was left over from commit a8985f0ba8 ("x86: remove deprecated
KVM based s2idle notification related code"). Additionally, the comment
about the bindgen script was removed even though it is still in the
script, so the generated output did not match what was checked in.
BUG=None
TEST=kvm_sys/bindgen.sh
Change-Id: I241220dd5d0121ce2dca1ce0597ebf1f258f1c20
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518567
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This commit reverts 344e2432d1 "x86:
handle KVM_SYSTEM_EVENT_S2IDLE request" but also some other parts which
grow around this concept. The s2idle notification linux counterpart
based on KVM hypercall was rejected in the linux kernel mailing list and
new approach was suggested which is based on virtual PMC. Additionally
the privileged guest term was introduced only for ManaTEE, which is not
evaluated anymore.
The new Virtual PMC related approach is used instead for getting guest
s2idle notifications, see CL:3780642.
BUG=None
TEST=Build + tools/presubmit crosvm_tests_x86_64
Change-Id: I3cf4b77ab192198fe9e8b990b994a41105c2e72f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4507305
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Add initial KVM bindings generated from a 6.2 tree with the AIA patches
applied.
See the riscv_kvm_aia_v1 branch here: https://github.com/avpatel/linux
The AIA changes should land soon upstream, but pulling them in early
won't hurt other arches and will allow riscv to get started.
Change-Id: I9e20c968e6c044100bc6ec1b2fb5f441f0276f77
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460933
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This ioctl has been long deprecated and is removed from 6.2+ kernels.
It's not used by crosvm so this change should have no affect.
Change-Id: Ieb1b7c1772643d221356ca1ecb8f6a32095febba
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460931
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: 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>
Instead of configuring which crates to --exclude in
test_config.py, we can use conditional compilation to
exclude code that is not supported on windows.
This allows more fine-grained control and also allows
us to use plain cargo for building without complicated
configuration and exclusions.
BUG=b:265829867
TEST=cargo test --lib --bins --workspace
--target=x86_64-pc-windows-gnu
--features=all-mingw64
Change-Id: I8422c3f08053bc27d9896b220876a56bd25543d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4165868
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
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>
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>
This requires a few tweaks to non-generated code:
- VIRTIO_ID_VIDEO_ENC/DEC -> ENCODER/DECODER
- io_uring unnamed union layout change
Change-Id: I58e118efa5c6bf28ff56d211fec5603651cb60bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3893753
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
While we are tweaking all of the copyright headers, let's take the
opportunity to ensure there is always a blank line after the copyright
header for consistency. (Almost all files already follow this style.)
This includes a slightly ugly regex to allow the end of a C-style
comment block after the end of the copyright:
/*
* Example comment block
*/ <-- this line
Change-Id: Idfd0855861e5ecb3d33afae942fdba908af0dcff
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3892521
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
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>
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>
The flexible_array_impl! macro should not rely on the caller to import
FlexibleArray; use $crate::FlexibleArray to refer to it instead.
BUG=None
TEST=tools/presubmit
Change-Id: I9743a4cbc01deb6cdfadd98e63f4803a5572421c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3687064
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
turbostat shows cpu freq/c-state/thermal statistics data by reading
some related MSRs. Unfortunately some MSRs such as MSR_IA32_POWER_CTL
are already emulated by KVM. The emulated value are not what we want
to expose to Chrome OS guest. KVM_X86_SET_MSR_FILTER ioctl provides
a way to skip KVM's emulation and let user space handle the MSR.
We added two MSR actions "MsrPassthroughFilter" and "MsrEmulateFilter"
to indicate the corresponding MSR needs to be filtered.
BUG=b:229770963
TEST=Run "turbostat" in Chrome OS guest and show correct value.
Change-Id: I5920ddba091589170dc326e10187aec66f75df79
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3641465
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This provides at least a minimal one-line description to show what each
crate is about.
BUG=None
TEST=tools/cargo-doc
Change-Id: I26732e8c29062e622d5be09bdc120a49d564b9fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3630422
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
When Crosvm receives a KVM_SYSTEM_EVENT_S2IDLE event, it means the
guest VM is entering s2idle suspend state, and it's requesting the
host to put the whole system in the same state.
If hypervisor sends the request on behalf of a privileged VM, Crosvm
can initiate s2idle suspend on the host since it's been granted with
system power management privileges.
BUG=b:199383670
TEST=trigger s2idle from ChromeOS guest
Change-Id: I589a7e1d93abb5ab971fd58de94ee75df48c3c6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3414635
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dmytro Maluka <dmaluka@google.com>
Commit-Queue: Allen Webb <allenwebb@google.com>
These may be used by the pVM firmware or bootloader for protected VMs on
Android to indicate the reason why a VM failed to boot, such as a
verification failure, and so we want to have them in the logs for
debugging.
BUG=b:220084045
Change-Id: I449873fb85d590d9e7978a93648e90586ecfff10
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3473452
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Andrew Walbran <qwandor@google.com>
Run tests for sys_util_core, poll_token_derive and balloon_control on
windows.
Using dotfiles to disable/serialize test runs of a subset of crates does
not work well with third party crates as it forces us to commit the dot
file to the crate.
The patch modifies and uses the script that runs linux tests.
This patch also allows us to
- build/test child crate even if parent crate has disabled build/test.
- avoid building crosvm if it is not explicitly specified.
RIP short lived .windows_build_test_skip. You allowed us to run noop
kokoro tests.
Test: py .\tools\impl\test_runner.py --arch x86_64
Bug: b:215610772
Change-Id: Icc6d04ffd7c0c33d4f60aeac16fc7d23881c387d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3459809
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
This adds a blanket allow to the top of the bindings file. The bindings
will need to be regenerated in a separate CL.
BUG=b:192373803
TEST=./tools/presubmit
Change-Id: I6554d17fffde2089e29bf2e7c184b8cac937db6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3439049
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
The patch also adds files to skip building and testing crates on
windows. When we run
```
tools/windows/build_test.py --skip_file_name .windows_build_test_skip
```
the build/test succeeds without actually doing anything as build/test
for all crates is skipped by creating '.windows_build_test_skip'.
Bug: 213170957
Test: Ran script on downstream repo
Change-Id: Iebd2cea463ee722be4feaed88229e1fb5e9fd6c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3417918
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>