Commit graph

853 commits

Author SHA1 Message Date
David Tolnay
5b73b7edec edition: Update crosvm_plugin crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I78a8e95199da47843bf75bb9b2f0f3dd9899ac19
Reviewed-on: https://chromium-review.googlesource.com/1519703
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-09 01:55:17 -07:00
Daniel Verkamp
7154c1d8ae Silence non_upper_case_globals warnings in macros
The enumn and bitfield macros generate global constants based on names
that are typically in CamelCase, but the new on-by-default warning
non_upper_case_globals complains about them.

Fixes warnings of the form:
  warning: associated constant `...` should have an upper case name
when using enumn or bitfield.

BUG=None
TEST=`cargo build` without warnings

Change-Id: Id908df1dcdf58288c2cbdff574cb70be2026bde6
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1536558
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-09 01:55:16 -07:00
David Tolnay
48ff4165d2 cargo: Sort all dependency lists in Cargo.toml
This may help reduce cases of conflicts between independent CLs each
appending a dependency at the bottom of the list, of which I hit two
today rebasing some of my open CLs.

TEST=cargo check --all-features

Change-Id: Ief10bb004cc7b44b107dc3841ce36c6b23632aed
Reviewed-on: https://chromium-review.googlesource.com/1557172
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2019-04-09 01:55:14 -07:00
David Tolnay
59bb712992 edition: Update qcow and qcow_util to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Ief3fb967df340a99b8263ac185207e30e096105a
Reviewed-on: https://chromium-review.googlesource.com/1519704
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:36 -07:00
David Tolnay
ce48c2b986 edition: Update sys_util to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Ic57170776a9396bab54a8c7eb2b8b1436f63b57c
Reviewed-on: https://chromium-review.googlesource.com/1520069
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:35 -07:00
Daniel Verkamp
939997566d rust-toolchain: upgrade to Rust 1.33.0
BUG=None
TEST=build_test
CQ-DEPEND=CL:1534743

Change-Id: Ic2d9a89dd65b995510b97221e34653442be10cfa
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1534964
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:30 -07:00
David Tolnay
0159e5ada2 edition: Update crosvm crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: If27a414db82bd6005d8067af24639f309d3b5e2e
Reviewed-on: https://chromium-review.googlesource.com/1519691
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:28 -07:00
David Tolnay
a7d4ea6dd0 edition: Update msg_socket to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I6d541d6d51498612c82072c64cb78eefcb2abb8c
Reviewed-on: https://chromium-review.googlesource.com/1519700
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:26 -07:00
David Tolnay
7129a05b91 edition: Update arch crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Ia9d3297d0c8fd4b34cf6dfb203bb7e382a462579
Reviewed-on: https://chromium-review.googlesource.com/1519688
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:24 -07:00
David Tolnay
e40a7f32aa edition: Update gpu_buffer, gpu_display, gpu_renderer to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I290fc72e5624cf8b4b2bacaf124cc5b654255978
Reviewed-on: https://chromium-review.googlesource.com/1519696
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:19 -07:00
David Tolnay
85ce8d392e edition: Update aarch64 crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I833f37561f61f63b732484aa11821855a8531500
Reviewed-on: https://chromium-review.googlesource.com/1519687
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 11:54:36 -07:00
David Tolnay
9b31123be7 edition: Update p9 crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I3a3abb1cf292624d0e4e3cc9a52276be42b0c5af
Reviewed-on: https://chromium-review.googlesource.com/1519702
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 11:54:35 -07:00
David Tolnay
417e3f22c9 edition: Update kvm and kvm_sys crates to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: If4140face2c291862f73a3bc095cbf968a442095
Reviewed-on: https://chromium-review.googlesource.com/1519699
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 02:51:39 -07:00
David Tolnay
14698d9818 edition: Update tempdir crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I6f7caf29a4d65bc633a8fe98d4477117be90210a
Reviewed-on: https://chromium-review.googlesource.com/1520070
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 02:51:39 -07:00
David Tolnay
dbff49af8e edition: Update vhost crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Id6ffa0d96f6486ddb04c961138e91391a0f034e3
Reviewed-on: https://chromium-review.googlesource.com/1520072
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 02:51:38 -07:00
David Tolnay
fdac5ede46 edition: Use dyn syntax for trait objects
Found by running: `cargo rustc -- -D bare_trait_objects`

Bare trait objects like `&Trait` and `Box<Trait>` are soft-deprecated in
2018 edition and will start warning at some point.

As part of this, I replaced `Box<Trait + 'static>` with `Box<dyn Trait>`
because the 'static bound is implied for boxed trait objects.

TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu
TEST=local kokoro

Change-Id: I41c4f13530bece8a34a8ed1c1afd7035b8f86f19
Reviewed-on: https://chromium-review.googlesource.com/1513059
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 02:51:37 -07:00
David Tolnay
98895ac05d edition: Update enumn crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Ia446b796d9f6bf3ddf9813ee0678242697dd1f73
Reviewed-on: https://chromium-review.googlesource.com/1519694
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 02:51:37 -07:00
David Tolnay
639a8c1152 edition: Update kernel_cmdline and kernel_loader to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I4f6c91c966afc96fad634e355553ab90fc305261
Reviewed-on: https://chromium-review.googlesource.com/1519698
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 02:51:37 -07:00
David Tolnay
4a0fa14059 edition: Update vm_control to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Iedc030e90e4c4e11cf69dde711df24caafc0ea4c
Reviewed-on: https://chromium-review.googlesource.com/1520074
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 02:51:35 -07:00
David Tolnay
63c6e2d35c edition: Update io_jail crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Id5f2c4f9005498e2357bec5878761c33d2bc3d8b
Reviewed-on: https://chromium-review.googlesource.com/1519697
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 23:24:30 -07:00
David Tolnay
cbe9be0b20 edition: Update bit_field and bit_field_derive to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Ie62d28d63257e59e6bee68b5c42a1f4cf7b47bed
Reviewed-on: https://chromium-review.googlesource.com/1519690
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 23:24:29 -07:00
David Tolnay
021e975f46 edition: Update virtio_sys to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I4174e80c92d249a0ba0ef6e530a1c8a45cc12a20
Reviewed-on: https://chromium-review.googlesource.com/1520073
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 23:24:29 -07:00
David Tolnay
f214d4066a edition: Update resources crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I87103777763ab9c00e6053605c5168f43243fc25
Reviewed-on: https://chromium-review.googlesource.com/1520066
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 23:24:28 -07:00
David Tolnay
fa08830758 edition: Update rand_ish crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Ibbb85c0b705adadc9cfd671a16f48dd29643acee
Reviewed-on: https://chromium-review.googlesource.com/1519705
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 23:24:28 -07:00
David Tolnay
c69ee11e1d edition: Update fuzz crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I355014ebd08bc2a655e1a1bbff56ecc90aa99ece
Reviewed-on: https://chromium-review.googlesource.com/1519695
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 23:24:27 -07:00
David Tolnay
3c98abdfc8 edition: Update data_model to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I0be8781e7fa5ee0d9cbd5b4ff68b3218d82ba49d
Reviewed-on: https://chromium-review.googlesource.com/1519692
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 23:24:26 -07:00
David Tolnay
6590e9b8b9 kokoro: Install dbus-1 and dbus protos
The trunks interface.proto will be required for the TPM device to
communicate TPM commands to the Trunks daemon and receive back TPM
responses.

BUG=chromium:911799
TEST=kokoro with and without CL:1554982

Change-Id: I557d38172767137c20a108275e0157d9b1f687e6
Reviewed-on: https://chromium-review.googlesource.com/1554879
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-04-07 16:31:18 -07:00
David Tolnay
0b902e68d7 edition: Update net_sys and net_util to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Ibb78b8254693a68a55780ebea3e895c146a14119
Reviewed-on: https://chromium-review.googlesource.com/1519701
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 16:31:17 -07:00
David Tolnay
79e1a26532 edition: Update syscall_defines to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I1b2dbbf9ba57dae7f7192122c9494746dd34c5fd
Reviewed-on: https://chromium-review.googlesource.com/1520068
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 16:31:17 -07:00
David Tolnay
0a367518b6 edition: Update x86_64 crate to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Iec5cc762f38f18196a6147473ac093f474b00794
Reviewed-on: https://chromium-review.googlesource.com/1520075
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-07 06:34:18 -07:00
Zach Reizner
2a2e2587b1 rand_ish: prevent spaces in urandom_str and use uniform samples only
TEST=cargo test -p rand_ish
BUG=None

Change-Id: I8e91be856c3bc9148dc373c7bc2cf6c8731cb0d3
Reviewed-on: https://chromium-review.googlesource.com/1553563
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Daniel Prilik <prilik@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-05 03:53:19 -07:00
Daniel Prilik
0b3a4af105 msg_socket: derive MsgOnSocket for bool
BUG=chromium:936567
TEST=cargo test -p msg_socket

Change-Id: I5f9228ceaa7a3fcfbe154bf173a76e0ee26b8c50
Reviewed-on: https://chromium-review.googlesource.com/1548694
Commit-Ready: Daniel Prilik <prilik@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-04-04 15:11:04 -07:00
Miriam Zimmerman
e8243e326a Add PIC device.
The PIC device that this commit provides isn't quite complete: It needs to
interact with a userspace APIC in order to properly route interrupts,
but crosvm does not yet have a userspace APIC. In the interest of not
making this CL too much larger, the userspace APIC implementation will
come in a future CL.

BUG=chromium:908689
TEST=Unit tests in file. Integration testing is blocked on rest of split-irqchip being implemented.

Change-Id: Id1f23da12fa7b83511a2a4df895b0cfacdbc559e
Reviewed-on: https://chromium-review.googlesource.com/1475057
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Miriam Zimmerman <mutexlox@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-04-03 18:14:09 -07:00
David Riley
ef495df7c1 devices: gpu: Silently accept empty command buffers.
Prior to this change empty command buffers would generate errors and syslogs.

BUG=None
TEST=glbench nop_virtgpu_execbuffer test

Change-Id: I456fb342c945beebe121e22543bd93fe41cc5cbe
Reviewed-on: https://chromium-review.googlesource.com/1532796
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-04-03 18:14:05 -07:00
Daniel Verkamp
32773f6037 rustfmt our tempdir crate
This isn't included when running cargo fmt --all or bin/fmt, so it
slipped past.

BUG=None
TEST=rustfmt --check tempdir/src/lib.rs

Change-Id: Ie2433704fcccfb1e74f05e403deae5731186bd6d
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1542679
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2019-04-03 18:14:04 -07:00
Dylan Reid
b6b84db042 sys_util: sock_ctrl_msg: Make clippy clean
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: I1a81590b5bf80dce7d35a6005fff66ed45a2ebe6
Reviewed-on: https://chromium-review.googlesource.com/1510434
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-04-03 18:14:03 -07:00
Jingkui Wang
1612ff7a83 improve bitfield type safety by allowing tuple struct field
user-defined tuple struct could be used to improve type safety.

TEST=cargo test
BUG=None

Change-Id: I8ce10fc51b79c277ab23029513b707f3dd621af5
Reviewed-on: https://chromium-review.googlesource.com/1546432
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-03 18:13:52 -07:00
Jingkui Wang
6bfc6a0304 fix endpoint id in set tr dequeue pointer
We were lucky that adb does not trigger this code path, but Arduino do.

BUG=None
TEST=local build, deploy and run

Change-Id: I0cf02c5de0a73af4e5cb6f5b668cef6606ed166b
Reviewed-on: https://chromium-review.googlesource.com/1542032
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-03-30 02:53:02 -07:00
Daniel Verkamp
e6c6cc908e devices: block: report block size in config
Set up the infrastructure for reporting block size in the virtio-blk
device model.  For now, we'll keep reporting SECTOR_SIZE (512), which is
the default block size that is assumed if we don't report it.  This
prepares us to easily switch the reported block size in the future.

BUG=chromium:942700
TEST=Boot Crostini on nami with an existing VM and container

Change-Id: I983817743c40e8278fe6cb9a10498011a8887ec9
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1526334
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-03-28 19:04:10 -07:00
Jingkui Wang
85fa41f7b2 implement bitfield for enum with a width
If we know the width of an enum type, we don't need 'power of 2' number
of variants.

BUG=None
TEST=cargo test

Change-Id: I8148b28f86bb8e4fd4f67d8a6382fc713dad1439
Reviewed-on: https://chromium-review.googlesource.com/1530455
Commit-Ready: Jingkui Wang <jkwang@google.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-03-28 19:04:03 -07:00
Jingkui Wang
ca224cd547 Change default field type to setter/getter types and remove generated
tests

Setter/Getter types will allow better enum fields.
Generated tests should be tests for bit_field cargo rather than the
defined bit_field struct.

BUG=None
TEST=cargo test

Change-Id: Ib3594e35e28fc393d49c476c9c83fc632cac3190
Reviewed-on: https://chromium-review.googlesource.com/1530454
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-03-28 11:17:29 -07:00
Jorge E. Moreira
96e26c2681 Validate and configure tap interfaces from --tap_fd
Checks for the IFF_NO_PI and IFF_VNET_HDR flags, failing if those are
not set.
Sets the offload and vnet header sizes to the required values, instead
of trusting the values on the interface.

Bug=b/128686192

Change-Id: Ibbbfbf3cdedd6e64cdcfb446bcdfb26b4fd38395
Reviewed-on: https://chromium-review.googlesource.com/1526771
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
2019-03-28 11:17:26 -07:00
Dylan Reid
788d0de96a sys_util: ioctl: Make clippy clean
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: Ic01c67f12be6b76887796beb73d1bd82077b87b3
Reviewed-on: https://chromium-review.googlesource.com/1510433
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-03-28 11:17:13 -07:00
Dylan Reid
681d1ff584 sys_util: clock: Make clippy clean
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: I321af88908e14af08886fdfe5191bde5335c247a
Reviewed-on: https://chromium-review.googlesource.com/1510432
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-03-28 11:17:12 -07:00
Daniel Prilik
b3d382c942 pci: match pci cap structs with linux/virtio_pci.h
VirtioPciCap omits the `cap_vndr` and `cap_next` fields from it's
definition, deferring the instantiation of these bytes to the
add_capability method in PCI configuration. There is even a
comment on add_capability that mentions this omission.

Unfortunately, comments tend not to be read, and mismatches between
the linux headers and crosvm structures can result in some subtle
and tricky to debug bugs, especially when implementing other types
of virtio capabilties that subsume VirtioPciCap.

Case in point, when implementing the VirtioPciShmCap (used by
virtio-fs), this subtle mismatch resulted in a bug where an
additional 2 bytes of padding were inserted between the `cap` member
and the `offset_hi` member (see CL:1493014 for the exact struct).
Since the cap_len field was instantiated using mem::sizeof Self, the
additional padding just-so-happened to be the perfect ammount to sneak
past the sanity checks in add_capabilities. The bug manifested itself by
shifting over the length_hi field by 16 bits, resulting in much larger
than expected cache sizes.

This CL brings the VirtioPciCap structures in-line with their
linux/virtio_pci.h counterparts, marking the structures as repr(C) (as
opposed to repr(packed)) and leaving the cap_vndr and cap_next members
in the struct, noting that they will be automatically populated in
add_capability.

BUG=chromium:936567
TEST=cargo test -p devices, boot vm

Change-Id: Ia360e532b58070372a52346e85dd4e30e81ace7a
Reviewed-on: https://chromium-review.googlesource.com/1540397
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2019-03-28 11:17:09 -07:00
Daniel Prilik
45b3ed437d devices: improve get_device_bars/caps interface
Removes an unnecessary Option from the return type.

Also added a note about moving PCI methods out of the VirtioDevice
trait, as the trait shouldn't be tied to any particular transport layer.

BUG=chromium:936567
TEST=cargo build --features=gpu

Change-Id: I2c75c830bbe2d2b4a15461e8497535c526775bbe
Reviewed-on: https://chromium-review.googlesource.com/1536206
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-03-28 11:17:08 -07:00
Dylan Reid
3d00b70eb5 Revert "qcow_utils: Add tests"
This test breaks the asan builders

BUG=945423

This reverts commit fbbcf7ad14.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: I4db9720118ea6e3002045fad997774ab84d3b59a
Reviewed-on: https://chromium-review.googlesource.com/1540339
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
2019-03-28 02:11:02 -07:00
Dylan Reid
cb5573ba19 sys_util: net: Make clippy clean
Use from instead of as.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: I02342bd352cd98417011ceb5a79ba5bde5551a07
Reviewed-on: https://chromium-review.googlesource.com/1510071
Tested-by: kokoro <noreply+kokoro@google.com>
2019-03-26 21:45:35 -07:00
Gurchetan Singh
5aaa63f508 devices: gpu: use render optimized buffers
Using non-linear buffer seems to be safe based on the apps I've
tested. This is similiar to the ARC++ use case, which also doesn't
explicitly send modifiers to Chrome.

BUG=chromium:945033
TEST=clear_clear goes from 980 mpixels --> 6797.90 mpixels
     on Nami

Change-Id: I2dcb78366c2d2d83d64bb23f6da1f07c8747819c
Reviewed-on: https://chromium-review.googlesource.com/1538463
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2019-03-26 17:27:02 -07:00
Dylan Reid
348df2dbf7 sys_util: shm: Make clippy clean
clippy wants a default impl for `MemfdSeals`

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: I3202037f7b82d7d4e63154a349c505fd7707bb9a
Reviewed-on: https://chromium-review.googlesource.com/1510070
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-03-26 17:26:58 -07:00