summary refs log tree commit diff
Commit message (Collapse)AuthorAge
...
| * devices: fs: Refactor ioctl handling codeChirantan Ekbote2020-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the ioctl number method is const we can use a match statement rather than a series of if-else expressions. BUG=b:157189438 TEST=unit tests Change-Id: I9839f2de842ec512811101c07445ca5f99f3fe2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2214963 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
| * sys_util: Make ioctl number method a const fnChirantan Ekbote2020-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to define const variables that are the return value of the method, which we can then use in match statements. BUG=b:157189438 TEST=unit tests Change-Id: I2475c59bfd43ec9ec149a6b688bf680fa2361a0b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2214962 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
| * msg_socket: implement MsgOnSocket for Vec and tuplesZach Reizner2020-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These container types are similar to arrays except tuples have heterogeneous data types and Vec has a dynamic number of elements. BUG=None TEST=cargo test -p msg_socket Change-Id: I2cbbaeb7f13b7700294ac50751530510098ba16d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2168588 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org>
| * hypervisor: add get/set_pvclockSteven Richman2020-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clock functions on the Vm trait are for any arch, to support hypervisors that might have ARM pv clocks. The KVM implementation (x86 only) is mostly the same as before, but uses a hypervisor-agnostic ClockState struct instead of the KVM struct. BUG=chromium:1077058 TEST=cargo test -p hypervisor Change-Id: I0e77ae997d6a30851d28aeb5f73c9ef8ebc464a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2202742 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Steven Richman <srichman@google.com>
| * docker: update ADHD checkout for BoxErrorDaniel Verkamp2020-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes missing BoxError references and clippy errors. BUG=None TEST=docker/build_crosvm_base.sh && docker/wrapped_smoke_test.sh Change-Id: Icba02a1e1284cce6b40555fad86aecaf7956aa30 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2224775 Tested-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
* | seccomp: allow getdents64 if getdents is allowedAlyssa Ross2020-06-14
| | | | | | | | | | | | | | | | | | | | This fixes a crash where crosvm would crash if run on x86_64 with --shared-dir when running ls in the shared directory. I suspect whether getdents or getdents64 is used depends on the host libc, so allow both of them. I suspect upstream's libc uses getdents, and that's why they haven't fixed the problem. Message-Id: <20200605234757.28848-1-hi@alyssa.is>
* | Merge remote-tracking branch 'origin/master'Alyssa Ross2020-06-14
|\|
| * acpi: support user provided ACPI SDTs.Tomasz Jeznach2020-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable support for user provided ACPI tables with supplementary system description. Argument --acpi-table shall point to exsting file or pseudo-file with valid ACPI table content. BUG=None TEST=boot Linux kernel with generated SSDT tables. Change-Id: I8eac21da070dcc325884ed888cc7bcb01bc086ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2212501 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Tomasz Jeznach <tjeznach@chromium.org> Commit-Queue: Tomasz Jeznach <tjeznach@chromium.org>
| * pci: ac97: Fix unused import warningDylan Reid2020-06-01
| | | | | | | | | | | | | | | | | | | | The Error type is not used, remove it. Change-Id: Ibcc1328b62635dd62a666412eb0f56a8c2f4fc93 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2224013 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org>
| * ac97: Uses audio_streams::BoxErrorJudy Hsiao2020-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | audio_streams export BoxError which can be passed between threads. Adopts the API change accordingly. BUG=b:149437381 TEST=emerge-{BOARD} crosvm Cq-Depend: chromium:2215772 Change-Id: I524e9d7ab3c16b7b6d3714187f166dce72d243cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2214971 Tested-by: Judy Hsiao <judyhsiao@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Judy Hsiao <judyhsiao@chromium.org>
| * resources: release support for address_allocatorTomasz Jeznach2020-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for address_allocator by-alloc release. Address regions coalescing is performed at the release time. BUG=None TEST=cargo test -p resources && tast test vm.* Change-Id: Ibd39dac923d1b2f8b6a711d2a9fcbb662fc95bdc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2209171 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Tomasz Jeznach <tjeznach@chromium.org>
| * arch: serial: open file outputs for appendDaniel Verkamp2020-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When opening the same output file for two serial devices (earlycon and console), the output would be overwritten by the later device. Change the file creation to use append mode so that the output file contains all of the logs from both devices instead of overwriting it. Tested with: crosvm run \ --serial hardware=serial,type=file,console=false,earlycon=true,path=test.log \ --serial hardware=virtio-console,type=file,console=true,stdin=true,path=test.log \ vm_kernel BUG=None TEST=see above - verify log contains earlycon and console output Change-Id: I14dab9eaf56dbb0ae410215324b20b34fea723ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2208712 Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * fuzz: update virtqueue fuzzer for new VolatileSlice APIDaniel Verkamp2020-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=chromium:1087578 TEST=emerge-amd64-generic crosvm Change-Id: Ia206abf03f95ca92f5944fb8efc23d3f8355e292 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2220731 Tested-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Auto-Submit: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>
| * docker: update adhd commit for IntoIovec changeDaniel Verkamp2020-05-29
| | | | | | | | | | | | | | | | | | | | | | BUG=None TEST=docker/build_crosvm_base.sh && docker/wrapped_smoke_test.sh Change-Id: Idf81ad58954995bcfb8b222d1613f76f72a2c730 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2220154 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
| * hypervisor: x86 irqchip structsColin Downs-Razouk2020-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hypervisor-agnostic structures for the pic, ioapic, lapic, and pit. These are derived from existing structures in the pic, ioapic, and pit implementations, as well as from the kvm_sys bindings. Includes From implementations converting these structures to their associated KVM structures. Also includes tests for these conversion implementations. BUG=chromium:1077058 TEST=added tests to convert kvm structures to hypervisor-agnostic structures Change-Id: Ie2f254bf2dba3aed755008296c00cb6a49f845fd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2197716 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Colin Downs-Razouk <colindr@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
| * sys_util: Refactor IntoIovecChirantan Ekbote2020-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original stated purpose of this trait was to reduce memory allocations but having the `into_iovec` method return a Vec kind of defeats that purpose. Refactor the trait so that it can either convert a T into an iovec or convert a &[T] into a &[iovec]. Implement the trait for VolatileSlice, IoSlice, and IoSliceMut and update all the callers. BUG=none TEST=unit tests Cq-Depend: chromium:2210272 Change-Id: I9d0d617a23030d241d50411f4a5a16e7cba4bcee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2208527 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Tested-by: Chirantan Ekbote <chirantan@chromium.org>
| * devices: usb: add unit test for ring buffer cycleDaniel Verkamp2020-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Validate that the toggle_cycle code works as expected. I initially misunderstood the behavior of toggle_cycle in the Link TRB, but it appears to work correctly as written after writing a unit test to verify my understanding. Add the unit test anyway to be sure the behavior doesn't regress in the future. BUG=None TEST=cargo test -p devices Change-Id: I9dbc34b26225945fa6d31c34261f53d5b64ba259 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2199956 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * arch: check property_string result in create_android_fdtDaniel Verkamp2020-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the missing '?' to check the result of the newly-added property_string call to match the rest in this function. Fixes clippy warning about an unused result. BUG=None TEST=docker/wrapped_smoke_test.sh Change-Id: I428b377e1a4f15e0ee96c8e96540f2fc8edce560 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2216400 Tested-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Auto-Submit: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * Fix VolatileSlice calls in all modulesDaniel Verkamp2020-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VolatileSlice API changed, but some callers were not updated to match. Fix them up so that builds with additional features enabled (e.g. kokoro) pass again. BUG=None TEST=cargo test -p disk --features=composite-disk TEST=docker/wrapped_smoke_test.sh Change-Id: I97b3cd04549af30b7dc1515245f025d9439669bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2216399 Tested-by: Daniel Verkamp <dverkamp@chromium.org> Auto-Submit: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * docker: update ADHD commit for VolatileSlice changesDaniel Verkamp2020-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update to include commit 172fe3dee939f4bdc622088699fce8c0653b5389 ("libcras: Update VolatileSlice call"). BUG=None TEST=docker/build_crosvm_base.sh && docker/wrapped_smoke_test.sh Change-Id: Ib4cf4128204c42abfb8a04c823db2c4faedccbc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2216398 Tested-by: Daniel Verkamp <dverkamp@chromium.org> Auto-Submit: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * Cargo.lock: add sync dependency to hypervisorDaniel Verkamp2020-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update Cargo.lock via `cargo build` after commit 0aacc50fd25d61ae1274d6054550f45acaa50897. BUG=None TEST=`cargo build` does not modify Cargo.lock TEST=kokoro Change-Id: Ib8942b38f881322f3e74726fdabe4fc68a2f3b6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2212948 Tested-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * resources: allocate_at support for address_allocatorTomasz Jeznach2020-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for address range allocation at specific location and size. Allocation is successful only if requested range is available and free. Change to address_allocator allocation algorithm from contiguous memory allocation to first-fit like implementation to allow memory release/reuse in future. BUG=None TEST=cargo test -p resources && tast test vm.* Change-Id: I58218f5a2c6a215152904cc1cf0748e842fa7374 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2203297 Tested-by: Tomasz Jeznach <tjeznach@chromium.org> Commit-Queue: Tomasz Jeznach <tjeznach@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
| * Make VolatileSlice ABI-compatible with iovecChirantan Ekbote2020-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change VolatileSlice so that it is ABI-compatible with iovec. This allows us to directly pass in a VolatileSlice for a C function that expects an iovec without having to create temporaries that convert from one to the other. Also change all the parameters from u64 to usize. It's not possible to address more memory than fits into a usize so having u64 here didn't really provide much benefit and led to a lot of tedious casting back and forth all over the place. BUG=none TEST=unit tests Cq-Depend: chromium:2206621 Change-Id: I258f9123c603d9a4c6c5e2d4d10eb4aedf74466d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2203998 Tested-by: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
| * devices: virtio: video: Implement video decoder deviceKeiichi Watanabe2020-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement virtio-video decoder which supports hardware-accelerated video decoding backed by libvda. Note that this implementation assumes that a guest client uses a fixed-size set of output buffers. We support a case where arbitrary numbers of buffers are used by a client like C2V4L2Component in the next CL. BUG=b:147465619 TEST=Run v4l2-decoder-sample on ARCVM R TEST=Play YouTube videos on ARCVM R with C2VDAComponent Change-Id: I3a19381f923ba9c9c0d587dc4ff2c2ee3b31269d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1991380 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
| * devices: virtio: Initial implementation of virtio-video deviceKeiichi Watanabe2020-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a fundamental part of the virtio video device, which will be shared between the encoder and the decoder. Both devices uses the virtio-video protocol proposed as RFC v3 [1,2]. The corresponding driver code is at CL:2060327 and its children CLs. The actual decoding and encoding logic will be implemented in different CLs. [1]: mail: https://markmail.org/thread/wxdne5re7aaugbjg [2]: PDF: https://drive.google.com/file/d/1jOsS2WdVhL4PpcWLO8Zukq5J0fXDiWn-/view BUG=b:147465619, b:140082257 TEST=cargo check --features=video-decoder,video-encoder TEST=ARCVM started with --video-decoder --video-encoder Cq-Depend: chromium:2203997 Change-Id: I01999eea218ba0f3aaed1558ca2311a57d0c6819 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1973973 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
| * devices: gpu: random cleanupGurchetan Singh2020-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove unused phantom data - scannout --> scanout BUG=none TEST=compile Change-Id: I5054833025eef5be766b547fa3e61d2ca46e226f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2211154 Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
* | Merge remote-tracking branch 'origin/master'Alyssa Ross2020-05-22
|\|
| * Cargo.lock: add kvm to hypervisor dependenciesDaniel Verkamp2020-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update Cargo.lock to match the latest commit. (Updated automatically via `cargo build`.) BUG=None TEST=`cargo build` does not modify Cargo.lock any further TEST=kokoro passes Change-Id: I1c022c6111b063eb0d31dda59ed3125c91b49d19 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2209351 Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * hypervisor: add KvmVm new and try_cloneSteven Richman2020-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vms and Vcpus will be try_cloneable and Send, so we can configure on vcpu threads and so IrqChips can reference all Vcpus. To support cloning, collection fields in Vm have been moved into arc mutexes, and Vm and Vcpu are now Sized. Because this breaks object safety, all usage of the traits will be via static binding. Add impl AsRawFd for SafeDescriptor, to get the sys_util ioctl functions working with SafeDescriptor; eventually the functions will change to take SafeDescriptors. Copy set_user_memory_region helper from kvm crate. BUG=chromium:1077058 TEST=cargo test -p hypervisor Change-Id: I23de47c4472a77632006d0d45de9754394b400c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2197337 Reviewed-by: Udam Saini <udam@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Steven Richman <srichman@google.com>
| * Put files in device tree for AndroidLepton Wu2020-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this, Android can access files from host in early stage so it can import properties from host. To avoid introduce more command line flags, just reuse the fstab file: any entries begin with #dt-vendor means a host side file need to be put in device tree. BUG=b:155128030 TEST=manual - Run ARCVM and check there is file under sysfs Change-Id: I6b209e05faabd3a82fe0194cf462ee450918ae5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2203298 Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Tested-by: Lepton Wu <lepton@chromium.org> Auto-Submit: Lepton Wu <lepton@chromium.org>
| * devices: irqchip: new irqchip moduleColin Downs-Razouk2020-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new module contains the irqchip trait and it's implementations. The irqchips will work with the new hypervisor crate to abstract the interaction between crosvm and kvm. This just defines the irqchip trait and an empty implementation of the KvmKernelIrqChip. BUG=chromium:1077058 TEST=added test for creating a KvmKernelIrqChip and adding a Vcpu to it Change-Id: Ic1609c965e0a057f5a9d4d74f1cae46edb46dcb4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2197398 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Colin Downs-Razouk <colindr@google.com>
| * msg_socket: remove MsgOnSocket impl for RawFd, an alias for i32Zach Reizner2020-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation makes it impossible to use i32 as ordinary data in a MsgOnSocket implementation. It is also error prone because i32 is the default type for integer literals in Rust, and #[derive(MsgOnSocket)] on structs with an i32 would suddenly be transmitting a RawFd. This change also replaces the uses of RawFd's MsgOnSocket impl for one based on File. TEST=cargo build BUG=None Change-Id: I9da392e34e62fe61f773f24d656dbcbf4716f1a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2197777 Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
| * msg_socket: fix MsgOnSocket::msg_size for Option<T>Zach Reizner2020-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused None values to be transmitted as zero-bytes, which usually caused not enough buffer space to be allocated for sending. BUG=None TEST=cargo test -p msg_socket Change-Id: If12d2df56689a84054405f2ba15d1c268afad15e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2197776 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>
| * devices: usb: ignore busy flag in interrupterDaniel Verkamp2020-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works around an issue where the xhci controller hangs from the guest's point of view, with the guest kernel eventually timing out and disabling the controller. The xHCI spec says that the EHB (Event Handler Busy) bit should be cleared before signalling another interrupt. This bit is set by the controller before triggering an interrupt, and it is meant to be cleared by the guest (via write-1-to-clear) when it is done handling the interrupt. However, it seems that there is a race going on between the clearing and setting of this bit. Removing the check seems to avoid the issue, since we never get into the state where we think EHB is set but the guest thinks it is clear (where no further interrupts would be triggered). This will potentially trigger more interrupts than strictly necessary, but the Linux kernel xhci driver handles interrupts with no events available gracefully. BUG=chromium:1082930 TEST=`while adb shell echo hi; do : ; done` for 8+ hours without hangs Change-Id: I3c08f0c5675be10d8e46f73714d684f7ba3a3903 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2202745 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * devices: usb: remove interrupter pending variableDaniel Verkamp2020-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pending variable was just duplicating state that can easily be determined based on whether the ring is empty. Remove the variable and replace it with an equivalent check in interrupt_if_needed() to avoid the possibility of accidentally getting these out of sync. BUG=chromium:1082930 TEST=cargo test -p devices Change-Id: Icb90e3d09c43de244f5fecffb0e55d4635be6d2b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2202744 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * Implements the Hypervisor trait for Kvm.Udam Saini2020-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the ability for getting both supported/emulated cpuids from the kvm hypervisor. In addition, checking the available capabilities for kvm is now implemented. BUG=chromium:1077058 TEST=Added unit tests for each implemented function. Change-Id: Ide4c2840b7bfa022deae835eb734ea97c1859169 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2177641 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Udam Saini <udam@google.com>
| * descriptor_utils: Remove need for temporary vectorsChirantan Ekbote2020-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the DescriptorChainConsumer, Reader, and Writer structs so that we don't have to allocate a Vec on the heap every time we read or write from a DescriptorChain. This should hopefully give us some small performance improvements as well as simplify the code in some places. Also switch from VolatileSlices to iovecs so that it's easier to use these structs with io_uring. Otherwise we would end up allocating temporary vectors to convert from VolatlieSlice to iovec. BUG=none TEST=unit tests Change-Id: I1657bc76cfff084df825dbbdc8ff414740b71a8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2190106 Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>
| * acpi: refactor the ACPI PM deviceChuanxiao Dong2020-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the AML support to generate the S1 table instead of hard coding. Also use the IO allocater to allocate the IO resouce for ACPI PM. BUG=None TEST=boot crosvm by command "crosvm run -s crosvm.sock -m 4096 --cpus 4 --rwdisk rootfs.img -p "root=/dev/vda rootfstype=ext4" vmlinux". Check the S1 capability by "#echo standby > /sys/power/state" from guest side. Linux guest is suspended. And resume linux guest by "#crosvm resume crosvm.sock" from host side. Change-Id: I75b484c44db05f98d49557ba694a1531b57871c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2119571 Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>
| * hypervisor: add Vm/Vcpu traits and Kvm implsSteven Richman2020-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add arch-agnostic traits Vm and Vcpu. Add arch-specific traits HypervisorXXX, VmXXX, VcpuXXX, with impls for KVM. BUG=chromium:1077058 TEST=added test for functions and structs interacting with the traits Change-Id: I809f42f32a558c7835831c90e24fca82ce7744ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2176562 Reviewed-by: Udam Saini <udam@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Steven Richman <srichman@google.com>
| * Extract the DisplayBackend build process into BackendKind build functionKaiyi Li2020-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All 3 different virtio gpu backends share the same process of creating the GpuDisplay instance, so move that process out of their separate build functions and put it in the shared BackendKind build function. BUG=None TEST=build_test Change-Id: Ie15bae48c8f1b75df49ba066a677020ec5dbf744 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2182041 Reviewed-by: Jason Macnak <natsu@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Kaiyi Li <kaiyili@google.com>
* | crosvm: fix file_to_i64 commentAlyssa Ross2020-05-22
| | | | | | | | This was missed in 0bf8a5590f3556d8ec05c182cb612f254fd416e5.
* | msg_socket: impl std::error::Error for MsgErrorAlyssa Ross2020-05-22
| |
* | devices: print unexpected wl command in hexAlyssa Ross2020-05-16
| | | | | | | | | | This makes it easier to compare with linux/virtio_wl.h, where the commands are all declared in hex.
* | msg_socket: fmtAlyssa Ross2020-05-10
| |
* | Merge remote-tracking branch 'origin/master'Alyssa Ross2020-05-10
|\|
| * docker: update PLATFORM2 commit to fix kokoro build with videoKeiichi Watanabe2020-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update to "arc: vm: libvda: Remove redundant single-component import". BUG=None TEST=docker/build_crosvm_base.sh && docker/wrapped_smoke_test.sh w/ CL:1973973 and CL:1991380. Change-Id: I696f0bfd8d6d83396e9662ec537147b7d0772f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2190102 Tested-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
| * aarch64: Enable PMU in the guest.Suleiman Souhlal2020-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to use perf/simpleperf in the guest. BUG=b:153708112 TEST=Use simpleperf in ARCVM guest on jacuzzi board. Change-Id: Ia3d7dc5bcd3ca033ddf05b5ee2593102c98e8b49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2156592 Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Suleiman Souhlal <suleiman@chromium.org> Reviewed-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Suleiman Souhlal <suleiman@chromium.org>
| * remove instantes of using IntoRawFd in unsafe blocksZach Reizner2020-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The trait IntoRawFd isn't marked unsafe, but its documentation says that an impl must return a uniquely owned RawFd. Some code blocks depended on that behavior to ensure safety with the unsafe File::from_raw_fd, but this leads to a soundness hole where a nominally safe impl of IntoRawFd can lead to unsafety in functions that had been left as safe. This change sidesteps the issue by not using IntoRawFd, and using only safe conversions instead. BUG=None TEST=cargo build --features='wl-dmabuf plugin' Change-Id: I9b357e5592be21189fb96e343823dd63000aac30 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2185580 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Zach Reizner <zachr@chromium.org> Auto-Submit: Zach Reizner <zachr@chromium.org>
| * msg_socket: AsyncReceiver doesn't need a mut refDylan Reid2020-05-07
| | | | | | | | | | | | | | | | | | | | | | | | The AsyncReceiver doesn't need to modify the message receiver so let it take a plain old borrow. Change-Id: I07e93d2ed12327dd893fec654d2bdd613a848fe6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2167694 Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
| * async_core: Add async TimerFdDylan Reid2020-05-07
| | | | | | | | | | | | | | | | | | | | | | | | An async timer FD will allow block to keep the flush timer when it is converted to async. Change-Id: I25759be0f969d1962fd13f33709166527d8f117d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2168644 Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>