All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/10] Support kernel buffers in vhost
@ 2021-09-29 15:11 ` Vincent Whitchurch
  0 siblings, 0 replies; 22+ messages in thread
From: Vincent Whitchurch @ 2021-09-29 15:11 UTC (permalink / raw)
  To: mst, jasowang
  Cc: kernel, kvm, virtualization, netdev, linux-kernel, pbonzini,
	stefanha, sgarzare, Vincent Whitchurch

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-09-29 15:13 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 15:11 [RFC PATCH 00/10] Support kernel buffers in vhost Vincent Whitchurch
2021-09-29 15:11 ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 01/10] vhost: scsi: use copy_to_iter() Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 02/10] vhost: push virtqueue area pointers into a user struct Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 03/10] vhost: add iov wrapper Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 04/10] vhost: add support for kernel buffers Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 05/10] vhost: extract common code for file_operations handling Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 06/10] vhost: extract ioctl locking to common code Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 07/10] vhost: add support for kernel control Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 08/10] vhost: net: " Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 09/10] vdpa: add test driver for kernel buffers in vhost Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch
2021-09-29 15:11 ` [RFC PATCH 10/10] selftests: add vhost_kernel tests Vincent Whitchurch
2021-09-29 15:11   ` Vincent Whitchurch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.