summary refs log tree commit diff
path: root/devices/src
Commit message (Collapse)AuthorAge
* debugAlyssa Ross2020-07-02
|
* Make lots of things DebugAlyssa Ross2020-07-02
|
* devices: enable adding Wl sockets at runtimeAlyssa Ross2020-07-02
|
* 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
|
* use lifetimes in serialization to prevent closingAlyssa Ross2020-06-15
|
* devices: VirtioDeviceNewAlyssa Ross2020-06-15
|
* recursive deserializationAlyssa Ross2020-06-15
|
* recursive serializationAlyssa Ross2020-06-15
|
* SerializerWithFds traitAlyssa 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
|
* devices: return Vec from 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
|
* be more panickyAlyssa Ross2020-06-15
|
* resetAlyssa Ross2020-06-15
|
* read_configAlyssa Ross2020-06-15
|
* ack_featuresAlyssa Ross2020-06-15
|
* write_configAlyssa Ross2020-06-15
|
* Don't give worker ownership of socketAlyssa 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
|
* devices: make virtio::Interrupt a traitAlyssa Ross2020-06-15
| | | | | This patch is designed not for efficiency, but for minimal code footprint for experimentation. Hence, Box.
* devices: move jailing out of JailedDevice::newAlyssa Ross2020-06-15
| | | | | | | | | | Doing this in its own function, jail_device, which returns a simple record struct (JailInfo), means that callers can do other things with the jailed device than just configure a ProxyDevice. This will make it possible to have a program that acts only as a jail supervisor, and which forwards its socket to a CrosVM to be put into a ProxyDevice in that process.
* devices: don't jail in ProxyDevice constructorAlyssa Ross2020-06-15
| | | | | | | Jail functionality has been moved into a new JailedDevice struct, which wraps ProxyDevice. Doing this allows ProxyDevice to be much more generic and reusable.
* 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>
* Merge remote-tracking branch 'origin/master'Alyssa Ross2020-06-14
|\
| * devices: video: dec: Support arbitrary buffers to be mapped as resourcesKeiichi Watanabe2020-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support a case where a guest client who may use arbitrary numbers of buffers. (e.g. C2V4L2Component with default pool in ARCVM) Such a client is valid as long as it uses at most 32 buffers at the same time. More specifically, this CL allows the guest to call ResourceCreate for an output resource_id which was already processed by the host. Such ResourceCreate calls will be handled as reassignment of DMAbuf to a FrameBufferId. BUG=b:157702336 TEST=Play a YouTube video on ARCVM w/ C2V4L2Component using default pool Change-Id: Ie9c457867abd91b6b7a17a5bca4a1a1e9f53c1ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2198327 Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
| * hypervisor: add Vm user memory region functionsSteven Richman2020-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The separate Vm functions for MemoryMappings and MemoryMappingArenas have been combined and now use a MappedRegion trait that the mappings implement. msync_memory_region replaces the get_mmap_arena function, which is used by VmMsyncRequest. Since Vm uses mutexes for cloning, it can't return mem region references. BUG=chromium:1077058 TEST=cargo test, cargo test -p sys_util, cargo test -p hypervisor Change-Id: If257b16ee34d07820ae7ebdb9a3a598a41df013c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2202845 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
| * devices: irqchip: KvmKernelIrqchip x86_64 implColin Downs-Razouk2020-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented get/set_pic/ioapic/pit functions for the KvmKernelIrqchip. Added respective functions on KvmVm for interacting with the underlying KVM API. Added associated tests for get/set functions. BUG=chromium:1077058 TEST=ran devices tests and added get/set function tests Change-Id: I66a29828fe2f1fbdf54d7325656a003ac09e36d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2219422 Reviewed-by: Udam Saini <udam@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Colin Downs-Razouk <colindr@google.com>
| * devices: irqchip: IrqChipX86_64 traitColin Downs-Razouk2020-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This trait handles the x86-specific features of an irqchip, including getting and setting the state of the pic, ioapic, lapics, and pit. Also includes an empty implementation of this trait for the KvmKernelIrqChip. BUG=chromium:1077058 TEST=cargo test -p devices Change-Id: I36034661f4a2baedc7ac2b8f311cab6327afefba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2197717 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Colin Downs-Razouk <colindr@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
| * devices: fs: Use 2 stage create and mkdirChirantan Ekbote2020-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a file or directory the virtio-fs server changes its effective uid and gid to the uid and gid of the process that made the call. This ensures that the file or directory has the correct owner and group when it is created and also serves as an access check to ensure that the process that made the call has permission to modify the parent directory. However, this causes an EACCES error when the following conditions are met: * The parent directory has g+rw permissions with gid A * The process has gid B but has A in its list of supplementary groups In this case the fuse context only contains gid B, which doesn't have permission to modify the parent directory. Unfortunately there's no way for us to detect this on the server side so instead we just have to rely on the permission checks carried out by the kernel driver. If the server receives a create call, then assume that the kernel has verified that the process is allowed to create that file/directory and just create it without changing the server thread's uid and gid. Additionally, in order to ensure that a newly created file appears atomically in the parent directory with the proper owner and group, change the create implementation to use `O_TMPFILE` and `linkat` as described in the open(2) manpage. There is no `O_TMPFILE` equivalent for directories so create a "hidden" directory with a randomly generated name, modify the uid/gid and mode, and then rename it into place. BUG=b:156696212 TEST=tast run $DUT vm.Virtiofs TEST=Create a test directory with group wayland and permissions g+rw. Then run `su -s /bin/bash -c 'touch ${dir}/foo' - crosvm` and `su -s /bin/bash -c 'mkdir ${dir}/bar' - crosvm`. Change-Id: If5fbcb1b011664c7c1ac29542a2f90d129c34962 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2217534 Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Tested-by: Chirantan Ekbote <chirantan@chromium.org>
| * 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>
* | Merge remote-tracking branch 'origin/master'Alyssa Ross2020-06-14
|\|
| * 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>