RFC Support kernel buffers in vhost
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest10 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | vhost: scsi: use copy_to_iter()drivers/ | +13 | 0 replies | |
| 2/10 | vhost: push virtqueue area pointers into a user structdrivers/ drivers/ drivers/ | +53 | 0 replies | |
| 3/10 | vhost: add iov wrapperdrivers/ drivers/ drivers/ +3 more | +81 | 0 replies | |
| 4/10 | vhost: add support for kernel buffersdrivers/ drivers/ drivers/ | +257 | 0 replies | |
| 5/10 | vhost: extract common code for file_operations handlingdrivers/ drivers/ drivers/ +2 more | +197 | 0 replies | |
| 6/10 | vhost: extract ioctl locking to common codedrivers/ drivers/ drivers/ +2 more | +16 | 0 replies | |
| 7/10 | vhost: add support for kernel controldrivers/ drivers/ drivers/ +1 more | +310 | 0 replies | |
| 8/10 | vhost: net: add support for kernel controldrivers/ | +98 | 0 replies | |
| 9/10 | vdpa: add test driver for kernel buffers in vhostdrivers/ drivers/ drivers/ +1 more | +586 | 0 replies | |
| 10/10 | selftests: add vhost_kernel teststools/ tools/ tools/ | +413 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [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
Signature · 1 line
2.28.0