summary refs log tree commit diff
path: root/src
Commit message (Collapse)AuthorAge
* 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>
| * arch, devices: move serial creation to archDaniel Verkamp2020-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the serial code into two parts: - Configuration and setup: arch/src/serial.rs - Serial device emulation: devices/src/serial.rs No change in functionality - this is just preparation for generalizing the command line parsing/setup code so that it can be used with virtio console devices as well. BUG=chromium:1059924 TEST=emerge-nami crosvm TEST=emerge-kevin crosvm Change-Id: I0aaf9dd6f8096eac4a17077ab5bf569f57d64ff5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2127319 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * Serial: add input path overriding stdin for --serialIliyan Malchev2020-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allowing the input to be specified for file-based serial ports allows the user of pipes as input/output. That enables kgdb over serial. TEST= Build a kernel with support for gdb ``` make x86_64_defconfig make kvmconfig ./scripts/config --enable GDB_SCRIPTS ./scripts/config --enable KGDB ./scripts/config --enable KGDB_SERIAL_CONSOLE ./scripts/config --enable KGDB_LOW_LEVEL_TRAP ./scripts/config --enable KGDB_KDB ./scripts/config --enable KDB_KEYBOARD ./scripts/config --enable GDB_SCRIPTS ./scripts/config --set-val KDB_CONTINUE_CATASTROPHIC 0 make -j33 ``` Setup devices for PTYs To make sure crosvm doesn't create an ordinary file if socat is started after it, create these named pipes first: ``` mkfifo ~/console_{in,out} ~/kgdb_{in,out} ``` Set up two PTYs: ~/kgdb for the debugger, and ~/serial for the console. PTY ~/kgdb connects to ~/kgdb{in,out}, and ~/serial connects to ~/console{in,out} ``` socat -d -d -d \ 'PIPE:$HOME/console_out,rdonly=1,nonblock=1,ignoreeof=1!!PIPE:$HOME/console_in,wronly=1' \ PTY,link=$HOME/serial,ctty,raw,echo=0 socat -d -d -d \ 'PIPE:$HOME/kgdb_out,rdonly=1,nonblock=1,ignoreeof=1!!PIPE:$HOME/kgdb_in,wronly=1' \ PTY,link=$HOME/kgdb,ctty,raw,echo=0 ``` Start crosvm with serial ports pointed at ~/console{in,out} and ~/kgdb{in,out}. ``` cargo run run -p 'init=/bin/sh panic=0 kgdboc=ttyS1,115200 kgdbwait kgdbcon' \ --serial type=file,path=$HOME/console_out,num=1,console=true,stdin=false,input=$HOME/console_in \ --serial type=file,path=$HOME/kgdb_out,input=$HOME/kgdb_in,num=2,console=false,stdin=false \ -r ~/rootfs.img \ ~/src/linux/arch/x86/boot/bzImage ``` Start GDB ``` gdb vmlinux -ex "target remote /home/dgreid/kgdb" ``` To break into gdb, open up the serial console, mount /proc and send a SysRq ``` minicom -D ~/serial mount -t proc none /proc echo g > /proc/sysrq-trigger ``` Change-Id: I18a9c1087d38301df49de08eeae2f8559b03463a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2151856 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>
| * crosvm: Apply cargo fix for some clippy errorsKeiichi Watanabe2020-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Executed the following command to fix trivial style problems automatically. $ rustup run nightly cargo fix -Z unstable-options --clippy \ --all-features --all-targets BUG=chromium:908640 TEST=build Change-Id: I8a42806dc573b25d4ca918112e7b420793261d37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2145537 Tested-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
| * msg_socket: add specialized error for zero sized recvZach Reizner2020-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Receiving no data can be considered a special case for MsgOnSocket. It doesn't necessarily indicate EOF because usually messages are sent over a datagram channel and some fixed sized messages are actually zero sized. This change handles this by adding a specific result for receiving no data when at least some was expected. This will also simplify some error handling that had to unpack the `BadRecvSize` variant. TEST=cargo test -p msg_socket BUG=None Change-Id: I16feeabc1481de93a2b189989d095434b5b417b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2079178 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Auto-Submit: Zach Reizner <zachr@chromium.org>
| * crosvm balloon_stats commandCharles William Dick2020-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for moving balloon sizing logic from crosvm to concierge, expose a balloon_stats command in crosvm. This will allow concierge to query the actual balloon size and available memory of VMs. BUG=b:153134684 TEST=(chroot)$ tast run <DUT> arc.Boot.vm; (vm)$ crosvm balloon_stats <pipe>; See stats are reported. Change-Id: I1f544526ee728a085d842035754a0c17cf41ed3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2141752 Tested-by: Charles Dueck <cwd@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Commit-Queue: Charles Dueck <cwd@chromium.org>
* | crosvm: collapse simple boolean matchesAlyssa Ross2020-04-11
| | | | | | | | | | Rust 1.42 introduces matches!(), which can be used to collapse simple match statements like these.
* | crosvm: tweak --net-vq-pairs docsAlyssa Ross2020-04-10
| |
* | Merge remote-tracking branch 'origin/master'Alyssa Ross2020-04-10
|\|
| * devices: pmem: implement flush using msync()Daniel Verkamp2020-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, writable pmem devices implemented the flush command using fsync(); however, this does not guarantee synchronization of memory mappings via mmap() to the file on disk. What we actually need is msync() on the pmem file mapping, but we don't have access to that mapping in the pmem child process, and it isn't trivial to pass it along since it is owned by the Vm object once it has been added as a mmap_arena. In order to call msync() on the mapping, add a new VmControl socket so that the pmem device can request that the main process issues an msync() on the MemoryMappingArena identified by its slot number. BUG=chromium:1007535 TEST=mount filesystem on /dev/pmem0 and sync; verify msync in strace Change-Id: Id0484757c422cf81d454fd54012a12dbcc1baaf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2044365 Reviewed-by: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
| * crosvm balance available memoryCharles William Dick2020-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Poll available memory from the host and guest every second. Resize the balloon so that available memory in the guest is the same as in the host. balancemem_timer adds a Token::BalanceMemory to poll_ctx every second which creates a balloon stats request. When the stats results come back from the guest, we compute how much the balloon should change to balance available memory between the guest and host. If this new balloon size is > 5% different than the current balloon size, we make a BalloonControlCommand::Adjust to resize the balloon. BUG=b:147334004 TEST=tast run <DUT> arc.MemoryChomeOSPerf*, .vm shows memory use similar to the base arc test. tast run <DUT> arc.MemoryShiftingPerf.vm, both chromeos and android counters report high numbers. Switch LOWMEM_AVAILABLE constant to non-existing file, check the ARCVM reports not running in ChromeOS, but still boots. Change-Id: I8a581f86bf4881541d2f5f26dc541b35b862d244 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2061518 Reviewed-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Charles Dueck <cwd@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Charles Dueck <cwd@chromium.org>
| * handle mmap of large offsets on 32 bit systemsDylan Reid2020-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While only 32 bits of address can be mapped, that 32 bits can be offset by further than 32 bits in to a large file. As chirantan points out, the try_mmap call was already casting the usize to u64 on all architectures. Convert the usize offset in mmap to u64 and address users of the API as well. Change-Id: I67aed928ea521049fb51eb7aa61ea4de8b4d096c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2124879 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>
| * Virtio-net: Let queue-num could configurableXiong Zhang2020-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Virtio-net multi queue feature need multi queue pairs, this patch change queue-num configurable instead of static. --net-vq-pairs parameter could config virtio net device virtual queue pairs. BUG=chromium:1064482 TEST=Test virtio net function in guest with --net-vq-pairs=1 and --net-vq-pairs=2 Change-Id: I75202c8ae52a83b8087b52149ec6d2138d8831cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2120312 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org>
| * Virtio-net: Add multi queues in multi threadsXiong Zhang2020-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support 2 vq pairs for virtio-net, this patch create 2 sockets in one tap interface, 2 vq pairs(rx/tx) and 2 threads in device model, So one vq pair has one thread and one socket in tap corresponding. On my SkyLake desktop with crosvm and ubuntu 18.04 guest: If run one iperf server on host and one iperf client in guest, 2 vq pairs has the same netwrok bandwidth as 1 vq pair, the bandwidth is 5.99Gbits/sec If run two iperf server on host and two iperf client in guest, In 1 vq pair mode, two iperf cliens bandwidth are 3.19Gbits/sec and 3.18Gbits/sec. In 2 vq pairs mode, two iperf clients bandwidth are 4.87Gbits/sec and 4.86Gbits/sec. So 2 vq pairs improve net bandwidth 52.7% compared with 1 vq pair in this case. BUG=chromium:1064482 TEST=Run iperf test in guest Change-Id: I1fa14d7e24085552dc828a89a883d4a2ada34789 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2099754 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org>
| * crosvm virtio balloon statsCharles William Dick2020-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces the ability to request BalloonStats from a BalloonControlCommand. BUG=b:147334004 TEST=tast run <DUT> arc.Boot.vm, and the balance available changes based on this. Change-Id: I808c4024f8c644c9cc4e30cc455ceda5f477bff3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2061517 Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Charles Dueck <cwd@chromium.org>
* | Merge remote-tracking branch 'origin/master'Alyssa Ross2020-03-26
|\|
| * audio: Create AC97 device with --ac97 optionJudy Hsiao2020-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Replace --cras-audio, --cras-capture, null-audio options by --ac97 option to create audio devices. 2. "--ac97 backend=BACKEND\ [capture=true,capture_effect=EFFECT]" is comma separated key=value pairs for setting up Ac97 devices. It can be given more than once to create multiple devices. Possible key values are: backend=(null, cras) - Where to route the audio device. `null` for /dev/null, and cras for CRAS server. capture=true - Enable audio capture. capture_effects - | separated effects to be enabled for recording. The only supported effect value now is EchoCancellation or aec. BUG=b:140866281 TEST=1.crosvm run -r ./vm_rootfs.img -c 4 -m 1024 -s /run --cid 5 --host_ip\ 100.115.92.25 --netmask 255.255.255.252 --ac97\ backend=cras,capture=true,capture_effect=aec\ --mac d2:47:f7:c5:9e:53 ./vm_kernel 2. Record with the vm by: arecord -D hw:0,0 -d5 -fS16_LE -c2 -r48000 /tmp/test.mp3 3. Verify that AEC is enabled within the recording stream by cras_test_cleint. Cq-Depend: chromium:2053654 Cq-Depend: chromium:2095644 Cq-Depend: chromium:2038221 Change-Id: Ia9e0e7cda1671a4842ec77a354efaa4a2dc745eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2038413 Tested-by: Judy Hsiao <judyhsiao@chromium.org> Commit-Queue: Judy Hsiao <judyhsiao@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org> Auto-Submit: Judy Hsiao <judyhsiao@chromium.org>
| * crosvm: Change expected field to String in InvalidValueJudy Hsiao2020-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the type of argument::Error::InvalidValue::expected from "&'static str" to String. It allows the lower level parse error object to handle the output of the expected value so that the rule of parsing will not be duplicated. For example, instead of: ``` v.parse::<Settings>() .map_err(|e| argument::Error::InvalidValue { value: v.to_string(), expected: "The value of setting should null or cras", })?; ``` we can have: ``` v.parse::<Settings>() .map_err(|e| argument::Error::InvalidValue { value: v.to_string(), expected: e.to_string(), })?; ``` and the expected value can be handled in the Display implementaion of Settings::ParseError. BUG=b:140866281 TEST=cargo build Change-Id: Ieba12a21103945fe0e47c70a190a4e5d985af537 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2103605 Tested-by: Judy Hsiao <judyhsiao@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Auto-Submit: Judy Hsiao <judyhsiao@chromium.org> Commit-Queue: Judy Hsiao <judyhsiao@chromium.org>
| * Fix into_iter() usage where iter() sufficesDaniel Verkamp2020-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes warnings of the form: warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added. BUG=None TEST=emerge-nami crosvm Change-Id: I2b46b55f0e967d985d04678c240604b542e27e07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2093287 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
* | Merge remote-tracking branch 'origin/master' into masterAlyssa Ross2020-03-10
|\|
| * Vfio: Multi vfio device supportXiong Zhang2020-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current one vm could have one vfio device only, this patch let one vm could have multi vfio devices by changing the vfio parameter into vec<>. BUG=chromium:992270 TEST=passthrough two/three devices into guest, these devices are in the same vfio group, then check these devices function in guest. Change-Id: I366d24d750a199d7862fb907fa44f9be429c5944 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2080111 Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Tomasz Jeznach <tjeznach@chromium.org>
| * crosvm: remove deprecated --qcow and --rwqcow optionsDaniel Verkamp2020-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | These have been marked as deprecated for several release; use --disk or --rwdisk instead. BUG=None TEST=./build_test.py Change-Id: I8a52c9abaf3f41e2dfc4189dd19c7d828802772e Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1906992 Reviewed-by: Zach Reizner <zachr@chromium.org>