diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/pd_cache.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/pd_cache.c b/drivers/gpu/nvgpu/common/mm/pd_cache.c index a5b3d134..8f7003e5 100644 --- a/drivers/gpu/nvgpu/common/mm/pd_cache.c +++ b/drivers/gpu/nvgpu/common/mm/pd_cache.c | |||
@@ -423,12 +423,19 @@ static void nvgpu_pd_cache_do_free(struct gk20a *g, | |||
423 | * this just re-adds it. | 423 | * this just re-adds it. |
424 | * | 424 | * |
425 | * Since the memory used for the entries is still mapped, if | 425 | * Since the memory used for the entries is still mapped, if |
426 | * igpu make sure the entries are invalidated so that the hw | 426 | * iommu is being used, make sure PTE entries in particular |
427 | * doesn't accidentally try to prefetch non-existent fb memory. | 427 | * are invalidated so that the hw doesn't accidentally try to |
428 | * prefetch non-existent fb memory. | ||
428 | * | 429 | * |
429 | * TBD: what about dgpu? (Not supported in Drive 5.0) | 430 | * Notes: |
431 | * - The check for NVGPU_PD_CACHE_SIZE > PAGE_SIZE effectively | ||
432 | * determines whether PTE entries use the cache. | ||
433 | * - In the case where PTE entries ues the cache, we also | ||
434 | * end up invalidating the PDE entries, but that's a minor | ||
435 | * performance hit, as there are far fewer of those | ||
436 | * typically than there are PTE entries. | ||
430 | */ | 437 | */ |
431 | if (pd->mem->cpu_va != NULL) { | 438 | if (nvgpu_iommuable(g) && (NVGPU_PD_CACHE_SIZE > PAGE_SIZE)) { |
432 | memset((void *)((u64)pd->mem->cpu_va + pd->mem_offs), 0, | 439 | memset((void *)((u64)pd->mem->cpu_va + pd->mem_offs), 0, |
433 | pentry->pd_size); | 440 | pentry->pd_size); |
434 | } | 441 | } |