mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: update pd clear condition to address IOMMU prefetch issue
IOMMU fault is observed with 64KB PAGE_SIZE. This is due to IOMMU prefetching stale/invalid pd entries. IOMMU can prefetch more than 4K worth of entries. Clear pd when NVGPU_PD_CACHE_SIZE is more than 4K. Bug 200719161 Change-Id: Iac2a9bcfbcfaa36840da1fa85594520a6fd4eaaf Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2521912 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
c041ad5b4b
commit
44c4611fda
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -449,7 +449,7 @@ static void nvgpu_pd_cache_do_free(struct gk20a *g,
|
||||
* fill them with zero.
|
||||
*/
|
||||
if ((nvgpu_iommuable(g)) &&
|
||||
(NVGPU_PD_CACHE_SIZE > PAGE_SIZE) &&
|
||||
(NVGPU_PD_CACHE_SIZE > NVGPU_CPU_SMALL_PAGE_SIZE) &&
|
||||
(pd->mem->cpu_va != NULL)) {
|
||||
(void)memset(((u8 *)pd->mem->cpu_va + pd->mem_offs), 0,
|
||||
pd->pd_size);
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
* PAGE_SIZE is OS specific and can vary across OSes. Depending on the OS it maybe
|
||||
* defined to 4K or 64K.
|
||||
*/
|
||||
#define NVGPU_CPU_PAGE_SIZE PAGE_SIZE
|
||||
#define NVGPU_CPU_PAGE_SIZE PAGE_SIZE
|
||||
|
||||
#define NVGPU_CPU_SMALL_PAGE_SIZE 4096U
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
||||
Reference in New Issue
Block a user