Vhost-user transport can be implemented differently depending on the
system ; on Unix it can work through a socket or a VFIO device, whereas
Windows will use a Tube. This CL introduces a platform-specific
VhostUserListener type that we will use to abstract this part and
increase the part of shared code between Unix and Windows. It is also
useful to abstract the difference between the different kinds of
listeners on a same system, as it is able to create the right type from
an input string.
This type will also be important to implement jailed vhost-user devices.
The Windows implementation is still a TODO ; this is ok for now as only
the Unix code makes use of it.
BUG=b:217480043
TEST=vhost-user console device works on Linux.
Change-Id: If2f308ce7f71420012ebd2d49361454706f8a6ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3706489
Reviewed-by: David Stevens <stevensd@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
According to the virtio spec, drivers must configure other virtqueue
fields before enabling the virtqueue.
BUG=None
TEST=boot manatee sibling
Change-Id: I7431682a351269a3c45a508848ae6e9992ab0c10
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3737408
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Fix an error where window_base was updated instead of pref_window_base.
Since the calculations for the two windows are the same, refactor it out
into a separate function. Also, return an error on allocation failure,
instead of just printing an error.
BUG=b:237576651
TEST=boot brya-manatee on primus
Change-Id: I82ffdea00156a95886a0a5913552f3fd6e77a2fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3739712
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
It is not the task of crosvm, which is usually unprivileged process, to
mess up with the system configuration, so it should simply expect that
VVU devices are already bound to vfio-pci driver and stop trying to do
it itself.
BUG=b:196186396
TEST=Boot redrix-manatee, start crostini.
Change-Id: Icb777cf66fd54bd74d656821fb76587c7ee70ca3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3712552
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commented out code reference sandbox crate, which still needs to be
upstreamed
Still need to enable:
* balloon (try_clone not implemented)
* console (Need to enable Serial)
* snd (Unix code not conditionally compiled out)
* gpu (Waiting for graphics team to upstream)
BUG=b:237011316
TEST=ran "./tools/run_tests --target=host --arch=win64 --verbose"
Change-Id: I1b5f7ae575365351184042bc65cffcfd7efe999a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3721870
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Disallow modification of a queue configuration's after it has been
enabled, since the spec states drivers MUST configure the other
virtqueue fields before setting enabling the virtqueue. This allows the
queue validation to be done once and then saved, instead of requiring
validation for every peek.
Before this change, modifications of running virtqueues were not well
defined, since the Queue instance owned by the VirtioPciDevice is not
the same as the Queue instance owned by the VirtioDevice implementation.
BUG=None
TEST=boot ARCVM and crostini on ManaTEE and non-ManaTEE
Change-Id: Ibd1f2bdb0a49865cedd8a0424199a72316696b4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3737409
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Refactor udmabuf support out from virtio_gpu into the shared vm_memory
target, so that can be used for vvu.
BUG=b:201745804
TEST=compiles
TEST=./tools/bindgen-all-the-things
Change-Id: I2944f0cb8c75e4320400bfb9f7026dc1efe0c12b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716339
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Move worker thread creation from frontend device into handler. This
removes the need to duplicate the worker thread boilerplate in each
individual device.
BUG=b:201745804
TEST=compiles
Change-Id: Ib6567402a809b9cafe286f575751419e31469d76
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716338
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
The previous configuration made us pull in three different versions of
rand, and depending on "*" is a recipe for API incompatibility.
crosvm-fuzz needs to match its rand version to the rand_core used in
common/cros_fuzz, so that will be upgraded separately.
BUG=b:236978141
TEST=cargo build
TEST=emerge-hatch crosvm
Change-Id: I655ed3f156e4ac43afa3122596f62e9caa43b4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3722184
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Enable most of modules under `irqchip` as well as `tsc` to work with
windows since all their dependencies have been completed. They were
already working for unix.
The test `irqchip::userspace::tests::irq_event_tokens` fails on wine,
however, it work on windows and unix natively.
The test `tsc::calibrate::tests::test_frequency_higher_than_u32` fails
for hosts with cpu>64, since the windows implementation for setting
thread affinity does not support cpu>64.
BUG=b:237024070
TEST=Ran `tools/run_tests --target=host --arch=win64`
Change-Id: I15d8f3c3256e89f89efbe64dbe2ad809fcd90a72
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3737456
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@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>
The original Pit code encoded the start value of a timer into the
count_load_time field as a number of nanoseconds since the start of
the host's monotonic time value. Instead, we can use the PitCounter's
creation_time as the epoch. This makes the math look a bit more sensible
and removes the use of the non-portable clock_gettime() function.
Before
======
get_channel_state():
count_load_time = get_monotonic_time() - start.elapsed()
=== count_load_time = now() - (now() - start)
=== count_load_time = start
set_channel_state():
start = now() - (get_monotonic_time() - count_load_time)
=== start = now() - now() + count_load_time
=== start = count_load_time
After
=====
get_channel_state():
count_load_time = start - creation_time
set_channel_state():
start = creation_time + count_load_time
BUG=chromium:908689
BUG=b:213149155
TEST=cargo test -p devices pit
TEST=tools/run_tests --target=host --arch=win64
Change-Id: I5468d1d964a04b1ce96979ed583b729d139e1005
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723804
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Compiler warnings that only occur when compiled with feature chromeos are fixed.
Fixed=b:235772995
TEST=none
Change-Id: Ie1f120798d0812e7e54984292ccccdac2477a030
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3731294
Commit-Queue: Zihan Chen <zihanchen@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Still need to enable:
* balloon (try_clone not implemented)
* console (Need to enable Serial)
* snd (Unix code not conditionally compiled out)
* gpu (Waiting for graphics team to upstream)
* vhost-user block and handler
The vhost mod is also being built now, but the vhost devices that don't
build on Windows have been disabled.
BUG=b:237011316
TEST=ran "./tools/run_tests --target=host --arch=win64 --verbose"
Change-Id: I3d06a9d49b4bdae14dea47fcfa030834b55925ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723797
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
This is required so the guest can know which resolutions are supported
for encoded formats.
BUG=b:169295147
TEST=ffplay from Linux guest can start streaming.
Change-Id: I6f86108efbc8971f3ee4b9ec494cec16ebce323d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716017
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Switch VmMemoryRequest and FsMappingRequest to use base::Protection to
express permissions, in preparation for unifying the APIs.
BUG=b:201745804
TEST=boot ARCVM and crostini
Change-Id: Id001abbd2dde19aa14fcf1643f25abafdd66a2e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716337
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Add support to create multiple PCM devices in virtio-snd
in addition to multiple streams support. Android will
use different PCM devices for different use cases.
Change num_{output,input}_streams to number of streams
per device.
Changes:
- Add num_{output, input}_devices support in ChromeOS's backend
- Update num_{output, input}_streams in ChromeOS's backend
- Update help message
BUG=b:236924546
TEST=unit test for Parameters parsing
TEST=`aplay -l` with different number of output devices/streams
TEST=`arecord -l` with different number of input devices/streams
Change-Id: I29a3ecc6002ce669c5f771ef490f10419848380e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3722007
Commit-Queue: Pattara Teerapong <pteerapong@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
AsRawDescriptor is a very generic trait and some of the types we want to
use as input sources already implement it for other purposes.
ReadNotifier makes the purpose of the returned descriptor obvious (wait
for some data), so use it instead.
BUG=b:228912920
TEST=console device works in both regular and vhost-user modes.
Change-Id: I68a4ce05be449e07ea71e7cb472e8cda00e9d84d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3671059
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Move the async runner of the vhost-user console device into its own
module and implement a regular VirtioDevice on top of it. This makes
both the virtio and vhost-user console devices use the same
ConsoleDevice struct and runner code, and also removes the input reader
thread from our virtio implementation.
The Windows support cannot use async and thus still needs the older
console device, so keep it around for now even though it is not used on
Linux.
BUG=b:228912920
TEST=virtio console device is working (with input) on Linux.
TEST=vhost-user console device is working (with input) on Linux.
TEST=VVU console device is working (with input) on Linux.
Change-Id: I0a8dfe6c507ef9b765d8d1cdf9870cdcd128a9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3600172
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: 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>
Also remove `dead_code` annotation from `apic.rs` since the consumers
have been added.
BUG=b:213149158
TEST=Ran `cargo test -p devices irqchip -- --nocapture`
Change-Id: Ifda216e23f52ce05b5fee7e80a0751cb3524cf1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3722189
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
This CL also changes the Console::new constructor to only contains
variables in its parameters that it needs.
BUG=b:213149162
TEST=built and presubmits
Change-Id: Iab2a7e7b90cc3f203b8d9ae72320a0c2c50d81f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3671594
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Richard Zhang <rizhang@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
We do not need to reserve bridge window for hot added bridges
because guest will do that for us. This chunk of bridge window is
also reserved by pcie root port, so no extra MMIO allocation is
needed. So we config zeros sized window here for hot added bridges.
BUG=b:199986018
TEST=./tools/presubmit
Change-Id: I7e64b7596e1b5c060cf628a488e2399ae9c257fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3709794
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
When pcie switch get removed from the system, we need to remove
their pci buses. This patch adds a new bool field in PciBus
structure to mark it as a hotplug bus and add support to remove
a pci bus from a pci bus tree. Also some other helper functions
is added for hotplug out usage.
BUG=b:199986018
TEST=./tools/presubmit
Change-Id: I71064127345424bf050d993f60f9d766a299de8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3709793
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Since we've had a common code base PciePort for all pcie ports, pcie
root port should also use this code base. This patch refactored pcie
root port to let it use this code base.
BUG=b:199986018
TEST=./tools/presubmit
Change-Id: I9e1d3f3ebe0a0d89a947771306f4a819e106d30c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3692431
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
To support pcie switch, we need to add both pcie upstream and
downstream port. This patch adds a new file pcie_switch.rs and add
basic implementation for pcie upstream and downstream port.
BUG=b:199986018
TEST=./tools/presubmit
Change-Id: I7cc40d4fd0f017e06c5a0e8b0e3b68a8df9ee185
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3508737
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Sometimes we got buggy interrupt entries in ACPI table which
could confuse linux kernel. Add a new flag to disable it so
virtio devices can skip this part of initialization since they
should all support MSI-X.
BUG=b:236206320
TEST=manual - Run crostini on volteer-manatee
Change-Id: I98764b7cd31a2e68ddcd78d8175442f90ad8b164
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3719139
Commit-Queue: Lepton Wu <lepton@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Allow the device_helpers code to evaluate base_features() with the value
of protected_vm from the configuration to match the pattern used with
other devices.
BUG=b:227283268
TEST=emerge-hatch crosvm # board with chromeos and tpm features enabled
Change-Id: I15b73bbb32d684c1f29130929ec25c4dc9644967
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3717184
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Yi Chou <yich@google.com>
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>
Implement `WhpxSplitIrqChip` for `whpx` (Hyper-V) which has a split IRQ
chip architecture. Add dependencies for the root `whpx` feature on the
`devices/whpx` feature set.
BUG=b:213149158
TEST=Compiled on windows.
Change-Id: I3b0aec441b5abdff3f0266a9467380b0cdc4fdee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3717187
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Rather than having a global CPUIDS variable that is used by all tests
for the TSC CPUID code, we can pass a function pointer to the
tsc_frequency_cpuid() function to retrieve a specified CPUID value. For
normal use, we provide a host_cpuid_count function that uses the normal
__cpuid_count intrinsic as before. For the tests, we provide a fake
CPUID function that returns the desired test values.
This removes the potential for problems when running multiple tests in
parallel (which was hypothetical, since we only had one test so far, but
worth fixing).
BUG=b:234508273
TEST=cargo test -p devices tsc
Change-Id: Ic963b21f09f8e8d7665386ad134ae5e242b3051d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3707623
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Don't log the TSC calibration results for every core at the default info
log level, since that can be quite noisy on machines with many CPUs.
The logs can be re-enabled using the `--log-level` option:
crosvm --log-level=devices::tsc=debug run ...
BUG=b:234508273
TEST=crosvm run doesn't print tsc logs by default
Change-Id: I5051e22740b6b2136d35936c60dee776abd1d00d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3707388
Reviewed-by: Colin Downs-Razouk <colindr@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
In preparation for the upcoming VAAPI backend, derive Clone for Capability.
This is so a Decoder can own a Capability and merely clone it in the
DecoderBackend::get_capabilities call, reducing the number of calls into
the libva driver.
BUG=b:214478588
TEST=None
Change-Id: Ide3d410e0e0a89e774400ea466cac5875ebc8dc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3422777
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
When resources are overlapping we probably want to know what is
overlapping.
BUG=b:236574949
TEST=boot
Change-Id: I4f99f742bda91945f7fe6e94d60bc8adbfe4326f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3715074
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Create an `IrqEventSource` for each instance of IRQ registration with
the `direct` feature.
This fixes a compilation issue with the `direct` feature.
TEST=Compiled with `cargo build --features=direct`
Change-Id: I691b156f84bc6795c887d5203aad7d15aaad22e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3715270
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
We need base features to prevent the "virtio: device uses modern
interface but does not have VIRTIO_F_VERSION_1" error in the kernel
driver.
BUG=b:227283268
TEST=Build OK.
TEST=vmc start --software-tpm termina
TEST=ls /dev/tpm0
Change-Id: Icf3c288f2acc39ec1e8e23250a9d0cd6b8f84eb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3696295
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Leo Lai <cylai@google.com>
Commit-Queue: Yi Chou <yich@google.com>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
This CL will introduce a new TpmBackend called VTpmProxy.
This proxy will bridge the VM tpm device and the vtpm daemon on
ChromeOS.
BUG=b:227283268
TEST=Build OK.
Change-Id: Ibfbfdddbaca2af1d066920bb62918d88b0943d59
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3696292
Commit-Queue: Yi Chou <yich@google.com>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Leo Lai <cylai@google.com>
The bus/address and vendor/product IDs are unused internally; only the
usbdevfs device path matters. Update the internal API parameters and
documentation to match.
The crosvm_control `crosvm_client_usb_attach()` function must keep the
extra parameters to maintain API compatibility, but its documentation is
updated to note that they are unused.
BUG=None
TEST=Attach USB device to Crostini on trogdor
Change-Id: I7086f61a420be1dbf3dd1877fa86a5e82c0c5c77
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3708640
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This irqchip is currently used with Haxm which doesn't implement a local
APIC.
BUG=b:213149158
TEST=Compiled.
Change-Id: I3088ea5cad68451230dc3d5f8b649d54e83b938b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3701442
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This allows irq processing thread to log statistics and metrics and
track them using the source of the device. To be upstreamed later.
Introduce `PCI_VENDOR_ID_CROSVM` which identifies devices created by
crosvm. And introduce `CrosvmDeviceId` which adds a unique device ID for
each type of crosvm device.
BUG=b:213149158
BUG=b:213152505
TEST=Compiled.
Change-Id: Ica1374d8a2d8fd627c9397553bb7fb62baeaff7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3687418
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Pcie upstream/downstream port will also have their related host port,
and their functionality should be similar with pcie host root port.
So I refactored PcieHostRootPort to PcieHostPort here, so that
pcie upstream/downstream port could use them later.
BUG=b:199986018
TEST=./tools/presubmit
Change-Id: I34d46f82c3b3adcfd7b5eb178cda29e902b3eb1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3692430
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>