Skip to contentSkip to conversation

Tidy up skipping PDE=>PTE mappings

PATCH New Tom St Denis 1 participant 1 message Nov 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Tidy up skipping PDE=>PTE mappings

Should fix the indentation now when a PDE entry is actually a PTE.

---
 src/lib/read_vram.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
src/lib/read_vram.c +14 -14
index 51823d71021e..89d55ff1bef6 100644
@@ -509,20 +509,20 @@ static int umr_access_vram_ai(struct umr_asic *asic, uint32_t vmid,
 				pde_fields.system        = (pde_entry >> 1) & 1;
 				pde_fields.cache         = (pde_entry >> 2) & 1;
 				pde_fields.pte           = (pde_entry >> 54) & 1;
-				if (!pde_fields.pte && memcmp(&pde_fields, &pde_array[pde_cnt], sizeof pde_fields) && asic->options.verbose)
-					fprintf(stderr, "[VERBOSE]: %s PDE%d=0x%016llx, VA=0x%012llx, PBA==0x%012llx, V=%d, S=%d, C=%d, P=%d\n",
-							&indentation[12-pde_cnt*3],
-							pde_cnt,
-							(unsigned long long)pde_entry,
-							(unsigned long long)address & va_mask,
-							(unsigned long long)pde_fields.pte_base_addr,
-							(int)pde_fields.valid,
-							(int)pde_fields.system,
-							(int)pde_fields.cache,
-							(int)pde_fields.pte);
-				memcpy(&pde_array[pde_cnt++], &pde_fields, sizeof pde_fields);
-
-				if (pde_fields.pte) {
+				if (!pde_fields.pte) {
+					if (memcmp(&pde_fields, &pde_array[pde_cnt], sizeof pde_fields) && asic->options.verbose)
+						fprintf(stderr, "[VERBOSE]: %s PDE%d=0x%016llx, VA=0x%012llx, PBA==0x%012llx, V=%d, S=%d, C=%d, P=%d\n",
+								&indentation[12-pde_cnt*3],
+								pde_cnt,
+								(unsigned long long)pde_entry,
+								(unsigned long long)address & va_mask,
+								(unsigned long long)pde_fields.pte_base_addr,
+								(int)pde_fields.valid,
+								(int)pde_fields.system,
+								(int)pde_fields.cache,
+								(int)pde_fields.pte);
+					memcpy(&pde_array[pde_cnt++], &pde_fields, sizeof pde_fields);
+				} else {
 					pte_entry = pde_entry;
 					goto pde_is_pte;
 				}
Signature · 6 lines
2.12.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx