summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2023-10-29 14:37:51 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2023-10-29 14:37:51 -0400
commitc3d6f2c852eb046e9d4f4f1e6527b52c746b2693 (patch)
tree8314d74496c914219f2bfa5cbf59039a377a250b
parentb70849d1ce67a58f9f69b37dc62122f789f4cdf7 (diff)
Print Ampere+ device_info fields with correct offsets/widthsarchive/bh4-wip
Everything now has been checked against how nvgpu handles it
-rw-r--r--device_info_procfs.c21
-rw-r--r--nvdebug.h10
2 files changed, 21 insertions, 10 deletions
diff --git a/device_info_procfs.c b/device_info_procfs.c
index e94bef5..b139c36 100644
--- a/device_info_procfs.c
+++ b/device_info_procfs.c
@@ -156,23 +156,30 @@ static int device_info_file_seq_show_ga100(struct seq_file *s, void *iter_raw) {
156 } 156 }
157 157
158 // Parse and print the data 158 // Parse and print the data
159 // Note: The goal of this interface is to present useful information to
160 // a human user, NOT to provide a stable format for scripts to parse.
161 // Because of this, we favor accurately printing the data in each entry,
162 // rather than providing stable (if imperfectly correct) field names
159 switch(iter->type_of_next_entry) { 163 switch(iter->type_of_next_entry) {
160 case 0: 164 case 0:
161 seq_printf(s, "| instance %d\n", curr_info.inst_id); 165 seq_printf(s, "| Engine Type: %3d (", curr_info.engine_type);
162 seq_printf(s, "| Fault ID: %3d\n", curr_info.fault_id);
163 seq_printf(s, "| Engine Type: %2d (", curr_info.engine_type);
164 if (curr_info.engine_type < ENGINE_TYPES_LEN) 166 if (curr_info.engine_type < ENGINE_TYPES_LEN)
165 seq_printf(s, "%s)\n", ENGINE_TYPES_NAMES[curr_info.engine_type]); 167 seq_printf(s, "%s)\n", ENGINE_TYPES_NAMES[curr_info.engine_type]);
166 else 168 else
167 seq_printf(s, "Unknown, introduced post-Lovelace)\n"); 169 seq_printf(s, "Unknown, introduced post-Lovelace)\n");
170 seq_printf(s, "| instance %d\n", curr_info.inst_id);
171 seq_printf(s, "| Fault ID: %4d\n", curr_info.fault_id);
168 break; 172 break;
169 case 1: 173 case 1:
170 seq_printf(s, "| BAR0 Base %#.8x\n", curr_info.pri_base << 12); 174 seq_printf(s, "| BAR0 Base %#.8x\n", curr_info.pri_base << 8);
171 seq_printf(s, "| Reset ID: %2d\n", curr_info.reset_enum); 175 seq_printf(s, "| Reset ID: %3d\n", curr_info.reset_id);
176 seq_printf(s, "| Is Engine: %1d\n", curr_info.is_engine);
177
172 break; 178 break;
173 case 2: 179 case 2:
174 seq_printf(s, "| Host's Engine ID: %2d\n", curr_info.engine_enum); 180 seq_printf(s, "| Runlist Eng. ID: %1d\n", curr_info.rleng_id);
175 seq_printf(s, "| Runlist ID: %2d\n", curr_info.runlist_enum); 181 // Theoretically, we could extract an ID from the runlist RAM
182 seq_printf(s, "| RL Base: %#.8x\n", curr_info.runlist_pri_base << 10);
176 break; 183 break;
177 default: 184 default:
178 printk(KERN_WARNING "[nvdebug] Skipping unexpected continuation of device_info entry (idx: %d, raw: %#0x)\n", iter->idx, curr_info.raw); 185 printk(KERN_WARNING "[nvdebug] Skipping unexpected continuation of device_info entry (idx: %d, raw: %#0x)\n", iter->idx, curr_info.raw);
diff --git a/nvdebug.h b/nvdebug.h
index e91763e..d882124 100644
--- a/nvdebug.h
+++ b/nvdebug.h
@@ -567,7 +567,9 @@ static const char* const ENGINE_TYPES_NAMES[ENGINE_TYPES_LEN] = {
567 "FLA: Fabric Logical Addressing", 567 "FLA: Fabric Logical Addressing",
568}; 568};
569 569
570// These field are from nvgpu/include/nvgpu/hw/ga100/hw_top_ga100.h
570typedef union { 571typedef union {
572 // _info type fields
571 struct { 573 struct {
572 uint32_t fault_id:11; 574 uint32_t fault_id:11;
573 uint32_t padding0:5; 575 uint32_t padding0:5;
@@ -575,22 +577,24 @@ typedef union {
575 enum ENGINE_TYPES engine_type:7; // "type_enum" 577 enum ENGINE_TYPES engine_type:7; // "type_enum"
576 bool has_next_entry:1; 578 bool has_next_entry:1;
577 } __attribute__((packed)); 579 } __attribute__((packed));
580 // _info2 type fields
578 struct { 581 struct {
579 uint32_t reset_enum:8; // "reset_id" 582 uint32_t reset_id:8;
580 uint32_t pri_base:18; // "device_pri_base" 583 uint32_t pri_base:18; // "device_pri_base"
581 uint32_t padding1:4; 584 uint32_t padding1:4;
582 uint32_t is_engine:1; 585 uint32_t is_engine:1;
583 uint32_t padding2:1; 586 uint32_t padding2:1;
584 } __attribute__((packed)); 587 } __attribute__((packed));
585 struct { 588 struct {
586 uint32_t engine_enum:2; // "rleng_id" 589 uint32_t rleng_id:2;
587 uint32_t padding3:8; 590 uint32_t padding3:8;
588 uint32_t runlist_enum:16; // "runlist_pri_base" 591 uint32_t runlist_pri_base:16;
589 uint32_t padding4:6; 592 uint32_t padding4:6;
590 } __attribute__((packed)); 593 } __attribute__((packed));
591 uint32_t raw; 594 uint32_t raw;
592} ptop_device_info_ga100_t; 595} ptop_device_info_ga100_t;
593 596
597// These field are from open-gpu-doc/manuals/volta/gv100/dev_top.ref.txt
594typedef union { 598typedef union {
595 // DATA type fields 599 // DATA type fields
596 struct { 600 struct {