linux-uconsole/drivers/vfio
Sumit Semwal 9fd9e14363 vfio/spapr: Postpone allocation of userspace version of TCE table
From: Alexey Kardashevskiy <aik@ozlabs.ru>

[ Upstream commit 39701e56f5 ]

The iommu_table struct manages a hardware TCE table and a vmalloc'd
table with corresponding userspace addresses. Both are allocated when
the default DMA window is created and this happens when the very first
group is attached to a container.

As we are going to allow the userspace to configure container in one
memory context and pas container fd to another, we have to postpones
such allocations till a container fd is passed to the destination
user process so we would account locked memory limit against the actual
container user constrainsts.

This postpones the it_userspace array allocation till it is used first
time for mapping. The unmapping patch already checks if the array is
allocated.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-30 09:35:20 +02:00
..
pci vfio/pci: Fix NULL pointer oops in error interrupt setup handling 2016-09-07 08:32:37 +02:00
platform vfio: fix ioctl error handling 2016-03-09 15:34:50 -08:00
Kconfig Revert: "vfio: Include No-IOMMU mode" 2015-12-04 08:38:42 -07:00
Makefile vfio: Split virqfd into a separate module for vfio bus drivers 2015-03-17 08:33:38 -06:00
vfio.c Revert: "vfio: Include No-IOMMU mode" 2015-12-04 08:38:42 -07:00
vfio_iommu_spapr_tce.c vfio/spapr: Postpone allocation of userspace version of TCE table 2017-03-30 09:35:20 +02:00
vfio_iommu_type1.c vfio: fix ioctl error handling 2016-03-09 15:34:50 -08:00
vfio_spapr_eeh.c drivers/vfio: Support EEH error injection 2015-05-12 20:33:35 +10:00
virqfd.c vfio: Split virqfd into a separate module for vfio bus drivers 2015-03-17 08:33:38 -06:00