drm/nouveau/nouveau: fix page fault on device private memory
authorRalph Campbell <rcampbell@nvidia.com>
Fri, 26 Jun 2020 21:03:37 +0000 (14:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:37 +0000 (10:19 +0200)
commitaf018a3f8d0c45d6cb784dab6243938f540b333c
tree5aeda45978d7331e10277143621396ea96ff6518
parentb4198ecddb87cd955aa9e024dd656af5ceaf6196
drm/nouveau/nouveau: fix page fault on device private memory

[ Upstream commit ed710a6ed797430026aa5116dd0ab22378798b69 ]

If system memory is migrated to device private memory and no GPU MMU
page table entry exists, the GPU will fault and call hmm_range_fault()
to get the PFN for the page. Since the .dev_private_owner pointer in
struct hmm_range is not set, hmm_range_fault returns an error which
results in the GPU program stopping with a fatal fault.
Fix this by setting .dev_private_owner appropriately.

Fixes: 08ddddda667b ("mm/hmm: check the device private page owner in hmm_range_fault()")
Cc: stable@vger.kernel.org
Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/nouveau/nouveau_svm.c