Since PCI is not the only transport that Virtio can operate on,
implement function to expose transport type - PCI by default for crosvm.
BUG=b:189182339
TEST=boot manatee and verify that Virtio PCI devices work properly
Change-Id: Ida66a45648ee2396e7df4903750b1c4f85d6e4f9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3855005
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Tomasz Nowicki <tnowicki@google.com>
Commit-Queue: Tomasz Nowicki <tnowicki@google.com>
Virtio over MMIO is using single edge-triggered IRQ which is used
to deliver notification for all vrings assigned to the MMIO device.
Introduce new MMIO interrupt type abstraction and allow to configure
corresponding edge-triggered IRQ.
BUG=b:189182339
TEST=boot manatee and verify that Virtio PCI IRQ works properly
Change-Id: I24be2fdb9ca6eae065d127cfbf160b2783b5e0cb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3855004
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Tomasz Nowicki <tnowicki@google.com>
Commit-Queue: Tomasz Nowicki <tnowicki@google.com>
Virtio, by spec definition, can operate using multiple transport medium
e.g. PCI, MMIO etc. In preparation for adding another transport medium
introduce Virtio transport type abstraction to do proper distinction
while setting up interrupts.
BUG=b:189182339
TEST=boot manatee and verify that Virtio PCI IRQ works properly
Change-Id: I6b8993e10f0a8edd3d3776322939f3dca70048c4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3855003
Tested-by: Tomasz Nowicki <tnowicki@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Tomasz Nowicki <tnowicki@google.com>
If a vfio-platform device has no mmio regions, it is unexpectedly
destroyed at startup (in particular, its vfio device fd is unexpectedly
closed, so its interrupt forwarding stops working, etc) since in
generate_platform_bus() arced_dev is not added to mmio_bus so there are
no more references to the device. To fix this issue, preserve references
to platform devices also in platform_devices field of RunnableLinuxVm.
BUG=b:197169350
TEST=Use vfio-platform for passthrough of a device with interrupts but
without mmio regions, e.g. touchpad on Brya, and check if it works in
the VM (i.e. its interrupts are successfully delivered).
Change-Id: I4042c5508ef6b69649c7d20962edf61b735abc03
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3820043
Commit-Queue: Dmytro Maluka <dmaluka@google.com>
Tested-by: Dmytro Maluka <dmy@semihalf.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Our input resource struct now consists of two maps which are using the
same key and are being used at the same place. Group that information
into a single map which can now become our full input resource type.
BUG=b:161774071
TEST=tast arc.VideoDecodeAccel*_vm passes on hatch.
Change-Id: Iae4567ba6cac0ef11ef7471b780e432150b01e63
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3849208
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Previously, the `state` RefCell reference would live past the `.await`
on the send at the bottom of the loop. Avoid this by retrieving the
mapper inside an `if let` instead.
Fixes a Rust 1.62 clippy lint:
error: this `RefCell` reference is held across an `await` point
<https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_refcell_ref>
BUG=b:243677117
TEST=tools/clippy # with Rust 1.62
Change-Id: Ia531180fe6ea7e6805dc0a174dae516c1c357a0f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3854966
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
RunCommand and RunMPCommand take same set of arguments so use RunCommand
within RunMPCommand.
- Remove catch all. This will help print better arg parsing error msg
- Use code that splits --key=value into "--key" "value"
BUG=b:239579779
BUG=b:240717724
BUG=b:238361778
Test: presubmit && ran downstream integration tests
Change-Id: I1c3847891dbfe499b34c240656baf0e81bdf1438
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3846055
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Vikram Auradkar <auradkar@google.com>
Correct permission of /scratch to allow crosvmdev to modify its
content after UID & GID changed to match host after container first
start.
TEST=tools/dev_container --stop ; tools/dev_container tools/run_tests
--target=vm:aarch64 --build-only
Change-Id: I8872c433ae903536750a4623f0d149b2875deba2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3855471
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Zihan Chen <zihanchen@google.com>
Rather than tying AsyncDisk::read_to_mem/write_from_mem to the
GuestMemory type specifically, use dyn BackingMemory like the underlying
read_to_mem/write_from_mem calls in cros_async. This will allow an async
version of QcowFile to use these functions to read/write temporary
buffers as part of its internal bookkeeping.
BUG=b:219595052
TEST=tools/presubmit
Change-Id: I4ca3c976bf5dca68e3bbe0e3f163023b47034254
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824065
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
This would complicate the implementation of ToAsyncDisk for qcow and
other formats. Change the trait bounds so that only the minimal set of
traits used in the asynchronous block device is required.
BUG=b:219595052
TEST=cargo build
Change-Id: Id5ece59596b0a0989f953854a9cf4c30d32f7e34
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824064
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
The generated ACPI devices are given deterministic names from PCI
addresses and topology. ACPI requires a device defined before any
reference or usage. For example, PCI switch must occur before its
downstream devices, and "Device" must occur before any "Scope"
extending it. By providing skeleton device definitions in DSDT, it
dramatically eases the composition of SSDT, especially when a device
is referenced in multiple SSDTs or "Scopes".
BUG=b:194390621
TEST=Dump DSDT and verify
Change-Id: Id9f74130b2c1f250374a3103db952ee10fa1b5ee
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844817
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
It guarantees that a PCI switch always occurs before its downstream
devices.
BUG=b:194390621
TEST=tools/presubmit
Change-Id: I41f76ca2f99c2cf9b26c49081e580f75689b0c1d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844814
Auto-Submit: Victor Ding <victording@chromium.org>
Reviewed-by: Tinghao Zhang <tinghao.zhang@intel.corp-partner.google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Victor Ding <victording@chromium.org>
The uses of these options already have good error messages, so we can
drop the extra checks in validate_config().
Change-Id: If4a3dc8c35819e41596b57aaf6d1fe4d644a4883
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3807100
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
If connecting to the balloon control socket fails, include the path in
the error message.
Change-Id: Idb28c0e8871c2a9038618f40767aabe423a3bc10
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3807099
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
If creating the cgroup file fails, include the path in the error
message.
Change-Id: If30ab8c90db97636bf957d546121a05f736f85c4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3806078
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Include the vhost vsock device path in the error message if opening it
fails, and remove the now-redundant file exists check.
BUG=None
TEST=crosvm run --vhost-vsock-device /does/not/exist ...
Change-Id: I1f66c03df8b7b7ad68339b1c151b19ce8fa37a5e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3806077
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Include the path when opening the sound backend device fails.
Change-Id: I37ce06c973588bea4676741f8fab17de11a2a7cb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3806076
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Include the error code and path to the file that failed to open. Then we
can remove the redundant file existence check in validate_config.
BUG=None
TEST=crosvm run --dmi /does/not/exist vm_kernel
Change-Id: Id857284c521aaa958a8b7967d7c2de81adcb74a5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3806075
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
There could be at most 256 PCI buses. Using "PCxx" naming convention
allows easily naming all possible PCI buses.
BUG=b:194390621
TEST=Dump DSDT and verify
Change-Id: I53c054555460e3a37b57d2ef6c71972949dd1bd3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844816
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
Tested-by: Victor Ding <victording@chromium.org>
Add doc comments for Worker and related definitions to make it easier to
understand what the definitions mean. No function change is intended for
this commit.
BUG=None
TEST=None
Change-Id: Icd0e78ead1163567064e11a2d4c06611a7f5e7c8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3850018
Commit-Queue: Takaya Saeki <takayas@chromium.org>
Tested-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Minor code refactor to improve readability.
BUG=b:194390621
TEST=Dump DSDT with and without this patch; then ensure they are
identical
Change-Id: Iccc62803788c3e44ce5f0cb8322831c015a95f85
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844815
Auto-Submit: Victor Ding <victording@chromium.org>
Tested-by: Victor Ding <victording@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Victor Ding <victording@chromium.org>
File::open() opens the file as O_RDONLY, which can cause issues with the
VA-API driver.
In particular for Intel hardware this will cause allocations to fail, as can
be seen in issue #1449 for intel-media-driver. These failed allocations may or
may not crash the VA-API driver, as the driver might eventually dereference a
NULL pointer.
Fix it by opening the DRM fd as O_RDWR. This is also in line with the examples
in libva-utils.
BUG=b:214478588
TEST=`cargo test --features "video-decoder,vaapi" -p devices vaapi::tests::test_get_capabilities -- --ignored` passes on AMD hardware.
Change-Id: Ie3cf2a6512157a3f23f943b54249eb2928082af9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782999
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Use the nom crate for parsing. This will arguably be both simpler to
read and more reliable than our current ad-hoc parser.
Add a few extra tests to enforce the new rules that the new parser is
supposed to enforce.
BUG=b:218223240
TEST=cargo test -p serde_keyvalues -p crosvm
TEST=ARCVM starts successfully.
Change-Id: I4ea188ffe8aee872071c900793c50127855403ec
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3822428
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Ffmpeg can now reliably be used in the guest to decode VP8 or VP9
streams, so update the instructions to showcase this.
BUG=b:235067555
TEST=mdbook build
Change-Id: If3af1797d8bc686167292e3859d6a4f08bfe2b41
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3841483
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Clearing the input queue means a reset of all parameters, so reset the
session when it happens. This allows the guest to change input
parameters after a reset.
BUG=b:161774071
TEST=ffmpeg in the guest does not complain that "parameter for input cannot be changed once decoding started" upon exit.
TEST=tast arc.VideoDecodeAccel*_vm passes on hatch.
Change-Id: I2e25ddc01d99cb9ce39f0dbf9bbb9413084dba19
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3841482
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
It is valid to perform a reset on a non-started device - it's just a
no-op. Regular V4L2 clients like ffmpeg may do this.
BUG=b:161774071
TEST=ffmpeg in the guest does not complain about "returning error response: invalid operation" upon exit.
TEST=tast arc.VideoDecodeAccel*_vm passes on hatch.
Change-Id: I63eabbf5183ff2d051997af4d16cf5c841313565
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3841481
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Fix the broken timestamp management in the virtio decoder device.
Timestamps are specified by the guest's user-space as a struct timeval,
which is effectively a (seconds, microseconds) pair. This pair is turned
into a u64 with nanoseconds units by V4L2, and passed to the virtio
device in that form.
This is fine so far, save for the fact that libvda works with 32-bit
timestamps. To accomodate that, we divided the original timestamp by
1_000_000_000, passed that truncated timestamp to the decoder backend as
a u32, and when the backend gives us decoded frames, multiplied their
timestamp by 1_000_000_000 again and passed that value as the frame
timestamp to the guest. For some reason, we also used the timestamp as
the key for the `NotifyEndOfBistreamBuffer` event, which forced us to
have a mapping table between an input buffer timestamp and its
corresponding resource ID. This in turn required that each input buffer
has a unique timestamp, lest they collide in the mapping table.
Anyway, the timestamp division by 1_000_000_000 means that any
sub-second timestamp information was lost during the decoding process.
This is not a problem with the Android V4L2 decoder which increases the
timestamp by one second for each frame and does not use sub-second
information, but clients that use *actual* timestamp information (like
ffmpeg) get pretty confused by that and abandon decoding with an error.
Fix this by passing the original 64-bit timestamp to decoder backends,
along with the 32-bit ID of the input resource. This allows backends to
directly send the NotifyEndOfBitstreamBuffer with the currect resource
ID, removing the need for the mapping table and unique timestamps for
input buffers.
More importantly, backends that can work with 64-bit timestamps (all of
them but libvda) can just pass the original timestamp to their decoder
logic and return it as-is in the PictureReady event. Libvda still
requires 32-bit timestamps, so we reproduce the truncation and mapping
table behavior inside the libvda backend (I also tried sending the
32-bit input resource ID as a timestamp to VDA, but it was not happy
with it). At least now that behavior is local to the VDA backend.
Thanks to this change clients other than the Android C2 decoder can get
proper timestamp information. One can argue that the code is also
simpler (except for libvda which adds a simple mapping table that we
were using before anyway).
BUG=b:161774071
TEST=cargo test --features "video-decoder,ffmpeg" -p devices video
TEST=`ffmpeg -codec:v vp8_v4l2m2m -i test-25fps.vp8 test-25fps-%d.png`
in the guest completes successfully with the ffmpeg backend.
TEST=tast arc.VideoDecodeAccel*_vm passes on hatch.
Change-Id: Idb21b4c536acafbdf5458e88cdbc33c9376a405e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3841480
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Container shell now defaults to user `crosvmdev` which will have
same UID & GID as outside user. VS Code Remote Containers extension
has the same behavior when loading config from devcontainer.json.
TEST=all tests pass in container, new files in container have same
permission as files created outside.
FIXED=b:239476013
Change-Id: Ib3c696509e9ea45edd5f02ff025d9477576ec765
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3814094
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
ACPI Machine Language (AML) Specification defines both RegionOffset and
RegionLen as Term.
BUG=b:194390621
TEST=tools/presubmit
Change-Id: Ib9d09fab3069566e9fc84c823b6d9f644ac975a0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3845277
Tested-by: Victor Ding <victording@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Victor Ding <victording@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
'checkout -B' would fail if 'origin' isn't fetched or is too outdated.
BUG=None
TEST=tools/cl # on a repo where 'origin' isn't fetched
Change-Id: I13a5d8a3796c4c9002243902a5f8d145dc9393ef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844820
Tested-by: Victor Ding <victording@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Victor Ding <victording@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
Update the ffmpeg bindings and build script to use 5.0 and update our
code to match the API changes since 4.4.
BUG=None
TEST=cargo test -p ffmpeg
TEST=cargo test --features "video-decoder,ffmpeg" -p devices video
TEST=v4l2r example from the crosvm book passses.
Change-Id: If7820a4dd270d715e89c60d55f89b9730f40e864
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3835501
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
We are about to require ffmpeg >= 5.0 in the ffmpeg decoder backend, but
the version on Debian Bullseye (used in our container and VM images) is
still 4.3. Temporarily disable building the ffmpeg crate and video
decoder by default until we use a system image that includes ffmpeg >=
5.0.
BUG=None
TEST=./tools/dev_container ./tools/run_tests
TEST=./tools/dev_container ./tools/run_tests --target=vm:aarch64
TEST=./tools/dev_container ./tools/run_tests --target=vm:aarch64 --build-target armhf
Change-Id: Idf96862d3ea9bea597701fdee8145e12a0753a3e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3835500
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Make sure that excluded crates are actually not considered on all
platforms, not just Windows.
BUG=None
TEST=./tools/clippy succeeds and does not attempt to build ffmpeg.
Change-Id: If7167bb6b598692847bbab9f069f875a3fb0b581
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844812
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
... to ensure consistent phyiscal display ids when
running Android with Cuttlefish across both 2D and 3D
modes.
BUG=b:242931783
TEST=boot Cuttlefish with 2D mode and EDID and interact
with the displays
Change-Id: Iba0e786464a603c7e1264625ddf619b91b9099bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3846059
Reviewed-by: Kaiyi Li <kaiyili@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
... which is required to pass the Android framework's EDID
validation (frameworks/native/libs/ui/DisplayIdentification.cpp).
Also, remove additional hard-coded extra resolutions which were
unused.
BUG=b:242931783
TEST=boot Cuttlefish with EDID re-enabled
(aosp/2189577 reverted)
Change-Id: Ib9cda60882fc3921c8424d10fd45d7dceae28a2f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3846058
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Kaiyi Li <kaiyili@google.com>
If we can't create a PlatformSyslog instance (for example, if /dev/log
is not available on a minimal Linux system without a traditional init),
warn the user and continue executing instead of failing.
BUG=b:242103548
TEST=Run crosvm inside minimal VM with no init
Change-Id: I4d81da396125331ef7ad335e57b37645b6546980
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3842814
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Abhishek Bhardwaj <abhishekbh@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
When pcie port driver put device into suspended state, it will
disable hotplug interrupt. So in order to inject virtual hotplug
interrupt into guest, virtual pcie port injects a virtual PME into
guest to resume pcie port, then pcie port driver enable hotplug
interrupt, finally virtual hotplug interrupt is injected after
PME is handled by guest.
Previously pending HP interrupt is injected at guest clear root
port's PME status, this is work for pcie root port only. Pcie
downstream port doesn't have root port's PME status. This commit
changes the time for injecting pending HP interrupt when guest
enable HP interrupt in PME handler.
BUG=b:199986018
TEST=Check root/downstream port's hotplug function in guest
Change-Id: Iffaa1fc73f13e1b940a45459fbcdc51af11dcca8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824072
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Currently PDC(Presence Detect Changed) is set even at virtual PME
injection also, kernel treats it as spurious event in PME handler.
This patch set PDC when virtual HP interrupt is injected, so kernel
won't see it in PME handler.
BUG=b:199986018
TEST=Verify root/downstream port's hotplug function in guest
Change-Id: I9c56216f32da37cb74fe6759ea944dee64642583
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824071
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
According to Pcie spec, Pcie upstream/downstream port send PME message
to pcie root port, then pcie root port remembers request id and trigger
pcie PME to cpu. So when pcie upstream/downstream port need PME, it
should request pcie root port and write its pci address in root port's
root status register.
In order to convenient upstream/downstream port to find out its root port,
a global variable is used to store all the root ports, and each root port
covers a BusRange, so upstream/downstream port's bus number is used to
search its root port from global variable.
BUG=b:199986018
TEST=Check upstream/downstream port's PME function in a VM
Change-Id: If58da2cfbe2d258a665086b30df219161d1a8081
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824070
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
According to Pcie SPEC, only pcie root port has root cap in
pcie cap register, pcie upstream/downstream port doesn't have
root cap, so this commit make root_control and root_status
as option in PciePort.
BUG=b:199986018
TEST=Check pcie root/upstream/downstream ports register in vm
Change-Id: Icffa2c99ee7943d293dbec77d3e9ac03e37401d5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824069
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>