[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210929151119.14778-1-vincent.whitchurch@axis.com>
Date: Wed, 29 Sep 2021 17:11:09 +0200
From: Vincent Whitchurch <vincent.whitchurch@...s.com>
To: <mst@...hat.com>, <jasowang@...hat.com>
CC: <kernel@...s.com>, <kvm@...r.kernel.org>,
<virtualization@...ts.linux-foundation.org>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<pbonzini@...hat.com>, <stefanha@...hat.com>,
<sgarzare@...hat.com>,
Vincent Whitchurch <vincent.whitchurch@...s.com>
Subject: [RFC PATCH 00/10] Support kernel buffers in vhost
vhost currently expects that the virtqueues and the queued buffers are
accessible from a userspace process' address space. However, when using vhost
to communicate between two Linux systems running on two physical CPUs in an AMP
configuration (on a single SoC or via something like PCIe), it is undesirable
from a security perspective to make the entire kernel memory of the other Linux
system accessible from userspace.
To remedy this, this series adds support to vhost for placing the virtqueues
and queued buffers in kernel memory. Since userspace should not be allowed to
control the placement and attributes of these virtqueues, a mechanism to do
this from kernel space is added. A vDPA-based test driver is added which uses
this support to allow virtio-net and vhost-net to communicate with each other
on the same system without exposing kernel memory to userspace via /dev/mem or
similar.
This vDPA-based test driver is intended to be used as the basis for the
implementation of driver which will allow Linux-Linux communication between
physical CPUs on SoCs using virtio and vhost, for instance by using information
from the device tree to indicate the location of shared memory, and the mailbox
API to trigger interrupts between the CPUs.
This patchset is also available at:
https://github.com/vwax/linux/tree/vhost/rfc
Vincent Whitchurch (10):
vhost: scsi: use copy_to_iter()
vhost: push virtqueue area pointers into a user struct
vhost: add iov wrapper
vhost: add support for kernel buffers
vhost: extract common code for file_operations handling
vhost: extract ioctl locking to common code
vhost: add support for kernel control
vhost: net: add support for kernel control
vdpa: add test driver for kernel buffers in vhost
selftests: add vhost_kernel tests
drivers/vdpa/Kconfig | 8 +
drivers/vdpa/Makefile | 1 +
drivers/vdpa/vhost_kernel_test/Makefile | 2 +
.../vhost_kernel_test/vhost_kernel_test.c | 575 ++++++++++++++++++
drivers/vhost/Kconfig | 6 +
drivers/vhost/Makefile | 3 +
drivers/vhost/common.c | 340 +++++++++++
drivers/vhost/net.c | 212 ++++---
drivers/vhost/scsi.c | 50 +-
drivers/vhost/test.c | 2 +-
drivers/vhost/vdpa.c | 6 +-
drivers/vhost/vhost.c | 437 ++++++++++---
drivers/vhost/vhost.h | 109 +++-
drivers/vhost/vsock.c | 95 +--
include/linux/vhost.h | 23 +
tools/testing/selftests/Makefile | 1 +
.../vhost_kernel/vhost_kernel_test.c | 287 +++++++++
.../vhost_kernel/vhost_kernel_test.sh | 125 ++++
18 files changed, 2020 insertions(+), 262 deletions(-)
create mode 100644 drivers/vdpa/vhost_kernel_test/Makefile
create mode 100644 drivers/vdpa/vhost_kernel_test/vhost_kernel_test.c
create mode 100644 drivers/vhost/common.c
create mode 100644 include/linux/vhost.h
create mode 100644 tools/testing/selftests/vhost_kernel/vhost_kernel_test.c
create mode 100755 tools/testing/selftests/vhost_kernel/vhost_kernel_test.sh
--
2.28.0
Powered by blists - more mailing lists