hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
....@@ -316,12 +316,12 @@
316316 {
317317 /*
318318 * node id couldn't be 0 - the three MSB bits of
319
- * aperture shoudn't be 0
319
+ * aperture shouldn't be 0
320320 */
321321 pdd->lds_base = MAKE_LDS_APP_BASE_VI();
322322 pdd->lds_limit = MAKE_LDS_APP_LIMIT(pdd->lds_base);
323323
324
- if (!pdd->dev->device_info->needs_iommu_device) {
324
+ if (!pdd->dev->use_iommu_v2) {
325325 /* dGPUs: SVM aperture starting at 0
326326 * with small reserved space for kernel.
327327 * Set them to CANONICAL addresses.
....@@ -369,8 +369,13 @@
369369
370370 /*Iterating over all devices*/
371371 while (kfd_topology_enum_kfd_devices(id, &dev) == 0) {
372
- if (!dev) {
373
- id++; /* Skip non GPU devices */
372
+ if (!dev || kfd_devcgroup_check_permission(dev)) {
373
+ /* Skip non GPU devices and devices to which the
374
+ * current process have no access to. Access can be
375
+ * limited by placing the process in a specific
376
+ * cgroup hierarchy
377
+ */
378
+ id++;
374379 continue;
375380 }
376381
....@@ -397,10 +402,21 @@
397402 case CHIP_FIJI:
398403 case CHIP_POLARIS10:
399404 case CHIP_POLARIS11:
405
+ case CHIP_POLARIS12:
406
+ case CHIP_VEGAM:
400407 kfd_init_apertures_vi(pdd, id);
401408 break;
402409 case CHIP_VEGA10:
410
+ case CHIP_VEGA12:
411
+ case CHIP_VEGA20:
403412 case CHIP_RAVEN:
413
+ case CHIP_RENOIR:
414
+ case CHIP_ARCTURUS:
415
+ case CHIP_NAVI10:
416
+ case CHIP_NAVI12:
417
+ case CHIP_NAVI14:
418
+ case CHIP_SIENNA_CICHLID:
419
+ case CHIP_NAVY_FLOUNDER:
404420 kfd_init_apertures_v9(pdd, id);
405421 break;
406422 default:
....@@ -409,7 +425,7 @@
409425 return -EINVAL;
410426 }
411427
412
- if (!dev->device_info->needs_iommu_device) {
428
+ if (!dev->use_iommu_v2) {
413429 /* dGPUs: the reserved space for kernel
414430 * before SVM
415431 */
....@@ -432,5 +448,3 @@
432448
433449 return 0;
434450 }
435
-
436
-