[PATCH 2/2] drm/amdkfd: set attribute access for default ranges

Alex Sierra alex.sierra at amd.com
Wed Apr 21 19:40:55 UTC 2021


Attribute access value for default ranges is set, based on
process xnack on/off.
XNACK ON has GPU access attribute for unregistered ranges through page
fault. While XNACK OFF has no access attribute for unregistered ranges.

Signed-off-by: Alex Sierra <alex.sierra at amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 99dfbd2dc164..783a889c5047 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -2963,12 +2963,11 @@ svm_range_get_attr(struct kfd_process *p, uint64_t start, uint64_t size,
 		pr_debug("range attrs not found return default values\n");
 		svm_range_set_default_attributes(&location, &prefetch_loc,
 						 &granularity, &flags);
-		/* TODO: Automatically create SVM ranges and map them on
-		 * GPU page faults
 		if (p->xnack_enabled)
 			bitmap_fill(bitmap_access, MAX_GPU_INSTANCE);
-		 */
-
+		else
+			bitmap_zero(bitmap_access, MAX_GPU_INSTANCE);
+		bitmap_zero(bitmap_aip, MAX_GPU_INSTANCE);
 		goto fill_values;
 	}
 	bitmap_fill(bitmap_access, MAX_GPU_INSTANCE);
-- 
2.17.1



More information about the amd-gfx mailing list