linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] vdpa_sim: add support for user VA
@ 2023-03-02 11:34 Stefano Garzarella
  2023-03-02 11:34 ` [PATCH v2 1/8] vdpa: add bind_mm/unbind_mm callbacks Stefano Garzarella
                   ` (7 more replies)
  0 siblings, 8 replies; 40+ messages in thread
From: Stefano Garzarella @ 2023-03-02 11:34 UTC (permalink / raw)
  To: virtualization
  Cc: Andrey Zhadchenko, eperezma, netdev, stefanha, linux-kernel,
	Jason Wang, Michael S. Tsirkin, kvm, Stefano Garzarella

v2:
- rebased on Linus' tree, commit ae3419fbac84 ("vc_screen: don't clobber
  return value in vcs_read")
- removed `struct task_struct *owner` param (unused for now, maybe
  useful to support cgroups) [Jason]
- add unbind_mm callback [Jason]
- call the new unbind_mm callback during the release [Jason]
- avoid to call bind_mm callback after the reset, since the device
  is not detaching it now during the reset
- added new patch replace kmap_atomic() with kmap_local_page() since
  checkpatch.pl complained about deprecation of kmap_atomic() touched
  by a patch in this series
- fix cast warnings when build with W=1 C=1
- added new patch to replace the spinlock with a mutex [Jason]
- `use_va` set to true by default [Eugenio]
- supported the new unbind_mm callback [Jason]
- removed the unbind_mm call in vdpasim_do_reset() [Jason]
- avoided to release the lock while call kthread_flush_work() since
  we are now using a mutex to protect the device state

RFC v1: https://lore.kernel.org/lkml/20221214163025.103075-1-sgarzare@redhat.com/

This series adds support for the use of user virtual addresses in the
vDPA simulator devices.

The main reason for this change is to lift the pinning of all guest memory.
Especially with virtio devices implemented in software.

The next step would be to generalize the code in vdpa-sim to allow the
implementation of in-kernel software devices. Similar to vhost, but using vDPA
so we can reuse the same software stack (e.g. in QEMU) for both HW and SW
devices.

For example, we have never merged vhost-blk, and lately there has been interest.
So it would be nice to do it directly with vDPA to reuse the same code in the
VMM for both HW and SW vDPA block devices.

The main problem (addressed by this series) was due to the pinning of all
guest memory, which thus prevented the overcommit of guest memory.

Thanks,
Stefano

Stefano Garzarella (8):
  vdpa: add bind_mm/unbind_mm callbacks
  vhost-vdpa: use bind_mm/unbind_mm device callbacks
  vringh: replace kmap_atomic() with kmap_local_page()
  vringh: support VA with iotlb
  vdpa_sim: make devices agnostic for work management
  vdpa_sim: use kthread worker
  vdpa_sim: replace the spinlock with a mutex to protect the state
  vdpa_sim: add support for user VA

 drivers/vdpa/vdpa_sim/vdpa_sim.h     |  11 +-
 include/linux/vdpa.h                 |  10 ++
 include/linux/vringh.h               |   5 +-
 drivers/vdpa/mlx5/net/mlx5_vnet.c    |   2 +-
 drivers/vdpa/vdpa_sim/vdpa_sim.c     | 160 ++++++++++++++---
 drivers/vdpa/vdpa_sim/vdpa_sim_blk.c |  10 +-
 drivers/vdpa/vdpa_sim/vdpa_sim_net.c |  10 +-
 drivers/vhost/vdpa.c                 |  30 ++++
 drivers/vhost/vringh.c               | 247 +++++++++++++++++++++------
 9 files changed, 395 insertions(+), 90 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2023-03-17 11:26 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 11:34 [PATCH v2 0/8] vdpa_sim: add support for user VA Stefano Garzarella
2023-03-02 11:34 ` [PATCH v2 1/8] vdpa: add bind_mm/unbind_mm callbacks Stefano Garzarella
2023-03-14  3:39   ` Jason Wang
2023-03-16  8:17     ` Stefano Garzarella
2023-03-02 11:34 ` [PATCH v2 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks Stefano Garzarella
2023-03-14  3:48   ` Jason Wang
2023-03-16  8:31     ` Stefano Garzarella
2023-03-16 10:11       ` Stefano Garzarella
2023-03-02 11:34 ` [PATCH v2 3/8] vringh: replace kmap_atomic() with kmap_local_page() Stefano Garzarella
2023-03-14  3:56   ` Jason Wang
2023-03-15 21:12     ` Fabio M. De Francesco
2023-03-16  2:53       ` Jason Wang
2023-03-16  8:09       ` Stefano Garzarella
2023-03-16  9:25         ` Fabio M. De Francesco
2023-03-16  9:13   ` Fabio M. De Francesco
2023-03-16  9:17     ` Stefano Garzarella
2023-03-02 11:34 ` [PATCH v2 4/8] vringh: support VA with iotlb Stefano Garzarella
2023-03-03 14:38   ` Eugenio Perez Martin
2023-03-07  9:31     ` Stefano Garzarella
2023-03-16 16:07     ` Stefano Garzarella
2023-03-17  2:53       ` Jason Wang
2023-03-17  9:49       ` Eugenio Perez Martin
2023-03-17 11:25         ` Stefano Garzarella
2023-03-14  4:53   ` Jason Wang
2023-03-16  8:38     ` Stefano Garzarella
2023-03-02 11:34 ` [PATCH v2 5/8] vdpa_sim: make devices agnostic for work management Stefano Garzarella
2023-03-03 14:40   ` Eugenio Perez Martin
2023-03-14  5:27   ` Jason Wang
2023-03-02 11:34 ` [PATCH v2 6/8] vdpa_sim: use kthread worker Stefano Garzarella
2023-03-02 15:30   ` Simon Horman
2023-03-02 15:48     ` Stefano Garzarella
2023-03-05 11:21   ` kernel test robot
2023-03-14  5:31   ` Jason Wang
2023-03-02 11:34 ` [PATCH v2 7/8] vdpa_sim: replace the spinlock with a mutex to protect the state Stefano Garzarella
2023-03-14  5:29   ` Jason Wang
2023-03-14  5:31     ` Jason Wang
2023-03-16  8:42       ` Stefano Garzarella
2023-03-02 11:34 ` [PATCH v2 8/8] vdpa_sim: add support for user VA Stefano Garzarella
2023-03-14  5:36   ` Jason Wang
2023-03-16  9:11     ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).