Commit graph

5821 commits

Author SHA1 Message Date
Zihan Chen
bc268bf3a1 acpi: Mark structs as repr(C, packed)
Previouly some structs are marked as repr(packed) which allow
rustc to reorder them, and is not compliant with ACPI specs.

TEST=CQ

Change-Id: I2b45ee5fc9ccc99cb9355f6d19c14f962c242a54
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4234143
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-02-08 21:32:43 +00:00
Zihan Chen
28ce4e5423 crosvm: Uprev rust toolchain and dev container
- 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>
2023-02-08 20:26:30 +00:00
recipe-roller
7c9d6e00ce Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789702537127097409

recipe_engine:
4f7d370e33
  4f7d370 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 49c144dcbda8 to fc9d7a3dff50

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I9399a0ad3eb8c180873e55fa1a60e036f479d190
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4233757
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-08 19:51:38 +00:00
recipe-roller
ed9978062a Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789707570101556001

depot_tools:
7d6a777cdb
  7d6a777 (rgw@google.com)
      Updating lucicfg to version 1.38.0 -> 1.38.1

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I8fbc7bda50062e5c390820917be2d7e24822d724
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4232558
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-08 18:11:43 +00:00
recipe-roller
ded573b22f Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789756640947236593

recipe_engine:
985a9d1c5a
  985a9d1 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from e2742d350e80 to a8b84fba102d

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I39f3c86d8dd3ca9e8133bd3d454fe423ea5a90f6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4230751
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-08 05:14:36 +00:00
Shintaro Kawamura
832b1f0bef swap: create userfaultfd from /dev/userfaultfd
userfaultfd(2) syscall requires CAP_SYS_PTRACE of root user namespace.
For better permission control /dev/userfaultfd was introduced from Linux
6.1. Since ARCVM runs inside a sandbox user namespace and enabling
/proc/sys/vm/unprivileged_userfaultfd opens up userfaultfd to the entire
system, crosvm for ARCVM has to use /dev/userfaultfd to create a
userfaultfd.

For systems which do not have /dev/userfaultfd, the Factory falls back
to userfaultfd(2).

BUG=b:268145007
BUG=b:266642532
TEST=manual test

Change-Id: I44b657877093d2a75627432619c1233b7ac2464e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4196763
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-02-08 04:18:36 +00:00
Shintaro Kawamura
e80e7bc342 crosvm: unix: update comment of SandboxConfig
BUG=b:267962403
TEST=none

Change-Id: I966c51dff30f782faf3a1079d6215f8d6936dc02
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4225613
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-02-08 00:31:46 +00:00
recipe-roller
e3d47bf9fa Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789777404657930289

recipe_engine:
81745250cc
  8174525 (chanli@chromium.org)
      [recipe-py] led: support trigger real build

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I9df3657e5d153456f7450d43a9943db39da6233c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228580
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-07 23:51:11 +00:00
Zihan Chen
a110d39ae6 crosvm: Partially convert DataInit to zerocopy (2/n)
TESTED=CQ

BUG=b:204409584

Change-Id: I659e31d229b70ae8e98426c253730b1e46b55adf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4219972
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-02-07 23:08:23 +00:00
Dennis Kempin
b564f52af5 infra: Disable coverage uploads
codecov has been very flaky and is undergoing an acquisition
process.
We should probably switch to an in-house tool like the chromium
coverage dashboard.

BUG=None
TEST=None

Change-Id: Ib570224dceb131b55b6ca958b695cc1e97082132
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228220
Commit-Queue: Zihan Chen <zihanchen@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2023-02-07 23:07:00 +00:00
Zihan Chen
ddb282edf9 infra: Fix infra test
A previous merged infra change didn't update the infra tests'
example result but passed CI (for some unknown reason).

TEST=CQ

Change-Id: I30c8150bbef745fed9301fa1756649e6d3085967
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228222
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-02-07 22:59:41 +00:00
Dennis Kempin
356a6ddf39 tools/run_tests2: Various process improvements
- Properly propagate test failures as exit codes
- Add --profile option to select nextest profile
- Add --no-parallel option for more stable test results
- Add --repetitions option to repeat tests to check
  test flakiness

BUG=b:261600801
TEST=tools/run_tests2 [--no-parallel] [--repetitions]

Change-Id: I7eb8617cfef8bc9979ff2115b2936c31a263e6f3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228216
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2023-02-07 22:22:37 +00:00
Dennis Kempin
5b33efd60f infra: Add cargo-nextest to windows builder
This will be required for running the new run_tests2 test runner
on windows builders.

BUG=b:261600801
TEST=https://ci.chromium.org/swarming/task/6046843e9ebd3810

Change-Id: I39170e75b47c07b9735452d48fdce5d9c3745594
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228428
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2023-02-07 21:36:46 +00:00
Dennis Kempin
c2ec26d7e8 e2e_tests: Clarify prebuilt download logs
This helps identify a potential deadlock by the NamedLock.

BUG=None
TEST=CQ

Change-Id: I0ef9606b6b5e36a1564ff3fee7720ae013365cc7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228215
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-02-07 20:17:23 +00:00
recipe-roller
887e2a1859 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789792501654945473

recipe_engine:
4387134d2f
  4387134 (bpastene@chromium.org)
      Switch internal recipes.py callsites to py3 in recipe autoroller

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I944d48deba19a6c5bea40f7c125afb22d92c3825
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228110
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-07 19:41:43 +00:00
recipe-roller
42bbb0a03b Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789804455627274401

depot_tools:
6215dd0365
  6215dd0 (jojwang@chromium.org)
      stacked-changes: Skip empty branches.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I95e7963cff6154becda9d7f9eca071a6c353d43f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228211
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-07 16:33:51 +00:00
Vikram Auradkar
649359e7aa tools: run_test2 add features option
`--features` lets us specify any custom features that we would like
to build and test.

BUG=b:267672683
TEST=ran run_tests2 downstream

Change-Id: I47a4a67c261d0ec5281abedbbe6ba46b26b49a62
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4226883
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2023-02-07 14:56:12 +00:00
Vikram Auradkar
4a558df4f6 tools: run_test2 add windows support
Also updates install-deps.ps1 to install binstall and nextest.

BUG=b:267672683
TEST=ran run_tests2 downstream

Change-Id: I79491601cbf12e9388022ee653353e7c2f5a415e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4226882
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2023-02-07 14:56:12 +00:00
Grzegorz Jaszczyk
60b8901b3e device: introduce emulated ac_adapter
This commit introduces ACPI0003 emulated device, which can be enabled by
passing "--ac-adapter" argument.

Emulating ac adapter allows to replicate ac adapter state on the guest side.

The host kernel already propagates ac adapter status to user-space by
generating acpi events: acpi_bus_generate_netlink_event so crosvm upon
receiving "ac_adapter" class acpi event, stores the corresponding data
(ac status) into ac register. Next the previously allocated GPE is
triggered to inform the guest about status change.

Guest upon handling GPE, thanks to generated aml code:

    Device (ACDC)
    {
        Name (_HID, "ACPI0003" /* Power Source Device */)  // _HID: Hardware ID
        OperationRegion (VREG, SystemMemory, 0x0000000220E00010, 0x10)
        Field (VREG, DWordAcc, Lock, Preserve)
        {
            ACEX,   32
        }

        Method (_PSR, 0, NotSerialized)  // _PSR: Power Source
        {
            Return (ACEX) /* \ACDC.ACEX */
        }

        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            Return (0x0F)
        }
    }

    Scope (_GPE)
    {
        Method (_E00, 0, NotSerialized)  // _Exx: Edge-Triggered GPE, xx=0x00-0xFF
        {
            Notify (ACDC, 0x80) // Status Change
        }
    }

triggers Notify on AC adapter and therefore replicates the host
ac_adapter state (accessing ACEX pointed by opregion results with trap
to crosvm, which returns previously stored ac status).

BUG=b:244205651
TEST=Plug/Unplug AC adapter and inside guest run:
1) acpi_listener and confirm that proper acpi events are replicated
2) observe: `cat /sys/class/power_supply/ACDC/online`

Change-Id: I9b1045cfcae1c4de48a0ad50f63148cfe9ff226b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4186657
Auto-Submit: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
2023-02-07 14:11:15 +00:00
Alexandre Courbot
6bbf15f3a4 media: cros-codecs: vp8: remove backends dependency on Parser
The backends should not be aware of the Parser struct. Removing this
dependency opens the door to further factorization of the VP8 Decoder
struct.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: Ie92aa341ed10fccbe328d321469edfc5ae1a334a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4160630
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
2023-02-07 06:33:09 +00:00
Alexandre Courbot
3e61452215 media: cros-codecs: reorganize Decoder members
Sort the members so the common ones appear first and in the same order -
this will help us factorize this part of the code in the future.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: I78dedb06fef11fb00cdac88eae7b92d0010e6150
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4160629
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2023-02-07 06:25:00 +00:00
Alexandre Courbot
0c122abbf5 media: cros-codecs: vp9: move segmentation from vaapi to common decoder code
VP9 segmentation is potentially useful to all backends and not only the
VAAPI one. Since this code is not VAAPI-dependent, move it to the common
decoder.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: If1970e9773de97d7923e6e230aa5a320b2d7cdc9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4160628
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-02-07 06:21:04 +00:00
Shintaro Kawamura
44c38057a0 crosvm: unix: do not set uid/gid if uid/gid_map are specified
If `ugid_map` is specified but the uid and gid of current user does not
match the map, `setresgid(2)` fails and crosvm fails to boot.

Currently there is not use case when `bind_mounts` is enabled and
`ugid_map` is specified. But this is for the future developers who will
not be bothered by this bug.

BUG=b:266642532
TEST=manual test

Change-Id: I60e1ee18d09ce1ffe05a2a57ea85ba616eb83ccf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4223603
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-02-07 01:27:31 +00:00
recipe-roller
1d0817c4f2 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789866743653027489

recipe_engine:
5960b43515
  5960b43 (juahurta@google.com)
      recipe_engine: add option to skip step presention when using fi...

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I2b7f4ed934a71f2fd1c5ac83633f176d8dc88488
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4226884
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-06 23:59:02 +00:00
Frederick Mayle
19f4b1243c devices: snapshot and restore for guest memory
`crosvm snapshot take ...` will write the contents of guest memory to a
file and `crosvm restore apply ...` will read that file to overwrite
guest memory.

To start with, the file is chosen by adding a ".mem" extension to the
snapshot file path. We should consider a better approach in the future,
maybe put them both in a tar file or have the user supply a directory
instead of a file path.

BUG=b:266514791

Change-Id: Ic05f94223fb74674bd57dcd2f848055b31eb5fdc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4215313
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
2023-02-06 22:44:17 +00:00
Grzegorz Jaszczyk
97958834f7 resource: system_allocator: introduce GPE allocator
In upcoming patches there will be need for allocating unique free GPE,
therefore extend system allocator appropriately.

BUG=None
TEST=Build and run crosvm with WIP patches using GPE allocator.
Additionally trigger simple, introduced test.

Change-Id: I2f175d4da58e4cba8e6a869cee537802ed197e3c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4186656
Auto-Submit: Grzegorz Jaszczyk <jaszczyk@google.com>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dmytro Maluka <dmaluka@google.com>
2023-02-06 22:02:37 +00:00
Grzegorz Jaszczyk
ff379b88c7 devices: acpi: introduce const for GPE max
Instead of using hard-coded value introduce and use ACPIPM_GPE_MAX.

BUG=None
TEST=Build

Change-Id: Iab29705cec74a2fea3f4dad597ee5b72b29dfd97
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4218616
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Dmytro Maluka <dmaluka@google.com>
2023-02-06 21:57:47 +00:00
Frederick Mayle
7dc81ba14f devices: move device snapshots into a field
This makes room for non-device snapshot data, e.g. guest memory metadata.

Included some related cleanup: Made the snapshot and restore code more
symmetric. More abstract interface with the bus library.

BUG=b:266514791

Change-Id: Ia19aa002d4bb7ec6041c1183c6deb422dfbed0c5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4215317
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-02-06 21:38:47 +00:00
recipe-roller
cdf498e65f Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8789883727936929761

recipe_engine:
6473859b07
  6473859 (zbikowski@google.com)
      Skip placeholder for get_file in url recipe module

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: If9f7938504a596922108084a1fe61ed5e558e711
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4225974
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-06 19:31:08 +00:00
Shintaro Kawamura
7cffd2bd15 swap: refine swap status response
Re-format the response of `crosvm swap status` command and make it easy
to parse structure as JSON.

BUG=b:265606668
TEST=cargo test -p swap

Change-Id: Ia5216a6ae4b2083bce3829848687cebf932d0933
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4216453
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
2023-02-06 06:06:31 +00:00
Noah Gold
c7041e707c base: fix mmap doc test on Windows.
MemoryMappingBuilder on Windows has to be built from SharedMemory. On
Linux we can build without one. We should fix this API discrepency at
some point, but for the moment let's get the test working again.

BUG=b:267219257
TEST=the fixed test passes downstream.

Change-Id: If9728f2b73465a30aa324549fbc10e189737b420
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4220528
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-02-03 23:16:52 +00:00
recipe-roller
3d01498e99 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790141679281985617

depot_tools:
ef2d011ad3
  ef2d011 (aravindvasudev@google.com)
      Do not add line break to the end of stdout/stderr

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ia3e8510c1a70ffb6ffadaa204e6fd101a731d655
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4222197
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-03 23:11:46 +00:00
Vikram Auradkar
d6b855ddd3 tools: make scripts windows/downstream friendly
- makes luci tests conditional
- enables specifying additional cargo features
  - downstream uses different features test on different presubmit jobs
    like prod vs. non-prod, asan vs. non-asan

BUG=b:267672683
TEST=ran these scripts downstream to an extent possible

Change-Id: Ide6f0e896ecf88ba90a74a3369243595dc199571
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4218894
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2023-02-03 21:52:06 +00:00
recipe-roller
d38540d0b0 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790147343355747137

depot_tools:
91ea91249f
  91ea912 (aravindvasudev@google.com)
      Remove OOB deprecation log from gsutil

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I82fb2d53caf34d777ce3b526ba66feeb605ffd51
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4222136
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-03 21:41:05 +00:00
recipe-roller
9ed7136748 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790160554980885617

depot_tools:
a02b4bf030
  a02b4bf (aravindvasudev@google.com)
      Fix gerrit new-password URL

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ie39a91c88620f73fa405127d82c5865907d848e9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4218896
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-03 18:17:22 +00:00
Shintaro Kawamura
aa601fcc02 crosvm: unix: add bind_mounts to SandboxConfig
Setting up uid_map/gid_map and mount tmpfs to the root path is required
to bind_mount extra files/directories into the jail. Unify the setup
into the `create_sandbox_minijail()` instead of setting it up on each
device.

Set 64MB tmpfs for the root path while snd and tpm devices have used
20KB tmpfs. This does not harm the memory pressure since tmpfs allocates
memory on demand. The tmpfs size should be optimized at b/267581374.

This helps to support injecting /dev/userfautlfd to each device process.

BUG=b:266642532
TEST=ARCVM succeeds to boot and sniper3D app works.

Change-Id: Id9b49860a57ba6518145e7a2a7683896a9d9b2cf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4211152
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-02-03 06:46:01 +00:00
Shintaro Kawamura
221afec76e crosvm: unix: refactor the interface of jail_helpers
We should use less Option to keep the api simple. But keep the current
interface of `simple_jail()` as is because it is simple enough and fits
other interface easily (i.e. VirtioDeviceStub and other interface expect
to accept `Option<Minijail>`.)

This is the first step of the refactoring jail_helpers to support
injecting /dev/userfaultfd to each device process.

The new chroot path (`src`) for fs_device is already validated when it
is parsed at `SharedDir::from_str()`. But checking the directory twice
won't add much overhead.

BUG=b:266642532
TEST=cargo build

Change-Id: I55f837b4da3df51f878108b0ed3d3aba1a0dd823
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4211151
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2023-02-03 06:44:45 +00:00
recipe-roller
28d3268ce9 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790213403109836065

depot_tools:
963e01c76c
  963e01c (jwata@google.com)
      Remove ninja entries from cipd_manifest.txt

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ic29e72001f4d2a9fe813fe8da53b6e1bc733ce74
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4220628
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-03 04:09:23 +00:00
Dennis Kempin
5eea928ef9 New nextest based test runner
We greatly improved the test health of crosvm which allows to
make better use of standard cargo tools instead of custom
tailored implementations for running tests.

The new test runner is available at tools/run_tests2 until it
fully replaces tools/run_tests.

The key difference is that tests are packaged into a tarball
to be executed remotely instead of sending and executing every
binary separately via SSH.

Improvements over the old test runner:

- Faster, nextest runs faster and the new model for remote testing
  is a lot faster when running tests in a VM.
- Simpler, less custom code to maintain.
- More readable output, uses modern TUI functionality.
- Enables future workflows for testing on cloud devices running
  in our luci infrastructure.

How much faster?
- Running all tests on host: 1m -> 9s
- Running all aarch64 tests in vm: 3m20s -> 32s

BUG=b:261600801
TEST=./tools/run_tests2 with args:
-p x86_64
-p x86_64 --dut=host
-p x86_64 --dut=vm
-p aarch64
-p aarch64 --dut=vm
-p armhf
-p mingw64

Change-Id: I842a0ac6f7b288aeccb112b4e2f46a15f3baf54b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4144641
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-02-02 23:39:42 +00:00
recipe-roller
e905b4cf29 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790233535896273713

depot_tools:
79499cf439
  79499cf (jojwang@chromium.org)
      Update env_vars metrics name.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I853edc210d88c8a717146afeed8d1554e01fb2cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4218548
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-02 22:49:33 +00:00
Elie Kheirallah
4c80811b91 base: Add custom_serde lib for custom serializers
Add custom_serde to base
Move serialize_* functions from devices/lib to base/custom_serde
Made serialize_arr accept generic sized types and different sizes

BUG=b:232437513
TEST=./tools/presubmit --all

Change-Id: I5c686f4ff4235141e48764001aedc7a18d9dbbf9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4210069
Commit-Queue: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2023-02-02 22:38:31 +00:00
recipe-roller
3a566da598 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790235420271551185

depot_tools:
e3fe027009
  e3fe027 (sharma.loic@gmail.com)
      [Windows] Ignore extra spaces in ninja args

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I3f1565e8661bf3f6adb9643d681e6033f2cca518
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4218547
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-02 22:24:55 +00:00
recipe-roller
4cb21aa57f Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790237935921832145

depot_tools:
5ed21de943
  5ed21de (jojwang@chromium.org)
      Change env_variables to repeated metric.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I78120429e52ea7bbcd5cb6ab55fe6b3f22e72ef1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4218545
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-02 21:44:01 +00:00
Frederick Mayle
bfaa9f9342 devices: use base::error instead of eprintln
Change-Id: I062332d567fd3277aa4ba9fb4e573471212751b6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4215315
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-02-02 20:38:30 +00:00
Frederick Mayle
1afdc4d908 e2e_tests: suspend_resume: consume exec_command_async response
Without this, subsequent commands would fail.

BUG=b:232437513

Change-Id: Ibbe105e0e80b317cc3cd32ddd184892e1a9ab613
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4214944
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-02-02 20:38:30 +00:00
Zihan Chen
8a7550c40a crosvm: Partially convert DataInit to zerocopy (1/n)
Thie effort is splitted into multiple CLs, to reduce change size
and also make bisecing breakages easier.

TESTED=CQ only

BUG=b:204409584

Change-Id: Ie90f171bd5f74b732df3129e94733f3b34621092
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4210751
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2023-02-02 19:28:57 +00:00
recipe-roller
78a69d6575 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8790250522167005713

recipe_engine:
030e1286cc
  030e128 (yiwzhang@google.com)
      write summary markdown to expectation on build success and intr...

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I671ce1597722b56a25f2c0e99df722f7bc7b77c1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4218544
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-02-02 18:28:44 +00:00
Grzegorz Jaszczyk
80779f4aeb acpi: gpe: extract and use new set_active function
Activating GPE will be used from different contexts, therefore extract
this common functionality into a separate function.

BUG=None
TEST=Build

Change-Id: Ie6d49d928c8bbb028a33aa8321f580d5abfaee7a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4186655
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
2023-02-02 12:35:43 +00:00
Alexandre Courbot
850764ad8e media: cros-codecs: make decode() take a &[u8] as input
The decode() method used to take a generic argument that can provide a
reference to the input byte stream. This appears as a convenience but is
really not since it is trivial for the caller to obtain the byte slice
from any type that implements AsRef<[u8]>, and having the generic
parameter uselessly complicates the code and results in large amounts of
monomorphization.

By removing this generic argument, we strip ~30KB on the binary in a
release build while keeping things easier to read overall.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: I4a4a09151259a61fa66184dfed09a9bed286de68
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4142081
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2023-02-02 06:38:31 +00:00
Alexandre Courbot
e06b13828f media: cros-codecs: vaapi: factorize shared parts of the backends
We are now in a state where the shared functions of all backend
implementations are implemented through `VideoDecoderBackend`, while the
codec-specific parts are done through `StatelessDecoderBackend`.

This allows us to extract the common functionality into a shared
`VaapiBackend` structure that provides the implementation of
`VideoDecoderBackend`, that each codec-specific backend will embed.

Doing so dramatically reduces the amount of duplicated code within the
VAAPI backend.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: I9498d31cb3da6bfe10542267b4e8fcc075792afc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123657
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2023-02-02 06:37:56 +00:00