summary refs log tree commit diff
path: root/src
Commit message (Collapse)AuthorAge
* crosvm: make wl add take socket as fdAlyssa Ross2020-07-06
|
* Make wayland socket names byte arraysAlyssa Ross2020-07-02
|
* fix arg checksAlyssa Ross2020-07-02
|
* debugAlyssa Ross2020-07-02
|
* devices: enable adding Wl sockets at runtimeAlyssa Ross2020-07-02
|
* crosvm: add memfd serverAlyssa Ross2020-06-15
|
* prepare to intercept VM controlAlyssa Ross2020-06-15
|
* three partsAlyssa Ross2020-06-15
|
* make remote wayland device optionalAlyssa Ross2020-06-15
|
* don't assume two queuesAlyssa Ross2020-06-15
|
* send wl::Params over socketAlyssa Ross2020-06-15
|
* devices: VirtioDeviceNewAlyssa Ross2020-06-15
|
* switch from poly_msg_socket to msg_socket2Alyssa Ross2020-06-15
|
* debug_labelAlyssa Ross2020-06-15
|
* queue_max_sizesAlyssa Ross2020-06-15
|
* device_typeAlyssa Ross2020-06-15
|
* featuresAlyssa Ross2020-06-15
|
* get_device_capsAlyssa Ross2020-06-15
|
* get_device_barsAlyssa Ross2020-06-15
|
* resetAlyssa Ross2020-06-15
|
* read_configAlyssa Ross2020-06-15
|
* ack_featuresAlyssa Ross2020-06-15
|
* write_configAlyssa Ross2020-06-15
|
* send MemoryParams in createAlyssa Ross2020-06-15
|
* move MemoryParams to devicesAlyssa Ross2020-06-15
|
* poly_msg_socketAlyssa Ross2020-06-15
| | | | we're gonna need this to send all of VirtioDevice over a socket
* extract create message from activateAlyssa Ross2020-06-15
|
* forward kill to/from wlAlyssa Ross2020-06-15
|
* drop lazy_staticAlyssa Ross2020-06-15
|
* the great renamingAlyssa Ross2020-06-15
|
* hacky construct Wl in external procAlyssa Ross2020-06-15
|
* vm_control: make MaybeOwnedFd genericAlyssa Ross2020-06-15
| | | | | This will allow more easily sending types other than File over sockets, (e.g., UnixSeqpacket).
* hacky working out-of-process virtio_wlAlyssa Ross2020-06-15
|
* crosvm: fix balloon and USB sockets HEAD masterAlyssa Ross2020-06-15
| | | | | | | | | | | | | | | | | | | | 5bd2e7f606b726b598fdc26fe26a9b4029fab6d3 introduced queued_device_reqs to accomodate devices that are not ready to receive messages until they are activated in response to an event. But, devices that are ready immediately were not added to the map. When an event came in to one of these sockets (balloon and USB), the socket file descriptor would be looked up in queued_device_reqs, and crosvm would then crash because it wouldn't be found. The correct behaviour, which this patch implements, is to treat a missing entry the same as a Ready entry. An alternative would have been to add all other sockets to queued_device_reqs, and set them to Ready up front, but that would be more difficult to keep up to date than having a default. This way, only devices that need queueing need to be added to queued_device_reqs. Fixes: 5bd2e7f606b726b598fdc26fe26a9b4029fab6d3
* crosvm: fix deadlock on early VmRequestAlyssa Ross2020-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a DiskCommand was received on the crosvm socket before the virtio-block device was activated, the Token::VmRequest case in the main event loop would forward the request to the block device socket, and then wait syncronously for a response. That response would never come because the device hadn't been activated, and it would never be activated because the event loop would never continue, and therefore never be able to respond to the event that causes the device to be activated. crosvm would therefore just hang forever, waiting for a response that would never come. This patch fixes this deadlock by keeping track of whether devices that send a response in this way have been activated yet. If they have already been activated, messages are sent and responses are received as normal. If they have not been activated, messages are instead put into a per-device queue. Once the device is activated, queued messages are processed all at once, and then the device is marked as ready, and the queue is dropped. Future messages are processed immediately as they come in, with no further queueing. A device indicates that it is ready by sending a message on its socket. The main crosvm event loop can then poll the socket, to be notified when the device is ready. This poll event will only trigger once -- once it has been received, it is removed from the poll context. Currently, the only device type that responds to external control messages AND needs to be activated by an event is the block device. The balloon device does not respond to messages, and the xhci controller device is activated up front. The code is nevertheless structured so that it should be very easy to drop another kind of device in to the queuing system, should that be required. Message-Id: <20200614114344.22642-3-hi@alyssa.is> Notes: Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
* crosvm: fmtAlyssa Ross2020-06-14
| | | | | I should have run this before committing 28d9682698d287d14cbe67a0ed7acc1427add320, but I did not.
* Merge remote-tracking branch 'origin/master'Alyssa Ross2020-06-14
|\
| * kvm: use MappedRegion traitGurchetan Singh2020-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reduces code duplication between MMIO and mmap arenas - Makes adding future types easier - Makes upcoming deprecation of kvm crate easier - Use BTreeMap instead of HashMap since it's more efficient BUG=chromium:924405 TEST=compile and test Change-Id: I520abed0926489e64aac046e0dc0cfeb72fae7b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2216446 Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Steven Richman <srichman@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
* | 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>
| * 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: 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>
* | crosvm: fix file_to_i64 commentAlyssa Ross2020-05-22
| | | | | | | | This was missed in 0bf8a5590f3556d8ec05c182cb612f254fd416e5.
* | Merge remote-tracking branch 'origin/master'Alyssa Ross2020-05-10
|\|
| * 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>
| * linux.rs: Set MS_SLAVE mount propagation for virtio-fsChirantan Ekbote2020-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow mounts from the parent namespace to propagate into the virtio-fs device's mount namespace. BUG=b:123377807 TEST=vm.Fio.virtiofs_stress_rw and manual Change-Id: I1b8f1b411bd72a8cf5d5b4b30fa5dad466f1e48f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2156327 Reviewed-by: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
| * Remove redundant single-component importsDaniel Verkamp2020-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix clippy 1.43.0 clippy::single-component-path-imports warnings. BUG=None TEST=bin/clippy Change-Id: I3f4f54138bedce16dc1ca937bb8bc00a94594f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2163203 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * Apply same permissions to pmem-region alignments.Iliyan Malchev2020-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1979257 created a padding of read-only pages between the end of the pmem region and padding up to the next multiple of 2MiB. However, on ARM systems, kvm_arch_prepare_memory_region does not permit read-only pages on a write-able memory region. BUG=b:148706939 TEST=Tested on x86_64 and arm64 board with pmem image < 2MiB Tested-by: Iliyan Malchev <malchev@google.com> Change-Id: If06c2e0f74fdcd7db1b7d56e1a8d732d17f352bf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2153103 Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
| * sys_util: timerfd: Methods don't need to me mutDylan Reid2020-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Because TimerFd is a wrapper around a 'File' that is never modified there isn't a need for a mutable borrow. The kernel already handles the interior mutability of the underlying file descriptor. Change-Id: I7ae068cc54050b0021d00620b561335b2ae0ba16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2161625 Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>
| * arch, main: add virtio-console parsing and creationDaniel Verkamp2020-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the creation of virtio-console devices using the new hardware=virtio-console parameter to the --serial option. Also add support for the serial earlycon option, which allows using virtio-console as the main console device with a traditional serial device as the early console. This allows logging during early boot before PCI device discovery (when virtio-console devices are set up). BUG=chromium:1059924 TEST=crosvm run -r vm_rootfs.img \ --serial hardware=serial,type=stdout,console=false,earlycon=true \ --serial hardware=virtio-console,type=stdout,console=true,stdin=true \ vm_kernel Change-Id: Iff48800272b154d49b1da00f3914799089268afe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2127322 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>