From ec5916daa056b2ad68a5dc2a7c604299aa3e2c8f Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 7 Oct 2019 13:06:22 -0700 Subject: devices: virtio: block: use FileReadWriteAtVolatile Use the "at" variants of the read/write functions in the block device. This reduces the number of syscalls on the host per I/O to one (pread64/pwrite64) rather than two (lseek + read/write). The CompositeDiskFile implementation is also updated in this commit, since it's both a producer and consumer of DiskFile, and it isn't trivial to update it in a separate commit without breaking compilation. BUG=None TEST=Start Crostini on kevin, banon, and nami Change-Id: I031e7e87cd6c99504db8c56b1725ea51c1e27a53 Signed-off-by: Daniel Verkamp Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1845948 Tested-by: kokoro Reviewed-by: Stephen Barber --- seccomp/arm/block_device.policy | 2 ++ seccomp/x86_64/block_device.policy | 2 ++ 2 files changed, 4 insertions(+) (limited to 'seccomp') diff --git a/seccomp/arm/block_device.policy b/seccomp/arm/block_device.policy index 62f4ee7..1ec4053 100644 --- a/seccomp/arm/block_device.policy +++ b/seccomp/arm/block_device.policy @@ -10,6 +10,8 @@ fstat64: 1 fsync: 1 ftruncate64: 1 _llseek: 1 +preadv: 1 +pwritev: 1 timerfd_create: 1 timerfd_gettime: 1 timerfd_settime: 1 diff --git a/seccomp/x86_64/block_device.policy b/seccomp/x86_64/block_device.policy index 20eca1a..6bb5c32 100644 --- a/seccomp/x86_64/block_device.policy +++ b/seccomp/x86_64/block_device.policy @@ -10,6 +10,8 @@ fstat: 1 fsync: 1 ftruncate: 1 lseek: 1 +preadv: 1 +pwritev: 1 timerfd_create: 1 timerfd_gettime: 1 timerfd_settime: 1 -- cgit 1.4.1