drm/nouveau/svm: map pages after migration
authorRalph Campbell <rcampbell@nvidia.com>
Wed, 4 Mar 2020 00:13:39 +0000 (16:13 -0800)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 22 May 2020 01:13:49 +0000 (11:13 +1000)
commite3d8b08904694e9ccae5163d0bb7d35fa66e5bdc
tree8f7d8263200f78977c57bd1bf3f32c1123bfc6ca
parent9c1c08a68dcdea3a933948b4e7927bdbc56aac4c
drm/nouveau/svm: map pages after migration

When memory is migrated to the GPU, it is likely to be accessed by GPU
code soon afterwards. Instead of waiting for a GPU fault, map the
migrated memory into the GPU page tables with the same access permissions
as the source CPU page table entries. This preserves copy on write
semantics.

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_dmem.c
drivers/gpu/drm/nouveau/nouveau_dmem.h
drivers/gpu/drm/nouveau/nouveau_svm.c
drivers/gpu/drm/nouveau/nouveau_svm.h