Skip to content
Snippets Groups Projects
Commit dfbbf22f authored by Prakash Gupta's avatar Prakash Gupta Committed by Gerrit - the friendly Code Review server
Browse files

lrdp-v2: fix printout memory attributes

Fix UnboundLocalError for local variable
'attr_indx_str' referenced before assignment

----------begin IOMMU----------
!!! Exception while running IOMMU
Traceback (most recent call last):
  File "linux-ramdump-parser-v2\linux-ramdump-parser-v2\ramparse.py", line 376, in <module>
    p.cls(dump).parse()
  File "linux-ramdump-parser-v2\linux-ramdump-parser-v2\parsers\iommu.py", line 352, in parse
    parse_aarch64_tables(self.ramdump, d, domain_num)
  File "linux-ramdump-parser-v2\linux-ramdump-parser-v2\aarch64iommulib.py", line 444, in parse_aarch64_tables
    flat_mapping = create_flat_mappings(ramdump, d.pg_table, d.level)
  File "linux-ramdump-parser-v2\linux-ramdump-parser-v2\aarch64iommulib.py", line 403, in create_flat_mappings
    tmp_mapping)
  File "linux-ramdump-parser-v2\linux-ramdump-parser-v2\aarch64iommulib.py", line 336, in parse_2nd_level_table
    page_size, attr_indx, shareability, xn_bit, True)
  File "linux-ramdump-parser-v2\linux-ramdump-parser-v2\aarch64iommulib.py", line 185, in add_flat_mapping
    map = FlatMapping(virt, phy_addr, map_type_str, page_size, attr_indx_str,
UnboundLocalError: local variable 'attr_indx_str' referenced before assignment
------------end IOMMU----------

Change-Id: I604c920ef302ee9f53d31aa7a0c6edf20c25e7c9
Fixes: If05b35e7855 ("lrdp-v2: Change to printout memory attributes")
parent eceefe6d
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,7 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr,
xn_bit, mapped):
virt = (fl_idx << 39) | (sl_idx << 30) | (tl_idx << 21) | (ll_idx << 12)
map_type_str = '[R/W]'
attr_indx_str ='[]'
if map_type == LL_AP_RO:
map_type_str = '[RO]'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment