aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaman Sahebi <saman63@cs.unc.edu>2023-07-31 14:03:34 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2023-10-29 15:45:32 -0400
commit7fda166c68c58887a90521911228ef734c7d4e4f (patch)
tree21af5ae5dd488ed166bc932cd667e88c9a321053
parent22ce117a72c557e01950fd97e1380a4d0658ea43 (diff)
implemented GRCE to PCE mapping
-rw-r--r--nvdebug.h4
-rw-r--r--nvdebug_entry.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/nvdebug.h b/nvdebug.h
index 6aa0f11..213a786 100644
--- a/nvdebug.h
+++ b/nvdebug.h
@@ -687,7 +687,9 @@ typedef union {
687 Also see dev_ce.ref.txt of NVIDIA's open-gpu-doc for info. 687 Also see dev_ce.ref.txt of NVIDIA's open-gpu-doc for info.
688*/ 688*/
689#define NV_PTOP_SCAL_NUM_CES 0x00022444 689#define NV_PTOP_SCAL_NUM_CES 0x00022444
690//defined LCE->PCE mapping offset from nvgpu (same as ce_pce2lce_config_r(i) in nvgpu) 690//defined GRCE->CE mapping offset from nvgpu
691#define NV_GRCE_FOR_CE(i)(0x00104034+(i)*4)
692//defined LCE->PCE mapping offset from nvgpu (same as ce_pce2lce_config_r(i) in nvgpu)
691#define NV_LCE_FOR_PCE(i)(0x00104040+(i)*4) 693#define NV_LCE_FOR_PCE(i)(0x00104040+(i)*4)
692 694
693/* Physical Copy Engine (PCE) information 695/* Physical Copy Engine (PCE) information
diff --git a/nvdebug_entry.c b/nvdebug_entry.c
index e77b053..c444ff7 100644
--- a/nvdebug_entry.c
+++ b/nvdebug_entry.c
@@ -203,7 +203,7 @@ int create_tpc_mask_files(int device_id, struct proc_dir_entry *dir) {
203int __init nvdebug_init(void) { 203int __init nvdebug_init(void) {
204 struct proc_dir_entry *dir, *preempt_entry, *disable_channel_entry, 204 struct proc_dir_entry *dir, *preempt_entry, *disable_channel_entry,
205 *enable_channel_entry, *switch_to_tsg_entry, *device_info_entry, 205 *enable_channel_entry, *switch_to_tsg_entry, *device_info_entry,
206 *num_gpcs_entry, *lce_for_pce_entry; 206 *num_gpcs_entry, *lce_for_pce_entry, *grce_for_pce_entry;
207 int rl_create_err, tpc_masks_create_err; 207 int rl_create_err, tpc_masks_create_err;
208 // Check that an NVIDIA GPU is present and initialize g_nvdebug_state 208 // Check that an NVIDIA GPU is present and initialize g_nvdebug_state
209 int res = probe_and_cache_device(); 209 int res = probe_and_cache_device();
@@ -275,8 +275,15 @@ int __init nvdebug_init(void) {
275 snprintf(file_name, 20, "lce_for_pce%d",pce_id); 275 snprintf(file_name, 20, "lce_for_pce%d",pce_id);
276 lce_for_pce_entry = proc_create_data( 276 lce_for_pce_entry = proc_create_data(
277 file_name, 0444, dir, compat_ops(&nvdebug_read_reg32_file_ops), 277 file_name, 0444, dir, compat_ops(&nvdebug_read_reg32_file_ops),
278 (void*)(uintptr_t)NV_LCE_FOR_PCE(pce_id)); 278 (void*)(uintptr_t)NV_LCE_FOR_PCE(pce_id));
279 } 279 snprintf(file_name, 20, "grce_for_pce%d",pce_id);
280 grce_for_pce_entry = proc_create_data(
281 file_name, 0444, dir, compat_ops(&nvdebug_read_reg32_file_ops),
282 (void*)(uintptr_t)NV_GRCE_FOR_CE(pce_id));
283
284 if (!lce_for_pce_entry || !grce_for_pce_entry)
285 return -ENOMEM;
286 }
280 287
281 // TODO: Redo to num_pces 288 // TODO: Redo to num_pces
282 num_gpcs_entry = proc_create_data( 289 num_gpcs_entry = proc_create_data(