summary refs log tree commit diff
path: root/seccomp
diff options
context:
space:
mode:
authorDavid Reveman <reveman@chromium.org>2018-05-23 06:41:30 -0400
committerchrome-bot <chrome-bot@chromium.org>2018-06-19 14:38:53 -0700
commit22272dd4b26cf1e3797ea8f7ea0331d71cbd399a (patch)
tree7f3c2b6f191a1caa5b4fe45680e1956c3c14417e /seccomp
parentb657603f10daf62fa6fe18d56adbe35f6caf8587 (diff)
downloadcrosvm-22272dd4b26cf1e3797ea8f7ea0331d71cbd399a.tar
crosvm-22272dd4b26cf1e3797ea8f7ea0331d71cbd399a.tar.gz
crosvm-22272dd4b26cf1e3797ea8f7ea0331d71cbd399a.tar.bz2
crosvm-22272dd4b26cf1e3797ea8f7ea0331d71cbd399a.tar.lz
crosvm-22272dd4b26cf1e3797ea8f7ea0331d71cbd399a.tar.xz
crosvm-22272dd4b26cf1e3797ea8f7ea0331d71cbd399a.tar.zst
crosvm-22272dd4b26cf1e3797ea8f7ea0331d71cbd399a.zip
virtwl: implement dmabuf sync support
This provides proper synchronization for guest access to
DMABufs.

Virtio wayland device is given access to the DMA_BUF_SYNC ioctl
in order to implement this. Being able to use this directly in
the virtio wayland device process is important as these calls
can sometimes be relatively expensive and they are frequent
enough that avoiding another context switch is useful for good
performance.

TEST=cache-line artifacts no longer noticeable
BUG=chromium:837209

Change-Id: Ibb8d7c01f70ed5b74afd69288015a65186fec52a
Reviewed-on: https://chromium-review.googlesource.com/1076928
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'seccomp')
-rw-r--r--seccomp/aarch64/wl_device.policy4
-rw-r--r--seccomp/x86_64/wl_device.policy8
2 files changed, 8 insertions, 4 deletions
diff --git a/seccomp/aarch64/wl_device.policy b/seccomp/aarch64/wl_device.policy
index 9f21169..52bf028 100644
--- a/seccomp/aarch64/wl_device.policy
+++ b/seccomp/aarch64/wl_device.policy
@@ -30,8 +30,8 @@ write: 1
 eventfd2: 1
 # Used to connect to wayland. arg0 == AF_UNIX && arg1 == SOCK_STREAM|SOCK_CLOEXEC
 socket: arg0 == 1 && arg1 == 0x80001 && arg2 == 0
-# arg1 == FIONBIO
-ioctl: arg1 == 0x5421
+# arg1 == FIONBIO || arg1 == DMA_BUF_IOCTL_SYNC
+ioctl: arg1 == 0x5421 || arg1 == 0x40086200
 connect: arg2 == 13
 # Used to communicate with wayland
 recvmsg: 1
diff --git a/seccomp/x86_64/wl_device.policy b/seccomp/x86_64/wl_device.policy
index 045e40f..cb8d6e4 100644
--- a/seccomp/x86_64/wl_device.policy
+++ b/seccomp/x86_64/wl_device.policy
@@ -1,3 +1,7 @@
+# Copyright 2018 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
 close: 1
 dup: 1
 dup2: 1
@@ -25,8 +29,8 @@ write: 1
 eventfd2: 1
 # Used to connect to wayland. arg0 == AF_UNIX && arg1 == SOCK_STREAM|SOCK_CLOEXEC
 socket: arg0 == 1 && arg1 == 0x80001 && arg2 == 0
-# arg1 == FIONBIO
-ioctl: arg1 == 0x5421
+# arg1 == FIONBIO || arg1 == DMA_BUF_IOCTL_SYNC
+ioctl: arg1 == 0x5421 || arg1 == 0x40086200
 connect: arg2 == 13
 # Used to communicate with wayland
 recvmsg: 1