summary refs log tree commit diff
path: root/aarch64
Commit message (Collapse)AuthorAge
* devices: remove user_command from proxy deviceZach Reizner2020-01-09
| | | | | | | | | | | | | | | | | | The only device that used user_command was Serial. This change makes Serial device use a thread to read from its input instead of using user_command. BUG=chromium:1033787 TEST=./build_test run crosvm with stdio serial with and without sandbox Change-Id: Ia0f2ee83d94ad2fee3f1f4f89aa734b976e33507 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1966435 Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org> Auto-Submit: Zach Reizner <zachr@chromium.org>
* aarch64: use gicv3 when availableStephen Boyd2019-12-06
| | | | | | | | | | | | BUG=chromium:1028450 TEST=tast run -build=false crostini.LaunchTerminal Change-Id: Ibe3adbe5a86dda42d323632ed14f8dccc283a62e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1934894 Reviewed-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Stephen Barber <smbarber@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* resource: Rename device memory to mmioXiong Zhang2019-11-10
| | | | | | | | | | | | | | Since unified allocator is used to allocate mmio, this patch remove the device memory name, and rename device to mmio. BUG=chromium:992270 TEST=this patch doesn't change function, run build_test Change-Id: I234b0db4b3c5de8cfee372ace5212a980564d0c7 Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1895234 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* arch: replace is_some + unwrap with `if let`Daniel Verkamp2019-11-08
| | | | | | | | | | | BUG=None TEST=emerge-kevin crosvm Change-Id: I78aa9f4fb4fb46de3394bb9bc2fa5a53e210fa0b Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1896085 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* devices: jail serial deviceZach Reizner2019-10-10
| | | | | | | | | | | | | | | | | | This change plumbs the jail throughout the arch specific device creation process. It also adds a custom callback support for the ProxyDevice so that the main process can interrupt the child serial process when it has incoming bytes. TEST=crosvm run BUG=None Change-Id: I6af7d2cb0acbba9bf42eaeeb294cee2bce4a1f36 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1752589 Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org>
* crosvm: virtio-pmem deviceJakub Staron2019-06-05
| | | | | | | | | | | | | | | | | | | | Adds support for virtio-pmem device as an alternative for virtio-blk. Exposing disk image to guest as virtio-blk device results in both guest and host independently caching the disk I/O. Using virtio-pmem device allows to mount disk image as direct access (DAX) in the guest and thus bypass the guest cache. This will reduce memory foodprint of the VMs. BUG=None TEST=cargo test TEST=Boot patched termina kernel in crosvm; mount virtio-pmem device as DAX and run xfstests. Change-Id: I935fc8fc7527f79e5169f07ec7927e4ea4fa6027 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1605517 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Jakub Staroń <jstaron@google.com>
* Initial BIOS support.Cody Schuffelen2019-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --bios argument is added as an alternative to the kernel positional argument. The BIOS runs in unreal mode (16-bit cs selector set to the end of 32-bit address space), which matches the default state KVM puts the segment and data registers into. Example usage: Build u-boot with "make qemu-x86_defconfig && make" Run crosvm with "crosvm_wrapper.sh run --bios=u-boot.rom" This produces the following message: """ U-Boot 2019.01-00017-gdc76aabe6a-dirty (May 21 2019 - 12:17:02 -0700) CPU: DRAM: 16 MiB unable to get online cpu number: -19 Warning: MP init failure Model: QEMU x86 (I440FX) Net: No ethernet found. error: can't find etc/table-loader Hit any key to stop autoboot: 0 => """ At this point the u-boot shell works with stdin/stdout, but virtual disks passed with --rwdisk weren't immediately visible from running "virtio scan" and "virtio info". This change puts the bios loading together with the linux kernel loading code since there is a lot of overlap in functionality. Bug: b/133358982 Test: ./crosvm_wrapper.sh run --mem=4097 --bios=u-boot.rom Change-Id: I65b0e1044233af662a642c592d35b106217f3c13 Reviewed-on: https://chromium-review.googlesource.com/1622648 Commit-Ready: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* aarch64: use 64-bit memory space for PCI MMIO rangeDaniel Verkamp2019-05-23
| | | | | | | | | | | | | | | | | This makes the PCI root bridge's MMIO range consistent with the newly-added device memory range. We already fill out the full 64-bit address/size fields, so we might as well use the corresponding bus range type. BUG=None TEST=boot termina on kevin Change-Id: I9ecad38c76dac764853c6232cc486cfc7737a269 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1579327 Tested-by: kokoro <noreply+kokoro@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* aarch64: add DT entries for multiple serial portsDaniel Verkamp2019-05-23
| | | | | | | | | | | | | | | Add device tree entries for all four serial ports to make arm match the x86_64 behavior. BUG=chromium:953983 TEST=`echo test > /dev/ttyS1` etc. from termina on kevin Change-Id: I334f7ad3e2ee9bc2599b0e8195e51140e8001e51 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1620893 Tested-by: kokoro <noreply+kokoro@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: add cmdline flags for configuring serial outputs in guest machineTrent Begin2019-05-15
| | | | | | | | | | | | | | | | This change allows an output to be set for each serial device for a guest machine (stdout, syslog, or sink). BUG=chromium:953983 TEST=FEATURES=test emerge-sarien crosvm; cd sys_util; cargo test; ./build_test; manual testing on x86_64 and aarch_64 Change-Id: I9e7fcb0b296c0f8a5aa8d54b1a74ae801f6badc8 Reviewed-on: https://chromium-review.googlesource.com/1572813 Commit-Ready: Trent Begin <tbegin@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Trent Begin <tbegin@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* aarch64: make Android fstab optionalDaniel Verkamp2019-05-07
| | | | | | | | | | | | | | | | Always build the device tree, even if the Android fstab isn't specified. Device tree is always required for Arm boards, unlike x86, where the device tree is only needed for Android booting. BUG=chromium:959921 TEST=Start Crostini on kevin Change-Id: Ib775511786286200f4bfa360f9675a59451bb048 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1597348 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Greg Hartman <ghartman@google.com>
* Add Android fstab support to aarch64, based on x86_64 versionGreg Hartman2019-05-02
| | | | | | | | | | | Test: cargo test on x86_64 and aarch64, boot on aarch64 Change-Id: I29fb269abedaaca4168581aa7f92d413d51e9232 Reviewed-on: https://chromium-review.googlesource.com/1585279 Commit-Ready: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Greg Hartman <ghartman@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Greg Hartman <ghartman@google.com>
* crosvm: Fix misleading field name in VmComponents struct.Jakub Staron2019-04-29
| | | | | | | | | | | | | | | Renames field memory_mb to memory_size. All usages of this field treat it as a memory size in bytes, not megabytes. BUG=None TEST=cargo check TEST=cargo check --package aarch64 --target aarch64-unknown-linux-gnu Change-Id: I7b1aefe4f0b612d5eeb2987dc2a0fce6db0dd228 Reviewed-on: https://chromium-review.googlesource.com/1585617 Commit-Ready: Jakub Staroń <jstaron@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* aarch64: add PCI device memory region to fdtDaniel Prilik2019-04-22
| | | | | | | | | | | | | | | | | | | The device memory SystemAllocator allocates device addresses past the end of physical memory. If a device tries to actually use this address to register a new PCI BAR, the kernel will fail with a "can't claim BAR, no compatible bridge window" error. On ARM, the kernel must be informed of where PCI bars are allowed to be allocated through the Device Tree. This CL adds a new PCI memory region to the fdt for device memory. BUG=chromium:936567 TEST=see CL:1493014. Run on ARM. Change-Id: I0faa6f7082ae53f7a792cec53a21adba109bc00d Reviewed-on: https://chromium-review.googlesource.com/1558940 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* clippy: Iterate without calling .iter()David Tolnay2019-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | See: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop https://rust-lang.github.io/rust-clippy/master/index.html#explicit_into_iter_loop Before: for element in slice.iter() {...} After: for element in slice {...} TEST=grep -r '\.iter() {' TEST=grep -r '\.iter_mut() {' TEST=grep -r '\.into_iter() {' TEST=cargo check --all-features TEST=local kokoro Change-Id: I27f0df7cfa1064b2c8b162cba263513926a433a9 Reviewed-on: https://chromium-review.googlesource.com/1568525 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>
* resources: add build method to SystemAllocatorDaniel Prilik2019-04-17
| | | | | | | | | | | | | | | | | | AddressRanges' name doesn't suggest that it's a SystemAllocator builder. This CL renames it to SystemAllocatorBuilder, and adds a SystemAllocator::builder() that removes the need to have a separate import for the Builder. A minor change, but it cleans up the interface a bit. BUG=chromium:936567 TEST=cargo test -p resources && cargo build Change-Id: I6d14368490c0d3c4018858f541e4ae5390995878 Reviewed-on: https://chromium-review.googlesource.com/1540398 Commit-Ready: Daniel Prilik <prilik@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* edition: Remove extern crate linesDavid Tolnay2019-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Rust 2018 edition, `extern crate` is no longer required for importing from other crates. Instead of writing: extern crate dep; use dep::Thing; we write: use dep::Thing; In this approach, macros are imported individually from the declaring crate rather than through #[macro_use]. Before: #[macro_use] extern crate sys_util; After: use sys_util::{debug, error}; The only place that `extern crate` continues to be required is in importing the compiler's proc_macro API into a procedural macro crate. This will hopefully be fixed in a future Rust release. extern crate proc_macro; TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=local kokoro Change-Id: I0b43768c0d81f2a250b1959fb97ba35cbac56293 Reviewed-on: https://chromium-review.googlesource.com/1565302 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>
* lints: Enforce sorted order for enum variantsDavid Tolnay2019-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | To avoid wasting time re-sorting these things (CL:1492612). https://docs.rs/remain Disclaimer: I wrote the macro. This CL adds #[sorted] attributes to those Error enums that seemed to have made some effort to be in sorted order. TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=emerge-nami crosvm TEST=local kokoro CQ-DEPEND=CL:1524247 Change-Id: I89685ced05e2f149fa189ca509bc14c70aebb531 Reviewed-on: https://chromium-review.googlesource.com/1515998 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>
* main: add --cpu-affinity option to pin VCPUsDaniel Verkamp2019-04-09
| | | | | | | | | | | | | | | | | | This allows setting the affinity of the VCPU threads to specific host CPUs. Note that each individual CPU has its affinity set to the full set of CPUs specified, so the host kernel may still reschedule VCPU threads on whichever host CPUs it sees fit (within the specified set). BUG=chromium:909793 TEST=build_test Change-Id: I09b893901caf91368b64f5329a6e9f39027fef23 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1554865 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> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* cargo: Sort all dependency lists in Cargo.tomlDavid Tolnay2019-04-09
| | | | | | | | | | | | | | | 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>
* edition: Update aarch64 crate to 2018 editionDavid Tolnay2019-04-08
| | | | | | | | | | | | | | | | | | 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>
* edition: Use dyn syntax for trait objectsDavid Tolnay2019-04-08
| | | | | | | | | | | | | | | | | | | | | 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>
* edition: Update absolute paths to 2018 styleDavid Tolnay2019-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | This is an easy step toward adopting 2018 edition eventually, and will make any future CL that sets `edition = "2018"` this much smaller. The module system changes in Rust 2018 are described here: https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html Generated by running: cargo fix --edition --all in each workspace, followed by bin/fmt. TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu Change-Id: I000ab5e69d69aa222c272fae899464bbaf65f6d8 Reviewed-on: https://chromium-review.googlesource.com/1513054 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>
* arch: Replace Box<dyn Error> with error enumDavid Tolnay2019-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoiding Box<dyn Error> makes it less likely that we display errors with insufficient context by accident. Many of the errors touched in this CL already had helpful message written! But those corresponding enum variants were never being instantiated, and that bug was masked by Box<dyn Error>. For example see the Error::LoadCmdline and Error::LoadKernel. pub enum Error { LoadCmdline(kernel_loader::Error), ... } Before this CL: // Bug: boxes the underlying error without adding LoadCmdline kernel_loader::load_cmdline(...)?; After this CL: kernel_loader::load_cmdline(...).map_err(Error::LoadCmdline)?; TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu Change-Id: I7c0cff843c2211565226b9dfb4142ad6b7fa15ac Reviewed-on: https://chromium-review.googlesource.com/1502112 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: Zach Reizner <zachr@chromium.org>
* linux: use panic=-1 to reboot immediately on panicDaniel Verkamp2019-03-05
| | | | | | | | | | | | | | | | | | | | This changes the default Linux kernel command line from panic=1 (reboot one second after panic) to panic=-1 (reboot immediately on panic). The kernel should not normally panic; this is just to improve quality of life for developer workflows, such as running bash as init and exiting the shell to shut down the VM. BUG=None TEST=crosvm run -r vm_rootfs.img -p init=/bin/bash vm_kernel; exit shell Change-Id: I7c9084ccf1786cd4455fd748512078e02fdb17fa Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1500872 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> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* make aarch64 pci dma-coherentJingkui Wang2019-03-03
| | | | | | | | | | | | | | | | | On arm, if the device is not coherent, guest kernel will allocate dma memory as no-cacheable. Crosvm on the host user space thinks the memory is cacheable. Thus when guest kernel write to dma memory, it will bypass the cache, crosvm won't see the change. BUG=None TEST=local build and test Change-Id: If6cf2d28afec61d5beb136628116ff9e7e0483f4 Reviewed-on: https://chromium-review.googlesource.com/1497739 Commit-Ready: Jingkui Wang <jkwang@google.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* error: Consistently use Display instead of error description()David Tolnay2019-03-02
| | | | | | | | | | | | | | | | The description method is deprecated and its signature forces less helpful error messages than what Display can provide. BUG=none TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu Change-Id: I27fc99d59d0ef457c5273dc53e4c563ef439c2c0 Reviewed-on: https://chromium-review.googlesource.com/1497735 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* linux: rename function of device creationJianxun Zhang2019-03-01
| | | | | | | | | | | | | | | | | Rename functions and parameters that had 'virtio' in their names because we also create non-virtio devices like audio. BUG=none TEST=emerge-eve crosvm and deploy it to the device, verify some of devices are still created at /sys/bus/virtio/devices/ Change-Id: I3ea75159a865e5f00ecef349725b3c12f94afaca Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1480739 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> Reviewed-by: Zach Reizner <zachr@chromium.org>
* linux: add support for loading an initrdDaniel Verkamp2019-02-07
| | | | | | | | | | | | | | Based on Linux boot protocol references: - x86: Documentation/x86/boot.txt - arm: Documentation/devicetree/bindings/chosen.txt BUG=None TEST=Boot Alpine Linux netboot initrd on x86_64 and aarch64 Change-Id: If4730765638f0a0b8bb8f63203c98e4765a354ee Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1407221 Tested-by: kokoro <noreply+kokoro@google.com>
* Add logic to set up PIT (guarded by flag).Miriam Zimmerman2019-02-06
| | | | | | | | | | | | BUG=chromium:908689 TEST=None Change-Id: I625bab235f740d1d2ae256de61a25d560025b751 Reviewed-on: https://chromium-review.googlesource.com/1444501 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>
* crosvm: x86_64 guest support for android device-treeTristan Muntsinger2019-01-28
| | | | | | | | | | | | | | | | This device tree is derived from the Android fstab file which is provided via command line flag. BUG=chromium:922737 TEST=None CQ-DEPEND=CL:1415390 CQ-DEPEND=CL:1415270 Change-Id: Idd007c844f84cab3ff37be16a718f14e5f630312 Reviewed-on: https://chromium-review.googlesource.com/1370058 Commit-Ready: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* crosvm: add debug labels to devices for improved SIGCHLD logsZach Reizner2019-01-26
| | | | | | | | | | | | | | | | | | | Each device (Bus, Pci, Proxy, etc), gets a debug label associated with it. When a child is spawned, the debug label for it is stored in a map with the child's pid as the key. If a SIGCHLD is handled, this map is used to print a more helpful message about exactly which child died. BUG=None TEST=run with sandboxing and a faulty child device check logs for message about child died the child should have a debug label Change-Id: I61fbbee0a8e701249533a7a3a6a1ad48840f12e5 Reviewed-on: https://chromium-review.googlesource.com/1432835 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* arch: add generic image loading functionDaniel Verkamp2019-01-18
| | | | | | | | | | | | | | Factor out the common parts of kernel loading code from x86_64 and aarch64. This will be used to load initrds as well. BUG=None TEST=Boot termina on kevin Change-Id: I0f61fdaf1067311d25393e8d64340f570f5a6ed7 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1407220 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* memory: Add methods to return error on short writes and readsDavid Tolnay2019-01-13
| | | | | | | | | | | | | | | | | | | | Add GuestMemory::write_all_at_addr, GuestMemory::read_exact_at_addr which return error if the entire write or read cannot be completed. Also rename write_slice_at_addr to write_at_addr, read_slice_at_addr to read_at_addr to make the entire set of four methods consistent in naming with the methods of std::io::Write and std::io::Read. Context: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1387624/16/devices/src/virtio/tpm.rs#75 TEST=cargo test Change-Id: Ia0775b75281ccf8030c84b41f9018a511204b8c9 Reviewed-on: https://chromium-review.googlesource.com/1407156 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* toolchain: Update to Rust 1.31.0David Tolnay2018-12-13
| | | | | | | | | | | | | | | | | | We updated the production toolchain from 1.30 to 1.31 in CL:1366446. This CL does the same upgrade for the local developer toolchain and Kokoro. The relevant changes are in rust-toolchain and kokoro/Dockerfile. The rest are from rustfmt. TEST=cargo fmt --all -- --check TEST=as described in kokoro/README.md Change-Id: I3b4913f3e237baa36c664b4953be360c09efffd4 Reviewed-on: https://chromium-review.googlesource.com/1374376 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* sync: Mutex type with methods that panic instead of return errorDavid Tolnay2018-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a crate `sync` containing a type sync::Mutex which wraps the standard library Mutex and mirrors the same methods, except that they panic where the standard library would return a PoisonError. This API codifies our error handling strategy around poisoned mutexes in crosvm. - Crosvm releases are built with panic=abort so poisoning never occurs. A panic while a mutex is held (or ever) takes down the entire process. Thus we would like for code not to have to consider the possibility of poison. - We could ask developers to always write `.lock().unwrap()` on a standard library mutex. However, we would like to stigmatize the use of unwrap. It is confusing to permit unwrap but only on mutex lock results. During code review it may not always be obvious whether a particular unwrap is unwrapping a mutex lock result or a different error that should be handled in a more principled way. Developers should feel free to use sync::Mutex anywhere in crosvm that they would otherwise be using std::sync::Mutex. TEST=boot linux Change-Id: I9727b6f8fee439edb4a8d52cf19d59acf04d990f Reviewed-on: https://chromium-review.googlesource.com/1359923 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* aarch64: report PCI interrupts as level triggeredDaniel Verkamp2018-11-16
| | | | | | | | | | | | This matches the x86 mptable change from commit ac242df107de. BUG=None TEST=Boot termina on kevin Change-Id: I370419f3edc1271df4ae7cdbe4b35241945c2757 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1333942 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* devices: virtio: remove virtio MMIO transportDaniel Verkamp2018-10-31
| | | | | | | | | | | | All devices have been converted to PCI, so we don't need MmioDevice. BUG=chromium:854766 TEST=Boot crosvm on kevin and verify virtio devices still work Change-Id: Ib6400e15bdb2153d14795de3cb0bfbf1845a8891 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1281832 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* aarch64: remove unused UnixDatagram importDaniel Verkamp2018-10-23
| | | | | | | | | | | BUG=None TEST=emerge-kevin crosvm Change-Id: I0d0197002d1d048a19139da9a11f6426c55f7f87 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1295349 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* devices: make PCI work in --disable-sandbox modeDaniel Verkamp2018-10-19
| | | | | | | | | | | | | Make the Minijail part of the PCI device tuple optional so that an empty jail is not created for --disable-sandbox. BUG=None TEST=Boot crosvm in both --multiprocess and --disable-sandbox modes Change-Id: Ibb3f2dbf33ca19910ee7448ea823b2772e09ecc5 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1290289 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* cargo fmt aarch64 and kvmDaniel Verkamp2018-10-18
| | | | | | | | | | | | | | A few non-rustfmt changes slipped in since the tree-wide formatting pass. BUG=None TEST=Re-run `cargo fmt` and verify that it makes no further changes. Change-Id: Ic5afb20dabc1087e5d6f54862e6b8b47c5f5608d Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1287369 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* aarch64: remove reboot=k kernel cmdline optionDaniel Verkamp2018-10-12
| | | | | | | | | | | | | | | The "reboot" option is specific to x86 (reboot=k forces use of the i8042 keyboard controller to initiate a reset). Remove the unnecessary option from the aarch64 command line. BUG=None TEST=Stop and restart VM on Kevin Change-Id: Ic91c9a03491a6620d6f88ea0ada12f637f402840 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1279268 Reviewed-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* Revert "Revert "linux: Convert all virtio devices to PCI""Daniel Verkamp2018-10-12
| | | | | | | | | | | | | | This reverts commit c8986f14a8dd9f256d6faed55996d955b50ff923. Re-land the virtio PCI conversion after the preceding fixes. BUG=chromium:854766 TEST=Boot crosvm on nami and kevin Change-Id: I3699e3ed1a45cecc99c51e352d0cf0c32bc4116f Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1265862 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* aarch64: add arm serial input supportSonny Rao2018-10-12
| | | | | | | | | | | | Wire up the serial device interrupt on aarch64 so stdin works. BUG=chromium:890956 TEST=Verify serial console works on kevin Change-Id: Ifcafecb10d443f0100f047d0a2ec545c24e718af Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1115728 Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
* cargo fmt all source codeZach Reizner2018-10-09
| | | | | | | | | | | | | | Now that cargo fmt has landed, run it over everything at once to bring rust source to the standard formatting. TEST=cargo test BUG=None Change-Id: Ic95a48725e5a40dcbd33ba6d5aef2bd01e91865b Reviewed-on: https://chromium-review.googlesource.com/1259287 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* Revert "linux: Convert all virtio devices to PCI"Daniel Verkamp2018-10-04
| | | | | | | | | | | | | | | This reverts commit d635acbaf348c0863bc05b8f889b2fa5f8156aaa. This commit seems to be responsible for introducing hung tasks in tests, so let's revert it for now to get the tests green and debug it offline. BUG=chromium:891806 TEST=None Change-Id: I83504058baeae00909d9fb4f4bb704a144a0dfaf Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1259408 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* linux: Convert all virtio devices to PCIDaniel Verkamp2018-10-02
| | | | | | | | | | | | | Change the main create_virtio_devs() function to create virtio devices using the PCI transport rather than MMIO. BUG=chromium:854766 TEST=Boot crosvm and verify that all virtio devices still work Change-Id: I9a6e60b21edea1e5ac2b3ae5c91793d45cf5063a Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1241541 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* aarch64: add generic PCI host controllerDaniel Verkamp2018-10-01
| | | | | | | | | | | | | | Implement the generic PCI host as supported by Linux and described in Documentation/devicetree/bindings/pci/host-generic-pci.txt in the kernel source tree. Also increase the ARM64 MMIO region size from 0x10000 to 0x100000 to allow enough space for several virtio PCI devices. Change-Id: I2f0a9b04356cce912874a06e62b4f3a59cbb08f1 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1244398 Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
* devices: pci: add ioeventfds to PciDevice traitDylan Reid2018-10-01
| | | | | | | | | | | | VirtioDevices and potentially others need to register ioeventfds that will be triggered when guests write to certain addresses. Allow PciDevices to return an array of ioeventfds that the VM can install. Change-Id: I2524c4e8c04f75a8d7868cac998304aecbb29c40 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1237360 Commit-Ready: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org>
* move pci root creation to archDylan Reid2018-10-01
| | | | | | | | | | passing everything in to the pci code is getting annoying. Instead build it up in arch which already has access to all the needed resources. Change-Id: If42f994443c4f11152fca8da16f27fa4cd80580d Reviewed-on: https://chromium-review.googlesource.com/1237357 Commit-Ready: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>