Commit graph

4345 commits

Author SHA1 Message Date
Daniel Verkamp
c7899e61ae resources: allow creation of empty AddressAllocators
There is nothing inherently wrong with a pool that contains no space.
This will allow us to effectively remove the high MMIO region when
requested without adding Options everywhere.

BUG=b:178000549
TEST=cargo test -p resources

Change-Id: Idae3dc7e0109a6f77484576a3060f5a8a454b2c1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790033
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-02 01:53:14 +00:00
David Stevens
0b846e26f5 crosvm: make iommu optional for vfio hotplug
Add a flag to determine whether or not virtio-iommu is used to isolate
hotplugged vfio devices. This removes the virtio-iommu from the default
devices, since it was always present to accommodate the `crosvm vfio`
command.

BUG=b:231365736
TEST=boot ARCVM, observe no virtio-iommu

Change-Id: Ie5d396299465633534039973eba26c0e1d8be21d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3802107
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
2022-08-02 01:24:34 +00:00
Daniel Verkamp
0fb4cb0baf pci_bridge: make prefetch window failure non-fatal
This will allow us to set up a memory layout where the high MMIO region
is empty.

BUG=b:178000549
TEST=crosvm run --no-high-mmio

Change-Id: I21dd76fdb77774e7f5bbfbf7cea06422bf437291
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790032
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-08-02 01:15:34 +00:00
Daniel Verkamp
e2d9a91bea pci_bridge: use unique Alloc for prefetch window
This will prevent duplicate Allocs if both the prefetch and non-prefetch
windows are allocated from the same AddressAllocator.

BUG=b:178000549
TEST=tools/presubmit --all

Change-Id: I1c8b909ada0eb5bb25872cd7f8e35eec7357b9cb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790031
Reviewed-by: David Stevens <stevensd@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-02 01:07:24 +00:00
Daniel Verkamp
82e7bfedaa x86_64: fix off by one of high MMIO range end
The code was unintentionally subtracting 1 (to get the inclusive end
address) twice, leaving off one extra byte. This doesn't make much
difference in practice since the high MMIO region is typically very
large (up to 64 terabytes).

The result can be observed in the guest's /proc/iomem, where the PCI
region should now end at 0x..ffff instead of 0x...fffe.

BUG=None
TEST=Boot x86-64 Linux kernel; cat /proc/iomem

Change-Id: I2df210ed40612cefce68926c616f455e416ed40c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790030
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-08-02 01:07:04 +00:00
Daniel Verkamp
1fb95746de vm_control: use mmio_allocator_any() to find allocs
The vm_control requests that allocate memory from an existing PCI BAR
previously hard-coded MmioType::High, but we can decouple this from the
particular region by using `mmio_allocator_any()`, which will search
both the low and high MMIO regions. Only one will contain the specified
PCI address and BAR combination, so there should be no change in
behavior for the usual configuration where the PCI BAR will be allocated
from high MMIO.

BUG=b:178000549
TEST=Start crosvm with fs device and GPU enabled

Change-Id: Ia7c5633ee77be0721341d199b704a443c8a3e8d1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784343
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
2022-08-02 00:49:14 +00:00
Daniel Verkamp
f0c62bd6fd resources: add allocate_mmio() and AllocOptions
This allows SystemAllocator users to specify the properties of the
allocation they want rather than explicitly picking between
MmioType::Low and MmioType::High. That way, we can rearrange the
location of the prefetchable/cacheable MMIO region to accomodate use
cases like running 32-bit guest kernels without adjusting all allocation
call sites.

BUG=b:178000549
TEST=Boot x86_64 Linux in crosvm

Change-Id: I691393202c9841f4c687be55a9404fe619790634
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784342
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
2022-08-02 00:49:14 +00:00
Daniel Verkamp
0005729e63 crosvm: update deprecated --host_ip name in error
This option is called --host-ip now.

BUG=b:235882579
TEST=tools/presubmit --all

Change-Id: I12c40116bbe0c426ad9c803f8221d42506006a3e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792426
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-02 00:44:14 +00:00
recipe-roller
fe3a1ed3f0 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/8806987053384346353

depot_tools:
faa1111bd0
  faa1111 (qyearsley@chromium.org)
      Update lucicfg version 1.32.0 to 1.32.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: I102e0c2156c468b30868f07a555287112d04b9c4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3803890
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>
2022-08-02 00:37:44 +00:00
recipe-roller
5e0d458564 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/8806988935837561489

depot_tools:
0c0a46bc40
  0c0a46b (bryner@google.com)
      New vpython to depot_tools.

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: I9d7b5a072524249902504689fa84cef1eaadbd02
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798978
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>
2022-08-02 00:07:15 +00:00
Tinghao Zhang
f922f52238 devices: pci: impl destroy method for pci bridge
Pcie upstream and downstream port will be removed during hotplug
out event, so we need to destroy and clear resources for them.
This patch implements destroy method for pci bridge and destroys
the msi config during hotplug out.

BUG=b:199986018
TEST=tools/presubmit

Change-Id: I87ad7c343a7552b70b384fc5b732c0b9fd782ccf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3769815
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Xiong Y Zhang <xiong.y.zhang@intel.corp-partner.google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 23:40:44 +00:00
Daniel Verkamp
8bd3ee9b7b contributing: fix "uploaad" typo
BUG=None
TEST=None

Change-Id: I9a219c39409b7474dbce89ac422ab6d7c3846432
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798977
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 23:30:44 +00:00
Tinghao Zhang
291fb1dae2 devices: pcie: impl hotplug bus for pcie switch
To hotplug in/out pcie switch, we need to implement hotplug bus
for pcie upstream and downstream port. Pcie switch are designed
to be added in a layered manner, eg. first upstream port got
added into system, then downstream and finally endpoint devices.
We implement hotplug bus to keep track of this layered structure
and execute hotplug event for each pcie port.

BUG=b:199986018
TEST=tools/presubmit

Change-Id: Ib024e659a9a5e86f98d88ab6ceb004d11fdaa18d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765365
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Xiong Y Zhang <xiong.y.zhang@intel.corp-partner.google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 23:17:24 +00:00
recipe-roller
ff5d13497f 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/8806992649514068993

depot_tools:
96b57b9b59
  96b57b9 (jojwang@chromium.org)
      [no-sync] bot_update: Remove previous no-sync exp changes and i...

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: I56a2c06f3b737a209f4b9f0220cbe0a881c3daea
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795656
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>
2022-08-01 23:17:14 +00:00
Elie Kheirallah
3d73239a7c tools: Add libguestfs-tools to deps
libguestfs-tools added, required for using virt-builder.

Bug=None
Test=./tools/install-deps && ./tools/examples/example_simple

Change-Id: If8db63debfb8e70cbf663b0c0e1d5acb0de43aa3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790022
Tested-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Elie Kheirallah <khei@google.com>
2022-08-01 23:06:24 +00:00
Dennis Kempin
8a46389c9b infra: Add docs builds to health_check recipe
We had several issues with docs builds breaking in post submit.

BUG=b:239743001
TEST=https://ci.chromium.org/swarming/task/5c745efef5d6ff10

Change-Id: I262e069a0d3ccb4442c074e1bea7b4fb436c313a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798976
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-08-01 22:47:50 +00:00
Daniel Verkamp
44146d272c devices: ac97: fix missing import with audio_cras
The `error!` macro is still used when the audio_cras feature is enabled.
Add its import back.

BUG=None
TEST=emerge-trogdor crosvm

Change-Id: I06430fece32fc203bf0e9005f29e346dad88eea4
Fixes: 28c318fa20 ("Fix ChromeOS build")
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798972
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
2022-08-01 21:28:04 +00:00
Daniel Verkamp
600ad38ff8 Remove redundant {self} imports
- Remove trailing ::{self} on all use statements
- Remove any resulting single-level use statements (e.g. use libc;)
- Reformat with `tools/fmt --nightly`

BUG=b:239937122
TEST=tools/dev_container tools/presubmit --all

Change-Id: I8afd1b0458ca6d08d9b41a24583f7d4148597ccb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798973
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-08-01 21:27:54 +00:00
Daniel Verkamp
eb5c3dae7a main: add --syslog-tag option to crosvm
This mirrors the functionality of the `crosvm run --syslog-tag` option
that we already have; the long-term goal is to remove the run-specific
option and use the top-level argument instead, but we will keep both for
compatibility until downstream projects have migrated.

Moving the option to the top level arguments will let us initialize
logging earlier once the run option is dropped.

BUG=b:240578830
TEST=crosvm --syslog-tag TEST run bzImage # observe TEST in syslog

Change-Id: Ie7ff8dc8e43a13b11641fcefd12b40ecf339970b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792427
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 20:20:54 +00:00
Daniel Verkamp
03356743aa devices: pcie_port: report preferred address
Extend the preferred_address() support to PCIe devices, specifically the
various PCIe root ports.

BUG=b:237415650
TEST=tools/presubmit --all
TEST=Boot x86_64 bzImage

Change-Id: I56109530ccb43a17bdf9b74eec612a527028cc7c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786974
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-08-01 19:29:34 +00:00
Daniel Verkamp
647b86d029 devices: vfio: report preferred PCI address
Rather than deferring the choice of PCI address to runtime during the
allocate_address() function, move it to the constructor so an error
message can be returned earlier. This lets us report the preferred
address in the PciDevice impl so that the PCI address allocation code in
arch can reserve the preferred address before allocating addresses for
other devices.

BUG=b:237415650
TEST=tools/presubmit --all

Change-Id: I8a00f5f4251450f475bc83c346b3288dbf901f1d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786973
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 19:29:34 +00:00
recipe-roller
618a08a7a1 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/8807006547075898129

depot_tools:
0187079c09
  0187079 (jojwang@chromium.org)
      [no-sync] Save previous values to files.

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: I9e17820e809849a84b59650aaa7e2d3a7d7681d7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798915
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>
2022-08-01 19:26:24 +00:00
Clarissa Garvey
00be3d5180 base/src: Add Unix StreamChannel Message test
Prior to this CL, the StreamChannel in base/src/sys/unix had no tests
for FramingMode::Message. This CL adds a test for that framing mode.

Bug: b:231641496
Change-Id: I75e13709d558258eca838c3190aaf0237e39513b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3793688
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Clarissa Garvey <clarissagarvey@chromium.org>
Tested-by: Clarissa Garvey <clarissagarvey@chromium.org>
2022-08-01 19:01:44 +00:00
Daniel Verkamp
0076579e95 arch: allocate reserved PCI addresses first
Add a new PciDevice::preferred_address() function, which allows devices
to report a PCI address where they would prefer to be allocated.

This lets the arch layer pick out the devices that need to have their
addresses reserved before allocating the remaining addresses to device
that don't care about their assigned PCI address.

For now, the returned preferred_address value is not actually used aside
from checking is_some(), but it will be used in upcoming cleanups.

BUG=b:237415650
TEST=Run x86-64 bzImage

Change-Id: Ia323274dcf801a8fe1959287bcc791ca32ce4e18
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781441
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 18:57:44 +00:00
Daniel Verkamp
d2fdbedf60 devices: virtio: reserve preferred PCI address
If the VirtioDevice provided a preferred PCI address, we previously used
it but did not reserve the address in the resource allocator. This could
have resulted in address reuse. Add a case to reserve the preferred PCI
address if it was specified.

BUG=b:237415650
TEST=tools/presubmit --all

Change-Id: Id84a9cee99e8955dae174be4f5a6a6c60fb17bd9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781440
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-08-01 18:09:14 +00:00
David Manouchehri
4b3db6786c base: Allow memory to be merged with KSM on Linux.
By default, KSM is disabled by the kernel. This is harmless if KSM
is disabled, and only causes merging if the user manually enabled
the feature on their kernel. If enabled, significant memory saving
can occur, at the cost of CPU cycles and a reduction in privacy.

Bug: 1346340
Change-Id: I838cdda97ea8d335b1953dd6775311958069898c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780870
Reviewed-by: David Manouchehri <david@davidmanouchehri.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 18:04:43 +00:00
Frederick Mayle
528777ab32 integration_tests: Don't run fixture.rs as a test
Each file in the "tests" dir is interpreted as a test, so cargo was
running fixture.rs as a test with 0 test cases. Moved it into a
submodule as recommened in
https://doc.rust-lang.org/book/ch11-03-test-organization.html#submodules-in-integration-tests

TEST=./integration_tests/run

Change-Id: I7cbb9a2e5e1283829e20d531a90f9d0c1fffd232
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795890
Auto-Submit: Frederick Mayle <fmayle@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-08-01 17:29:54 +00:00
Keiichi Watanabe
950b4839a8 tools: Use --no-default-features in crosvm-direct builder
Since ChromeOS's crosvm ebuild uses `--no-default-features` for
crosvm-direct, our LUCI builder should do so, too.

BUG=b:220292205
TEST=./tools/run_tests --target=host --crosvm-direct

Change-Id: I2550bf5931e90ebf434fda0990ac5d707ba5ac12
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3802108
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-08-01 17:20:43 +00:00
Pierre-Clément Tosi
d871fe8a7e crosvm: Fix UnprotectedWithFirmware
Currently, --unprotected-vm-with-firmware does not load the provided
firmware and therefore doesn't execute it either. Instead, it jumps
directly to the provided payload. Fix the config assignment causing this
behavior.

BUG=b:240704906

Change-Id: Iaedaa372d668b2fab70a80252e30f608b48c2099
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3794252
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Andrew Walbran <qwandor@google.com>
2022-08-01 14:53:43 +00:00
David Stevens
28c318fa20 Fix ChromeOS build
Fix a crosvm-direct build breakage and some audio_cras build breakages
and clippy warnings.

BUG=None
TEST=emerge-brya-manatee crosvm

Change-Id: I480f0b32b531110d5397c171446ab0dccc7d8808
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3802785
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
2022-08-01 13:12:17 +00:00
David Stevens
fd5c835a5b Revert "wl: disable wl shared memory feature"
Re-enable the shared memory feature for virtwl now that the driver has
been fixed by crrev.com/c/3787666.

This reverts commit bdba48b64b.

BUG=b:213532601
TEST=crostini.CopyPaste.wayland_to_x11_buster_stable

Change-Id: I987060756b9eb683f1375fc1f0ce32d6c3077ead
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3789168
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-30 03:33:52 +00:00
Alexandre Courbot
ae02641b1b media: ffmpeg: allow zero-copy for input packets
Add a wrapper for libavcodec's AVBufferRef and allow AvPacket to be
built from one ; this makes the AvPacket the owner of the data and means
it doesn't need to internally copy it.

The input data will be dropped once avcodec signals that it doesn't need
it anymore.

BUG=b:169295147
TEST=v4l2r's simple_decoder can decode a H.264 stream.

Change-Id: I9fa54124daed031fd1f397eaa8d57dc73f83c9b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782037
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-30 02:52:32 +00:00
Daniel Verkamp
4e626ec083 github: update contributing link
The original contributing.html link was broken since we shuffled some of
the directories around.

BUG=None
TEST=follow the link

Change-Id: I0c2c9ce0fa79e786d87e679b8391f884b0b8cc4a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795006
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-07-29 22:54:01 +00:00
Daniel Verkamp
8930ba079f crosvm: update book and doc links to crosvm.dev
Replaced using this script:

git grep -l 'https://google.github.io/crosvm' \
 | xargs -n1 sed -i \
 -e 's^https://google.github.io/crosvm/doc/^https://crosvm.dev/doc/^g' \
 -e 's^https://google.github.io/crosvm/^https://crosvm.dev/book/^g'

BUG=None
TEST=mdbook build doc/book

Change-Id: I8df4e0bcc1ca1e9044df29998572393c934e29cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795005
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-29 22:54:01 +00:00
Daniel Verkamp
a77c40ec06 tools: enable search feature for mdbook
This will generate the search index and in-browser search for the book.

BUG=None
TEST=mdbook build docs/book

Change-Id: Ibaf67002c5b5d5cf1aafd19ab66a05b9116b14a0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792098
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-29 21:16:21 +00:00
Vikram Auradkar
dd7ef550dc crosvm: resync crosvm windows
Brings in changes from downstream.

- Reintroduce generate_catchall_args.
  - This code will be deleted soon
- Fix clippy warnings.
- Conditionally compile feature specific changes.

BUG=b:213146388
TEST=The code compiles downstream.

Change-Id: Ic8192b84f5677d1b5f9b2a2c80df20645b1dfab3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3794523
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-29 20:56:41 +00:00
Richard
f43c59bcdd ac97: Upstream Windows Ac97 implementation and removed Vios from Ac97
This does not include ac97_bus_master being upstreamed, which will be
done in a followup CL

BUG=b:237681055
TEST=built for both platforms and ran Windows tests locally

Change-Id: I3220caf7e87c5c236a975304ac9af10dcf6829f0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764045
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Richard Zhang <rizhang@google.com>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
2022-07-29 18:16:21 +00:00
Vikram Auradkar
5e4ce1db39 base: RecvTube impl ReadNotifier
Closing one of the deltas in base crate.

BUG=b:213146388
TEST=presubmit

Change-Id: Ibac36d1ad9b1b6387ec74e8b59ccb38319903655
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3793691
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-29 17:49:31 +00:00
Vikram Auradkar
925ba7a1fb crosvm: Fix clippy related warnings
Ran clippy with features that are enabled downstream. Those features
will be enabled upstream in later cls when crosvm starts building.

BUG=b:213146388
TEST=presubmit

Change-Id: I67cb74127a349b572e573c350d69d1611533d961
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3793690
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Tested-by: Vikram Auradkar <auradkar@google.com>
2022-07-29 17:49:31 +00:00
recipe-roller
4bf124905a 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/8807295958631195457

recipe_engine:
dd96320d16
  dd96320 (gerb@google.com)
      resultdb: Ensure Artifacts.contents is binary

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: Ifab39fcbcae5ed6cd185776c9710569bffa1b777
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792093
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>
2022-07-29 14:44:01 +00:00
Alexandre Courbot
31539a7a79 virtio: video: decoder: ffmpeg: make input buffers manage their event
Make the InputBuffer type able to send the event signaling its
availability to be reused itself, when it is dropped. This does not
bring any immediate benefit, but is going to be a required design for
the next CL, where we transfer its ownership to libavcodec in order to
avoid copying its content.

BUG=b:169295147
TEST=v4l2r's simple_decoder can decode a H.264 stream.

Change-Id: I822bac85d9cd5f87e450e4c7ec009bb75655e91f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782036
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-07-29 12:26:11 +00:00
Alexandre Courbot
91ff1282b4 virtio: video: decoder: add SyncEventQueue
So far we were using EventQueue in a very simple and controlled manner ;
but efficient decoding patterns are more complex than that and we are
soon going to need to keep references to the queue from remote corners
of the code and post events from there, which requires mutable access.

To help with this, add a SyncEventQueue type that is essentially an
EventQueue wrapped into a Mutex, which allows us to make its methods
non-mut.

BUG=b:169295147
TEST=v4l2r's simple_decoder can decode a H.264 stream.

Change-Id: Ife94629ab2382eb0aac5786ba24373c66b80efc7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782035
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-29 12:26:03 +00:00
Norman Bintang
03b55369d4 audio: Remove audio cfg requirement for VhostUserSnd frontend
Enable vhost-user sound frontend even without audio cfg. It makes vhost
user sound frontend available in crosvm-direct. It is okay because
vhost-user frontend doesn't do any device emulation. crosvm-direct is a
lightweight crosvm binary to run ChromeOS VM and other guest VMs on
ManaTEE.

BUG=b:240363846
TEST=run crosvm with audio cfg as backend
TEST=run crosvm without audio cfg as frontend then call aplay

Change-Id: I9e6c3f22ca725e1689930cbb0503ad8bfab9264d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784682
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Norman Bintang <normanbt@chromium.org>
Tested-by: Norman Bintang <normanbt@chromium.org>
2022-07-29 06:04:31 +00:00
Dennis Kempin
1f0b985a4d Update cloud storage locations to use crosvm-infra project
See go/crosvm/infra for instructions on how to get access to uploading
them.

Added a helper script to install dependencies needed to build the
guest_under_test.

BUG=b:235269312
TEST=Kokoro

Change-Id: I78387a33ddbf3ab199b36e76ba617acb1250c7e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3783011
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-29 02:17:15 +00:00
Dennis Kempin
8faf4677bb infra: Public API docs at /doc instead of /api
Do not delete files in GCS, it contains an index.html we
want to preserve. Ideally we will generate it automatically
in the bot.

BUG=b:239255064
TEST=./infra/recipes.py test run

Change-Id: I5df428ce4198d04374e51ac2372e5daceb6e2651
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792629
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-29 01:12:44 +00:00
Dennis Kempin
f2b8cb84bd Add --nightly option to rustfmt
This allows you to use the nightly version of rustfmt
to reformat imports as well.

BUG=None
TEST=./tools/fmt --nightly

Change-Id: I07c2fd1ad59ddfed3d97b636f991ae50076fd5d3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792430
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-28 23:06:51 +00:00
recipe-roller
f7b2e109e3 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/8807356362479099905

depot_tools:
cec7295ab0
  cec7295 (zhihuixie@google.com)
      depot_tools: Roll rdb

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: Ie12167b33bbc0837a7185a750ecdfab76607be73
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792628
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>
2022-07-28 22:45:51 +00:00
Pujun Lun
2915a351f1 gpu: rename "displays" to "display_params" in GpuParameters
"display_params" better reflects the actual type. They are eventually
passed to struct Gpu and VirtioGpu and they are also called
"display_params" there, so this feel more consistent.

BUG=b:233676779
TEST=presubmit

Change-Id: I315b7be92ae60a0996290ea5ee180e2b0efde279
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792773
Tested-by: Pujun Lun <lunpujun@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Pujun Lun <lunpujun@google.com>
2022-07-28 22:39:51 +00:00
Zihan Chen
216a22426c dev_container: Uprev to include clang
Need clang to compile minijail policies

TEST=new container can build crosvm with minijail policies included
BUG=b:235858187

Change-Id: Id26898025ef1ff3148da2edc5af3d923a00401c2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792428
Commit-Queue: Zihan Chen <zihanchen@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Zihan Chen <zihanchen@google.com>
2022-07-28 21:56:31 +00:00
Daniel Verkamp
29513965ce crosvm: clean up unix wildcard re-export
Export only the few items that are actually needed. This also cleans up
an unused import warning when compiling with --no-default-features.

BUG=None
TEST=cargo build
TEST=cargo build --no-default-features
TEST=cargo build --no-default-features --features=gpu
TEST=cargo build --no-default-features --features=plugin
TEST=cargo build --no-default-features --features=gpu,plugin

Change-Id: I0293cbe702059b785a51363e5376c27378931fb8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786978
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-07-28 21:30:50 +00:00