]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
vfio/spapr: Postpone allocation of userspace version of TCE table
authorSumit Semwal <sumit.semwal@linaro.org>
Sat, 25 Mar 2017 16:18:13 +0000 (21:48 +0530)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 6 Apr 2017 08:25:41 +0000 (09:25 +0100)
commitc67741f77560cb6b95c6a95b6157435ede38c8b5
tree623917214a197843ed32715cf68592e7d71dc599
parent94912b93fb1c3c81f19e221dc58a03d9d9e14d9d
vfio/spapr: Postpone allocation of userspace version of TCE table

BugLink: http://bugs.launchpad.net/bugs/1677600
From: Alexey Kardashevskiy <aik@ozlabs.ru>

[ Upstream commit 39701e56f5f16ea0cf8fc9e8472e645f8de91d23 ]

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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/vfio/vfio_iommu_spapr_tce.c