commit | 97b47a30bab00edaed93bd7a71658ed3e3285fb0 | [log] [tgz] |
---|---|---|
author | Ryan Neph <ryanneph@google.com> | Mon Mar 25 13:01:49 2024 -0700 |
committer | crosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Apr 08 18:34:07 2024 +0000 |
tree | b6cc4ddf4aa6fab2985f28fb46c4e43fac32f176 | |
parent | 60f4fbf95ae5e963b3b23092464e2b74bc794f5b [diff] |
devices: virtio: wl: force cacheline flushes for uncached dmabufs Some boards (such as guybrush) map virtio-wl-allocated dmabufs as uncached/wc on host, while virtio-wl always maps as cached on guest. When this happens, the second-level address translation (SLAT) used to enable zero-copy guest writes into the dmabuf memory is wrongfully configured as cached from the guest's perspective. Then, when virtio-wl synchronizes with DMA_BUF_IOCTL_SYNC + (DMA_BUF_SYNC_WRITE | DMA_BUF_SYNC_END), the host kmd elides the cache flushes because it recognizes the memory as truly uncached (or write-combined) and the user sees memory incoherency artifacts. BUG=b:316402315 TEST=tools/dev_container tools/presubmit TEST=(crostini on guybrush): gedit shows no incoherency artifacts Change-Id: I2ad469f07e98d23ba7a7f1a9e4a698202977887b Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5394041 Commit-Queue: Ryan Neph <ryanneph@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on ChromeOS devices.