Commit graph

4224 commits

Author SHA1 Message Date
Adrian Ratiu
1a7a822858 seccomp: allow rseq syscall
Starting with v4.18, the Linux kernel provides the rseq
syscall which is a mechanism for fast userspace task
synchronization.

Starting with v2.35 glibc uses the new syscall, if it
exists, to gain some performance improvements, so we
need to update the policy files to allow it.

Even on older kernels where rseq is not supported,
glibc will still probe for its existence by expecting
an -ENOSYS response.

BUG=b:235960683
TEST=Local builds against glibc 2.35

Change-Id: I704f2fbf2b058c3a4c3269c7441c3a7324012f8a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3763901
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Owners-Override: Dominick Ng <dominickn@google.com>
Reviewed-by: Allen Webb <allenwebb@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
2022-07-15 16:19:21 +00:00
Daniel Verkamp
a3da0f9803 tools: print package name to be installed
This was hard-coded to argh, which is the only package that uses it for
now, but the function may be used elsewhere in the future.

Also don't print a newline so the user can answer the prompt on the same
line after the [y/N].

BUG=None
TEST=Run tools/cl without python3-argh installed

Change-Id: I587fd1ded81f21724169a2fe90445f6055d1f421
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764375
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-14 23:50:21 +00:00
Daniel Verkamp
e487d4a56c infra: run Windows tests with --verbose
This lets us see the list of tests that ran and matches the Linux
results more closely.

BUG=None
TEST=cd infra && ./recipes.py test run

Change-Id: I880cd397e21d487fb9f1924fbb1fc8e2ff3cc29a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764467
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-07-14 23:17:14 +00:00
Daniel Verkamp
17c782f1c1 seccomp: add rseq to all policy files
Allow the restartable sequences system call used by glibc 2.35+.

This is an extension of commit 637402a827 ("Add rseq to the seccomp
policy file on aarch64."), which was originally reverted because the
ChromeOS kernel headers did not have the necessary declarations yet.

This depends on the rseq declarations patch to linux-headers:
https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/3749266/

BUG=b:235172163
BUG=b:235960683
TEST=Start crosvm on x86-64 Arch Linux with glibc 2.35
TEST=emerge-hatch crosvm # ensure seccomp policies compile

Reported-By: Peter Collingbourne <pcc@google.com>
Change-Id: I14e3dfd150a7c06bdafc68a88ef3f755eb7bf90c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3763776
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
2022-07-14 22:45:21 +00:00
Dennis Kempin
b3b01e866e infra: Manually roll recipes
./tools/recipe.py autoroll

BUG=b:239081770
TEST=led get-builder luci.crosvm.ci:health_check | led edit-recipe-bundle | led launch

Change-Id: I49e4259b2e51be5f25d36de96d47fd0f0b359ca2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764463
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-14 22:19:59 +00:00
Dennis Kempin
230dc4fd84 Revert "Roll recipe dependencies (trivial)."
This reverts commit e19959ab3c.

Reason for revert: Broke bot update. See https://ci.chromium.org/ui/p/crosvm/builders/try/health_check/b8808633426831578849/overview

Original change's description:
> Roll recipe dependencies (trivial).
>
> This is an automated CL created by the recipe roller. This CL rolls
> recipe changes from upstream projects (depot_tools, recipe_engine) into this repository.
>
> The build that created this CL was
> https://ci.chromium.org/b/8808635415894971729
>
> depot_tools:
> 9a7b7675ba~..2f988479fb9e31a59f935054d5f230748ed526f4
>   9a7b767 (vapier@chromium.org)
>       isort: make available to users
>   fb8cf9c (aravindvasudev@google.com)
>       Add --protocol-override to fetch.py
>   13acea3 (brucedawson@chromium.org)
>       Let git cl presubmit work with no branch
>   23ddab2 (aravindvasudev@google.com)
>       Reland "Break make_encoded_file into two functions"
>   08a30b2 (bpastene@chromium.org)
>       Add examples to the help string for git-cl-try's -B arg
>   443d913 (dpapad@chromium.org)
>       Include TypeScript .ts files in DEFAULT_FILES_TO_CHECK.
>   b9dca86 (meiring@google.com)
>       [depot_tools] Roll rdb.
>   6a1494e (tikuta@chromium.org)
>       Reland "autoninja: increase parallelism for non-HT cpu"
>   1bc3cd2 (akhoroshilov@brave.com)
>       Add a global core limit support for goma/rbe builds.
>   cb2cef9 (sdefresne@chromium.org)
>       [mac] Restore an upper limit on the number of jobs on macOS
>   31bfd51 (brucedawson@chromium.org)
>       Actually add a trailing slash to dir_with_slash
>   9997ceb (vapier@chromium.org)
>       black: add helper for formatting Python
>   aa7d7e4 (dmercadier@chromium.org)
>       [cpplint] Fix bug with "if constexpr"
>   bfefaa8 (chanli@chromium.org)
>       [depot_tools] roll led
>   50c631e (jojwang@google.com)
>       Skip 'ls' when downloading from gs.
>   f8300fb (jochen@chromium.org)
>       Remove myself from depot_tools OWNERS
>   73218ec (vadimsh@chromium.org)
>       [cipd] Update to v2.6.4.
>   772f3dc (ukai@google.com)
>       Roll out goma client VERSION=246
>   632bbc0 (sokcevic@google.com)
>       Skip Python 2 presubmit step when unneeded
>   cf9a776 (lpromero@chromium.org)
>       Typo when countdown is more than 1.
>   471b549 (chanli@chromium.org)
>       roll dirmd
>   0e9a7d2 (sokcevic@google.com)
>       Revert "Add iannucci to depot_tools owners"
>   2f98847 (dsanders11@ucsbalum.com)
>       cpplint: improve root path for header guard behavior
>
> recipe_engine:
> f588cc00b9~..04b3acea0bf45c9e1076079998b6378caa5570d2
>   f588cc0 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from 595e0f7a2869 to cb424e70e751
>   52ef306 (iannucci@chromium.org)
>       [recipe_engine] Implicit CANCELED final build status.
>   cde011f (machenbach@chromium.org)
>       [led] Add common logic to trigger a builder
>   087afb8 (chanli@chromium.org)
>       [recipe-py] buildbucket: enable buildbucket tracking parent/chi...
>   c827c1b (chanli@chromium.org)
>       Revert "[recipe-py] buildbucket: enable buildbucket tracking pa...
>   9eef321 (gbeaty@chromium.org)
>       Prevent creation of candidates for dependencies of dependencies.
>   3db9e1b (chanli@chromium.org)
>       Reland "[recipe-py] buildbucket: enable buildbucket tracking pa...
>   b788d0a (vadimsh@chromium.org)
>       [scheduler] Expose job ID and invocation ID.
>   6d2e271 (gredelston@google.com)
>       walkthrough.md: Fix incorrect kwarg "output"
>   14202da (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from addd54e4fcef to 6da0608e4fa8
>   826d446 (kimstephanie@google.com)
>       Add new post_process.PropertiesContain to check that key exists
>   f15df27 (chanli@chromium.org)
>       Extend placeholder.py to schedule child builds
>   83eab46 (whesse@google.com)
>       [buildbucket] Relax type check on buildbucket ids
>   d3504b5 (mohrr@google.com)
>       [path] Add __lt__ to Path
>   9e3ca47 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from a0672c27eaaa to 5fa853f88d79
>   2522322 (gbeaty@chromium.org)
>       Rewrite candidate_algorithm.
>   b4882c1 (chanli@chromium.org)
>       [time] make sleep a timed wait on global_shutdown
>   1d661d3 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from b927ccff49e4 to b2aa2d72c22b
>   a6fd0d2 (chanli@chromium.org)
>       [time] set the step to canceled if GLOBAL_SHUTDOWN is triggered
>   0f5f374 (alexschulze@chromium.org)
>       [cipd] Fix `instances` command with limit = 0
>   048f6f2 (chanli@chromium.org)
>       [recipe-py] buildbucket: set `luci.buildbucket.parent_tracking`...
>   d63eb67 (chanli@chromium.org)
>       Revert "[recipe-py] buildbucket: set `luci.buildbucket.parent_t...
>   e783f88 (chanli@chromium.org)
>       [recipe-py] (2 attempt) buildbucket: set `luci.buildbucket.pare...
>   2239191 (gbeaty@chromium.org)
>       Prevent spurious GitFetchErrors in CommitList.from_backend.
>   efaa1e2 (iannucci@chromium.org)
>       [json] Stop using python.inline.
>   dc013a8 (iannucci@chromium.org)
>       [python] Mark python.inline with a warning
>   6345fb2 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from 4f40f26f3102 to 2aa3d7e5e866
>   36be946 (iannucci@chromium.org)
>       [python] Deprecate api.python.__call__
>   357b1cd (martiniss@google.com)
>       Add timing information option to the test command
>   e174a86 (martiniss@google.com)
>       Add exponential_backoff to the time module.
>   ce1d368 (iannucci@chromium.org)
>       [warnings] Omit warnings which are attributed to other recipe r...
>   c002009 (akashmukherjee@google.com)
>       [snoopy] Create luci's bcid recipe module dir.
>   1e08dae (akashmukherjee@google.com)
>       [snoopy] Create a luci's bcid recipe_module.
>   f2754bc (akashmukherjee@google.com)
>       [snoopy] Update the cipd for reporter module.
>   4cb1bf0 (gbeaty@chromium.org)
>       Don't set the -u flag when running python unbuffered.
>   50cbd44 (meiring@google.com)
>       [recipe-py] roll recipe_proto
>   82fb654 (meiring@google.com)
>       [recipes-py] Update ResultDB exoneration example to populate re...
>   bb1fb5a (iannucci@chromium.org)
>       [python] Set warning for entire python module.
>   d047727 (gbeaty@chromium.org)
>       Inhibit displaying coverage information on python3 failures wit...
>   57ac2ff (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from e361505b12f1 to 3bd002442390
>   253ac82 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from 91c1b9ec335a to cad461b65231
>   2684e3c (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from 4137ed7879ac to 93b14d0f4216
>   ac03648 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from 35b05be75bc4 to 29b908616bc9
>   0a09360 (kimstephanie@google.com)
>       Add post_process.LogDoesNotContain
>   08c51a1 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from c25db5a11beb to d3db74920e35
>   e3cd9eb (kuanhuang@chromium.org)
>       Add recipes API swarming.show_request(name, task) -> TaskRequest
>   04b3ace (chromium-autoroll@skia-public.iam.gserviceaccount.com)
>       Roll CAS Client from 8b08f5e9f609 to 0ef9351a5b73
>
> 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: Ic16796c2981fe7b3373146a55921cfee5e64eedc
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764420
> Commit-Queue: Dennis Kempin <denniskempin@google.com>
> Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>

Change-Id: I56cd86430a8d5707e1c0a9720ac85ebe0cbc89f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764439
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2022-07-14 21:01:53 +00:00
Dennis Kempin
0ae3b8d578 infra: Disable recipe rolls until permissions are set up
BUG=b:239081770
TEST=None

Change-Id: I39667c367d5c2ca998c395b54b2f706f9ac5ac8f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764461
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-07-14 20:58:21 +00:00
Dennis Kempin
1fa061ad71 tools: Automatically install common.py dependencies
Ask the user if they want to 'pip install' the dependency
if it is missing.

Not the prettiest solution, but helps make tools like
./tools/cl usable with minimal dependencies available.

Eventually we may consider pyenv or a similar solution.

BUG=b:239072471
TEST=pip uninstall argh; ./tools/cl

Change-Id: I4872e86883a9a0903a408d2f6d4f35dd1841f2ef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764425
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-14 20:31:41 +00:00
recipe-roller
e19959ab3c Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools, recipe_engine) into this repository.

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

depot_tools:
9a7b7675ba~..2f988479fb9e31a59f935054d5f230748ed526f4
  9a7b767 (vapier@chromium.org)
      isort: make available to users
  fb8cf9c (aravindvasudev@google.com)
      Add --protocol-override to fetch.py
  13acea3 (brucedawson@chromium.org)
      Let git cl presubmit work with no branch
  23ddab2 (aravindvasudev@google.com)
      Reland "Break make_encoded_file into two functions"
  08a30b2 (bpastene@chromium.org)
      Add examples to the help string for git-cl-try's -B arg
  443d913 (dpapad@chromium.org)
      Include TypeScript .ts files in DEFAULT_FILES_TO_CHECK.
  b9dca86 (meiring@google.com)
      [depot_tools] Roll rdb.
  6a1494e (tikuta@chromium.org)
      Reland "autoninja: increase parallelism for non-HT cpu"
  1bc3cd2 (akhoroshilov@brave.com)
      Add a global core limit support for goma/rbe builds.
  cb2cef9 (sdefresne@chromium.org)
      [mac] Restore an upper limit on the number of jobs on macOS
  31bfd51 (brucedawson@chromium.org)
      Actually add a trailing slash to dir_with_slash
  9997ceb (vapier@chromium.org)
      black: add helper for formatting Python
  aa7d7e4 (dmercadier@chromium.org)
      [cpplint] Fix bug with "if constexpr"
  bfefaa8 (chanli@chromium.org)
      [depot_tools] roll led
  50c631e (jojwang@google.com)
      Skip 'ls' when downloading from gs.
  f8300fb (jochen@chromium.org)
      Remove myself from depot_tools OWNERS
  73218ec (vadimsh@chromium.org)
      [cipd] Update to v2.6.4.
  772f3dc (ukai@google.com)
      Roll out goma client VERSION=246
  632bbc0 (sokcevic@google.com)
      Skip Python 2 presubmit step when unneeded
  cf9a776 (lpromero@chromium.org)
      Typo when countdown is more than 1.
  471b549 (chanli@chromium.org)
      roll dirmd
  0e9a7d2 (sokcevic@google.com)
      Revert "Add iannucci to depot_tools owners"
  2f98847 (dsanders11@ucsbalum.com)
      cpplint: improve root path for header guard behavior

recipe_engine:
f588cc00b9~..04b3acea0bf45c9e1076079998b6378caa5570d2
  f588cc0 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 595e0f7a2869 to cb424e70e751
  52ef306 (iannucci@chromium.org)
      [recipe_engine] Implicit CANCELED final build status.
  cde011f (machenbach@chromium.org)
      [led] Add common logic to trigger a builder
  087afb8 (chanli@chromium.org)
      [recipe-py] buildbucket: enable buildbucket tracking parent/chi...
  c827c1b (chanli@chromium.org)
      Revert "[recipe-py] buildbucket: enable buildbucket tracking pa...
  9eef321 (gbeaty@chromium.org)
      Prevent creation of candidates for dependencies of dependencies.
  3db9e1b (chanli@chromium.org)
      Reland "[recipe-py] buildbucket: enable buildbucket tracking pa...
  b788d0a (vadimsh@chromium.org)
      [scheduler] Expose job ID and invocation ID.
  6d2e271 (gredelston@google.com)
      walkthrough.md: Fix incorrect kwarg "output"
  14202da (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from addd54e4fcef to 6da0608e4fa8
  826d446 (kimstephanie@google.com)
      Add new post_process.PropertiesContain to check that key exists
  f15df27 (chanli@chromium.org)
      Extend placeholder.py to schedule child builds
  83eab46 (whesse@google.com)
      [buildbucket] Relax type check on buildbucket ids
  d3504b5 (mohrr@google.com)
      [path] Add __lt__ to Path
  9e3ca47 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from a0672c27eaaa to 5fa853f88d79
  2522322 (gbeaty@chromium.org)
      Rewrite candidate_algorithm.
  b4882c1 (chanli@chromium.org)
      [time] make sleep a timed wait on global_shutdown
  1d661d3 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from b927ccff49e4 to b2aa2d72c22b
  a6fd0d2 (chanli@chromium.org)
      [time] set the step to canceled if GLOBAL_SHUTDOWN is triggered
  0f5f374 (alexschulze@chromium.org)
      [cipd] Fix `instances` command with limit = 0
  048f6f2 (chanli@chromium.org)
      [recipe-py] buildbucket: set `luci.buildbucket.parent_tracking`...
  d63eb67 (chanli@chromium.org)
      Revert "[recipe-py] buildbucket: set `luci.buildbucket.parent_t...
  e783f88 (chanli@chromium.org)
      [recipe-py] (2 attempt) buildbucket: set `luci.buildbucket.pare...
  2239191 (gbeaty@chromium.org)
      Prevent spurious GitFetchErrors in CommitList.from_backend.
  efaa1e2 (iannucci@chromium.org)
      [json] Stop using python.inline.
  dc013a8 (iannucci@chromium.org)
      [python] Mark python.inline with a warning
  6345fb2 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 4f40f26f3102 to 2aa3d7e5e866
  36be946 (iannucci@chromium.org)
      [python] Deprecate api.python.__call__
  357b1cd (martiniss@google.com)
      Add timing information option to the test command
  e174a86 (martiniss@google.com)
      Add exponential_backoff to the time module.
  ce1d368 (iannucci@chromium.org)
      [warnings] Omit warnings which are attributed to other recipe r...
  c002009 (akashmukherjee@google.com)
      [snoopy] Create luci's bcid recipe module dir.
  1e08dae (akashmukherjee@google.com)
      [snoopy] Create a luci's bcid recipe_module.
  f2754bc (akashmukherjee@google.com)
      [snoopy] Update the cipd for reporter module.
  4cb1bf0 (gbeaty@chromium.org)
      Don't set the -u flag when running python unbuffered.
  50cbd44 (meiring@google.com)
      [recipe-py] roll recipe_proto
  82fb654 (meiring@google.com)
      [recipes-py] Update ResultDB exoneration example to populate re...
  bb1fb5a (iannucci@chromium.org)
      [python] Set warning for entire python module.
  d047727 (gbeaty@chromium.org)
      Inhibit displaying coverage information on python3 failures wit...
  57ac2ff (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from e361505b12f1 to 3bd002442390
  253ac82 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 91c1b9ec335a to cad461b65231
  2684e3c (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 4137ed7879ac to 93b14d0f4216
  ac03648 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 35b05be75bc4 to 29b908616bc9
  0a09360 (kimstephanie@google.com)
      Add post_process.LogDoesNotContain
  08c51a1 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from c25db5a11beb to d3db74920e35
  e3cd9eb (kuanhuang@chromium.org)
      Add recipes API swarming.show_request(name, task) -> TaskRequest
  04b3ace (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 8b08f5e9f609 to 0ef9351a5b73

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: Ic16796c2981fe7b3373146a55921cfee5e64eedc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764420
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-07-14 20:28:31 +00:00
Daniel Verkamp
e5afc82d9c test_runner: format flaky tests message
BUG=None
TEST=tools/presubmit --all # with a failed test

Change-Id: I67262353cbd732b1394cdbe60b38d04c3a6e817b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3763359
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-07-14 20:19:01 +00:00
Dennis Kempin
f91ea18f6c infra: Allow all googlers to trigger CQ
BUG=b:216156045
TEST=None

Change-Id: If7c63824e20091a369250c983d854ec7684c5cfc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3763642
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-14 18:25:51 +00:00
Dennis Kempin
ed7d455a43 Switch main crosvm repo
This updates all references to chromiumos/platform/crosvm to
crosvm/crosvm.
It will also switch ./tools/cl to upload to the new main repository.

BUG=None
TEST=None

Change-Id: I1f71e5d5de2300e57ace1315cb4553f68533d576
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3760903
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-14 17:58:26 +00:00
Norman Bintang
3ebfc9b7fe audio: Support null backend for VirtioSnd
Rename VirtioSndCras to VirtioSnd. Add null backend support
for VirtioSnd.
Changes:
* Add backend field in virtio::snd::Parameters
* Add snd_null_device.policy
* Add NoopStreamSourceGenerator options in VirtioSnd

BUG=b:233542268
TEST=run crosvm with virtio-snd device and call aplay

Change-Id: I7fca20fd27417df3d592b1153b2dede5f2890a30
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3729264
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-14 13:44:57 +00:00
Alexandre Courbot
8f9de922f8 crosvm: make JailConfig structure parseable from command-line options
This will allow us to control all the jail-related options under a
single "--jail" command-line argument, instead of several different
arguments as we did before.

BUG=b:217480043
TEST=cargo test -p crosvm crosvm::config::tests::parse_jailconfig

Change-Id: I4246c79dcf53411461437b09cb31be8b212e1c97
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3755187
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-07-14 08:25:49 +00:00
Noah Gold
a0bf9563b2 tools: build example_simple w/ no crosvm features.
The example is currently building a crosvm with gpu support, which
doesn't link properly out of the box. Now, we build explicitly with all
features off, which is sufficient to run the example.

BUG=none
TEST=ran the example.

Change-Id: I1699741f9c094831827b090782be5f5d7492eefa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3756725
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2022-07-14 02:37:04 +00:00
Noah Gold
39a9977505 base: syslog panics on double-init.
We've had multiple silent bugs stemming from the current double-init
behavior of the logging system. To prevent that from happening for the
fourth time, this CL makes all subsequent logging inits panic. This way,
it will be much harder to commit code that won't work. Details:

* Current behavior: only the first init applies logging configuration.
  The subsequent inits will silently do nothing, and discard the
  supplied settings. These settings could be important things like
  setting the log file, whether to echo to stderr, etc.
* New behavior: after the first call to init, any subseqent call will
  panic.

NOTE: If this CL breaks a downstream project, there is very likely
a bug in that project which may be causing logs from crosvm to be
lost. Please fix that bug, or revert this CL in the downstream project
temporarily.

In this CL, we discovered that openlog_and_get_socket (used in linux
syslog) mutates global state. In tests, this manifested as a failure.
For this CL, we've chosen to preserve the behavior of only re-creating
State (and by extension, PlatformSyslog) when there is no STATE
currently set. (This behavior is nice for other reasons since it keeps
us from performing unnecessary operations when a no-op is possible.)

BUG=b:238680255
TEST=presubmit & tested downstream by verifying log files were written.
Also ran example_simple & verified it didn't panic.

Change-Id: Iad64c1b52b917e63d14a42cbbd1739ef94107fae
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3756274
Commit-Queue: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2022-07-14 02:37:03 +00:00
Noah Gold
6952be0328 arch: split platform pstore code into sys mod.
BUG=b:237597358
TEST=builds

Change-Id: I6d12ebc088dd04aed36ab312d1312873813357d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3741685
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-14 00:08:34 +00:00
Noah Gold
637b1ee1d1 arch: split platform lib code into sys mod.
Highlights:
* goldfish battery never worked on Windows, but it sort of compiled
  anyways downstream. This CL makes it unix only because it never worked
  on Windows as a device anyway.

BUG=b:237597358
TEST=builds

Change-Id: Ia5fc3b5e5fcd243d8454646b00a6857085d018ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3741432
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2022-07-14 00:08:33 +00:00
Vikram Auradkar
8d29b82847 devices: upstream pit
safe_arm_timer accepts Optional Duration. And other minor changes

BUG=b:213149155
TEST=presubmit

Change-Id: Id8739dcfc85b225dd516cc83f1100b88b87970bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3760145
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-13 23:36:57 +00:00
Vikram Auradkar
f6908a8bcc devices: move lib.rs common functions
BUG=b:213149155
TEST=presubmit

Change-Id: Id73ceac4102e14fd0c499da9441268776147f882
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3760147
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-13 23:30:26 +00:00
Noah Gold
f234eaf752 arch: enable tests on Windows.
This shuts off some of the Windows serial code beacuse it's blocked on a
separate CL that upstreams bits of the serial device. (It doesn't work
in this repo yet anyway.)

BUG=b:237597358
TEST=builds

Change-Id: If6b223ff29d55f44bff7d006c1e0b5db3733a4ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3741429
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2022-07-13 23:11:29 +00:00
Daniel Verkamp
a82d09a591 main: perform x=y arg splitting on short flags too
Previously, the argh preprocessor only converted --long=options style
arguments; this should be applied to single-character options as well,
such as `-p`.

BUG=None
TEST=cargo test args
TEST=crosvm run -p=init=/bin/bash -r=vm_rootfs.img vm_kernel

Change-Id: I8614891f5b86af1b2f6315f59689e5c0c5037416
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3759334
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-07-13 22:05:22 +00:00
Vikram Auradkar
8bcd18bdeb devices: enable debugcon on windows
new_with_pipe is not implemented yet.

BUG=b:213149155
TEST=presubmit

Change-Id: I1062bc964e6204088660fd1a04bbce09a77e293d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3760144
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 21:30:43 +00:00
Zihan Chen
f59a7fb1e9 crosvm: Allow JailConfig to not define path to policy dir
This allow us to use undefined policy dir path to enable loading
policies embedded at build time inside the binary.

BUG=b:235858187

Change-Id: I312f32ec7db9d625621707ae6330bd556dc55e93
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3759335
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2022-07-13 20:31:36 +00:00
Dennis Kempin
145b62ed7c run_tests: Run devices crate exclusively too
Some tests can fail if there is interference from other tests (e.g.
EINTR errors).

BUG=b:238232551
TEST=./tools/presubmit

Change-Id: I962a030771cee9d77f309d83fb7f0f43c18ada45
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3760897
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 18:33:20 +00:00
Vikram Auradkar
eac9b95fad ci: skip choco checksum
BUG=b:238702274
TEST=presubmit

Change-Id: Ie499523c69ab6bd4196af6db074b9db534109c9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3758741
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 17:21:48 +00:00
Alexandre Courbot
967c892d9c tools/install-doc-deps: fix parse error
Always test the script, even when just adding a comment...

BUG=None
TEST=./tools/install-doc-deps

Change-Id: I713d45f7dbfe7c6b7fc319399173749e9c6dce84
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3758181
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 07:29:17 +00:00
Daniel Almeida
863e827451 devices: video: decoder: Add a VP8 VAAPI decoder
Add a VAAPI VP8 backend. It uses the VAAPI driver in the system to
decode vp8 frames.

BUG=b:214478588
TEST=virtio::video::decoder::backend::vaapi::vp8::tests::test_25fps_vp8
passes on Hatch.

Change-Id: I5173a1761d98f0d0b3e4d4fb73c27eb8de87fb42
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3514628
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-07-13 07:11:59 +00:00
Norman Bintang
19636aeffb audio: Refactor VirtioSndCras to use StreamSourceGenerator
Use StreamSourceGenerator for VirtioSndCras to be more generic.
Changes:
* Changes concrete CrasClient type in StreamInfo with
  StreamSource trait.
* Remove StreamInfo Default implementation. New StreamInfo needs to be
  initialized with a StreamSourceGenerator.
* Add SndData field in VirtioSndCras
* Remove unnecessary params Parameters.
  Params value can be retrieved from StreamSourceGenerator.

BUG=b:220649000
TEST=run crosvm with cras-snd device and call aplay

Change-Id: I0ba5dc9e17d58a370718df3785d26888892e72f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3722008
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Norman Bintang <normanbt@chromium.org>
2022-07-13 07:07:49 +00:00
Daniel Almeida
b5a76fa5bb devices: video: decoder: Add a VP8 parser
As VAAPI is a stateless interface, add a VP8 parser in order to parse
VP8 frames. The frames will be used to feed the VP8 VAAPI backend.

BUG=b:214478588
TEST=cargo test --features "video-decoder,vaapi" -p vp8

Change-Id: Ie7315a5b76cb518b09078fe72d96384965712c28
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3514627
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-07-13 06:51:30 +00:00
Daniel Almeida
6fb485c5a1 devices: video: decoder: Add a VAAPI decoder backend
Add a VAAPI video decoder backend. This backend is able to decode frames
by calling into the VAAPI driver in the system. It does so by making use
of a libva wrapper crate that exposes a subset of the VA C code in safe
Rust.

BUG=b:214478588
TEST=virtio::video::decoder::backend::vaapi::tests::test_get_capabilities
passes on Hatch.

Change-Id: I52ac6b5b915d9c3a9b55381e1076c1b5ac0dfb5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3514624
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 06:51:29 +00:00
Daniel Almeida
9dbb169557 Reland "Add a VAAPI wrapper crate"
This is a reland of commit 213f9fe8a7.

In light of the upcoming VAAPI video decoder backend, add a VAAPI
wrapper crate that exposes a safe Rust API for a subset of the VAAPI C
code. This crate will be called from the VAAPI video decoder backend in
order to decode frames.

BUG=b:214478588
TEST=cargo build --features "video-decoder,vaapi"
TEST=`cargo test -- --include-ignored` in `media/libva` passes on a
device with Intel GPU and libva installed.

Change-Id: I586a160e477e466985c5cfa65a527542ddc03226
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3752274
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 06:51:27 +00:00
Alexandre Courbot
155f7ad98a tools/install-doc-deps: depend on libudev-dev
libva introduced a dependency on libudev, and the latter does not
distinguish between regular builds and runs of cargo doc to avoid
depending on the system library. Thus add it as a dependency to be able
to successfully build the docs.

BUG=b:214478588
TEST=./tools/cargo-doc

Change-Id: I4150b312fd7e1a5197c817e4d7cee5766a3c569a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3758165
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-07-13 06:51:26 +00:00
Alexandre Courbot
728d6d1807 base: windows: mmap: remove duplicate tests
These tests also exist identically in base/src/sys/windows/mmap.rs.

BUG=b:213153157
TEST=./tools/dev_container ./tools/run_tests --target=host --build-target=mingw64

Change-Id: Ibe638920da55ebe48e6bb2e7c3aaeb1a4b1b8ecd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3752269
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 05:43:02 +00:00
Alexandre Courbot
f3a874157c base: windows: update protection to fix build breakage
Change http://crrev.com/c/3737406 removed the custom permission enum for
IOMMU, but did not update the related Windows code. This results in a
build error that was not caught because the Windows builder was
temporarily deactivated.

BUG=b:237620529
TEST=./tools/dev_container ./tools/run_tests --target=host --build-target=mingw64

Change-Id: Id57eb0d0836fe0c61ff578752d5c5eb8941f37b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3758169
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 05:43:01 +00:00
Kameron Lutes
93b6042f33 crosvm_control: Expose USB_CONTROL_MAX_PORTS
Exposes the maximum number of USB ports that can be retrieved through a
call to crosvm_client_usb_list.

BUG=b:188858559
TEST=cq

Change-Id: I87c788f755763afaab021eb4126dadbcc3ac4090
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3757173
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Kameron Lutes <kalutes@chromium.org>
2022-07-13 03:01:24 +00:00
David Stevens
7ec522a1b8 devices: iommu: remove Translate trait
Merge the Translate trait into the Mapper trait, and add a translate
method directly to IpcMemoryMapper. This is preparation for when the
frontend IpcMemoryMapper struct and the backend Translate trait will
diverge.

BUG=b:237620529
TEST=compiles

Change-Id: Iaeb98237aef2fb8d46719d6e6ec5669e49582ae7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3737407
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-13 01:50:57 +00:00
David Stevens
eb077b850a devices: iommu: remove custom permission enum
Replace custom memory_mapper::Permission with base::Protection.

BUG=b:237620529
TEST=boot ARCVM and crostini

Change-Id: Iceaca2ee417e0c37e23e956bf18b8853674caa40
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3737406
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
2022-07-13 01:50:56 +00:00
David Stevens
c206d1a3d4 devices: iommu: replace memory_mapper::Error with anyhow
Replace thiserror enum with anyhow. The only error that needs to be
checked for is IovaPartialOverlap, which can be handled by changing the
add/remove map return types from () to bool. This CL also adds proper
handling of that case to the iommu device.

BUG=b:237620529
TEST=compiles

Change-Id: I066cf2d609d1264b235b019ec098f9a761535f9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3737405
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 01:50:54 +00:00
Dennis Kempin
92fabf70b8 infra: Add CQ list view and enable windows in CQ
Adds another dashboard of all presubmit / CQ builders and
enables windows in presubmit as well.

BUG=None
TEST=None

Change-Id: I36af76cec1306648993331dc8f9b9bfbec4637d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3759329
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-12 22:30:45 +00:00
Daniel Verkamp
4a764d2c83 main: add tests for argh compatibility code
This was previously untested, so split it into its own function and add
a few basic tests.

BUG=None
TEST=cargo test

Change-Id: I36ae7876d22684dfae1ec3f0edf1d06d3fc04cdd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3749940
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-07-12 22:02:08 +00:00
Daniel Verkamp
a44e8a03e3 main: fix switch-or-option argh wrapper nits
Fix two small bugs in the code that handles options that are valid with
or without extra options (--battery, --video-encoder, --video-decoder,
--gpu, and --gpu-display):
- If the next arg was a short option (e.g. `-p`), we didn't consider it
  the start of a new flag, so it would have been used as the parameters
  for a switch-or-option arg (e.g. `--gpu -p something` would parse as
  `--gpu=-p`). Fix this by only requiring a single dash instead of two.
- The `crosvm run` command requires a positional argument at the end
  (kernel filename), and the check for the switch-or-option arg had an
  off-by-one that did not consider the positional argument. This broke
  the case where one of these switches occurred right before the kernel
  filename argument, e.g. `crosvm run [...] --gpu vm_kernel`. Fix this
  by comparing against len - 2 instead of len - 1.

BUG=b:237334804
TEST=crosvm run --battery -p init=/bin/bash -r vm_rootfs.img vm_kernel
TEST=crosvm run -p init=/bin/bash -r vm_roofs.img --battery vm_kernel

Change-Id: I2c44ca124ba35b980e655f4f0cf9a9366e6be33d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3749939
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-07-12 20:18:47 +00:00
Ryan Neph
de7835d9b0 rutagaba_gfx: set envvar "radv_require_etc2=true" to fix ARCVM CTS regression
This workaround is needed to fix an ARCVM CTS regression:
CtsGraphicsTestCases - android.graphics.cts.VulkanFeaturesTest#testVulkanHardwareFeatures

The test regressed after virgl_render_server changed it's execname in
crrev/c/3711405 to match each guest app's execname and mesa's dri-conf
no longer applies this setting automatically.

BUG=b:237493180
TEST=(passing on guybrush/nipperkin):
     cts-tradefed run commandAndExit cts -m CtsGraphicsTestCases \
     -t android.graphics.cts.VulkanFeaturesTest#testVulkanHardwareFeatures
     (on guybrush/nipperkin)

Change-Id: I60d16ecceb8dd84e40a3a4a76fb1d7e72f448b60
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3753417
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
2022-07-12 17:28:26 +00:00
Frederick Mayle
500c403a53 devices: virtio: console: Fix stuck vm when virtio-console has no output
If a virtio-console has type "sink" and the guest keeps writing to it,
the virtio queue would fill and then further writes would block the
guest.

Using an `io::sink` fallback matches the non-async virtio-console's
behavior.

TEST=android microdroid tests
BUG=b:238440998

Change-Id: I145e09052ec8ed166055ad73195c57bf63551efc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3756726
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Frederick Mayle <fmayle@google.com>
2022-07-12 03:48:19 +00:00
David Stevens
f436e27060 vmm_vhost: add shared memory region support
Add support for shared memory regions to vhost-user. This is adding
support for a front-end message to query for necessary shared memory
regions plus back-end message to support mapping/unmapping files from
the shared memory region.

go/vvu-shared-memory

BUG=b:201745804
TEST=compiles

Change-Id: I35c5d260ee09175b68f6778b81883e0070ee0265
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716344
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-12 01:13:14 +00:00
Dennis Kempin
894b82c591 infra: Reduce number of repetitions to 3
Tests run fast natively, 10 repetitions only take 5 minutes to run.
However for aarch64/armhf it can take >30 minutes. Which is ok for
post-submit but still unnecessarily slow.
3 repetitions is enough to find flakes.

BUG=b:238232551
TEST=None

Change-Id: I958ec734c85047c65a13d1cc172468622073d360
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3751033
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-11 18:42:45 +00:00
Alexandre Courbot
7f9050662f Revert "Add a VAAPI wrapper crate"
This reverts commit 213f9fe8a7.

Reason for revert: breaks the ChromeOS builder.

Original change's description:
> Add a VAAPI wrapper crate
>
> In light of the upcoming VAAPI video decoder backend, add a VAAPI
> wrapper crate that exposes a safe Rust API for a subset of the VAAPI C
> code. This crate will be called from the VAAPI video decoder backend in
> order to decode frames.
>
> BUG=b:214478588
> TEST=cargo build --features "video-decoder,vaapi"
> TEST=`cargo test -- --include-ignored` in `media/libva` passes on a
> device with Intel GPU and libva installed.
>
> Change-Id: I4afa96c49d045251827b97bd78faeba57575aedc

Bug: b:214478588
Change-Id: Ib5a88cd4c5fdd2df2e69fd3a0896ee789585840d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3752267
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-07-11 04:32:15 +00:00
Daniel Almeida
213f9fe8a7 Add a VAAPI wrapper crate
In light of the upcoming VAAPI video decoder backend, add a VAAPI
wrapper crate that exposes a safe Rust API for a subset of the VAAPI C
code. This crate will be called from the VAAPI video decoder backend in
order to decode frames.

BUG=b:214478588
TEST=cargo build --features "video-decoder,vaapi"
TEST=`cargo test -- --include-ignored` in `media/libva` passes on a
device with Intel GPU and libva installed.

Change-Id: I4afa96c49d045251827b97bd78faeba57575aedc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3422779
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-11 02:16:00 +00:00
Dennis Kempin
12593ba642 infra: Add docs builder
The new builder will generate the mdbook and api docs, then
uploads them to GCS.

BUG=b:233411583
TEST=luci-auth context ./infra/recipes.py run build_docs

Change-Id: Ia22cdb20d73f9268db6299cd6f0875950d174b3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3751832
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-08 22:26:31 +00:00
Dennis Kempin
0d49facc30 build_windows: Do not re-install rustup
Rustup does not seem to like to be re-installed on windows. So we can
just skip running rustup-init if it does not exist yet.

BUG=b:238232551
TEST=led get-build 8809175137568661169 | led edit-recipe-bundle | led launch
https://ci.chromium.org/swarming/task/5bf87806f4627f10

Change-Id: Ice0861a8d52499660b26ee259daf135b595aa053
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3751029
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-08 22:26:16 +00:00