All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1 vfio 0/6] Move to use cgroups for userspace persistent allocations
@ 2023-01-08 15:44 Yishai Hadas
  2023-01-08 15:44 ` [PATCH V1 vfio 1/6] vfio/mlx5: Fix UBSAN note Yishai Hadas
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Yishai Hadas @ 2023-01-08 15:44 UTC (permalink / raw)
  To: alex.williamson, jgg
  Cc: kvm, kevin.tian, joao.m.martins, leonro, diana.craciun,
	eric.auger, yishaih, maorg, cohuck, shameerali.kolothum.thodi

This series changes the vfio and its sub drivers to use
GFP_KERNEL_ACCOUNT for userspace persistent allocations.

The GFP_KERNEL_ACCOUNT option lets the memory allocator know that this
is untrusted allocation triggered from userspace and should be a subject
of kmem accountingis, and as such it is controlled by the cgroup
mechanism. [1]

As part of this change, we allow loading in mlx5 driver larger images
than 512 MB by dropping the arbitrary hard-coded value that we have
today and move to use the max device loading value which is for now 4GB.

In addition, the first patch from the series fixes a UBSAN note in mlx5
that was reported once the kernel was compiled with this option.

[1] https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html

Changes from V0: https://www.spinics.net/lists/kvm/msg299508.html
Patch #2 - Fix MAX_LOAD_SIZE to use BIT_ULL instead of BIT as was
           reported by the krobot test.

Yishai

Jason Gunthorpe (1):
  vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations

Yishai Hadas (5):
  vfio/mlx5: Fix UBSAN note
  vfio/mlx5: Allow loading of larger images than 512 MB
  vfio/hisi: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations
  vfio/fsl-mc: Use GFP_KERNEL_ACCOUNT for userspace persistent
    allocations
  vfio/platform: Use GFP_KERNEL_ACCOUNT for userspace persistent
    allocations

 drivers/vfio/container.c                      |  2 +-
 drivers/vfio/fsl-mc/vfio_fsl_mc.c             |  2 +-
 drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c        |  4 ++--
 .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c    |  4 ++--
 drivers/vfio/pci/mlx5/cmd.c                   | 17 +++++++++--------
 drivers/vfio/pci/mlx5/main.c                  | 19 ++++++++++---------
 drivers/vfio/pci/vfio_pci_config.c            |  6 +++---
 drivers/vfio/pci/vfio_pci_core.c              |  7 ++++---
 drivers/vfio/pci/vfio_pci_igd.c               |  2 +-
 drivers/vfio/pci/vfio_pci_intrs.c             | 10 ++++++----
 drivers/vfio/pci/vfio_pci_rdwr.c              |  2 +-
 drivers/vfio/platform/vfio_platform_common.c  |  2 +-
 drivers/vfio/platform/vfio_platform_irq.c     |  8 ++++----
 drivers/vfio/virqfd.c                         |  2 +-
 14 files changed, 46 insertions(+), 41 deletions(-)

-- 
2.18.1


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

end of thread, other threads:[~2023-01-23 19:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-08 15:44 [PATCH V1 vfio 0/6] Move to use cgroups for userspace persistent allocations Yishai Hadas
2023-01-08 15:44 ` [PATCH V1 vfio 1/6] vfio/mlx5: Fix UBSAN note Yishai Hadas
2023-01-08 15:44 ` [PATCH V1 vfio 2/6] vfio/mlx5: Allow loading of larger images than 512 MB Yishai Hadas
2023-01-08 15:44 ` [PATCH V1 vfio 3/6] vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations Yishai Hadas
2023-01-09 15:56   ` Joao Martins
2023-01-09 16:09     ` Yishai Hadas
2023-01-09 16:21       ` Joao Martins
2023-01-08 15:44 ` [PATCH V1 vfio 4/6] vfio/hisi: " Yishai Hadas
2023-01-08 15:44 ` [PATCH V1 vfio 5/6] vfio/fsl-mc: " Yishai Hadas
2023-01-08 15:44 ` [PATCH V1 vfio 6/6] vfio/platform: " Yishai Hadas
2023-01-09 13:11 ` [PATCH V1 vfio 0/6] Move to use cgroups " Jason Gunthorpe
2023-01-17 23:38 ` Alex Williamson
2023-01-18 15:15   ` Jason Gunthorpe
2023-01-18 17:40     ` Alex Williamson
2023-01-23 15:19       ` Yishai Hadas
2023-01-23 19:37 ` Alex Williamson

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.