Skip to content

Move to use cgroups for userspace persistent allocations

Yishai Hadas kvm llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6vfio/mlx5: Fix UBSAN notedrivers/vfio/pci/mlx5/cmd.c+3 -30 replies
2/6vfio/mlx5: Allow loading of larger images than 512 MBdrivers/vfio/pci/mlx5/cmd.c drivers/vfio/pci/mlx5/main.c+16 -141 reply
3/6vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocationsdrivers/vfio/container.c drivers/vfio/pci/vfio_pci_config.c drivers/vfio/pci/vfio_pci_core.c +4 more+17 -140 replies
4/6vfio/hisi: Use GFP_KERNEL_ACCOUNT for userspace persistent allocationsdrivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c+2 -20 replies
5/6vfio/fsl-mc: Use GFP_KERNEL_ACCOUNT for userspace persistent allocationsdrivers/vfio/fsl-mc/vfio_fsl_mc.c drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c+3 -30 replies
6/6vfio/platform: Use GFP_KERNEL_ACCOUNT for userspace persistent allocationsdrivers/vfio/platform/vfio_platform_common.c drivers/vfio/platform/vfio_platform_irq.c+5 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH vfio 0/6] Move to use cgroups for userspace persistent allocations

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

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(-)
Signature · 1 line
2.18.1