Skip to content
Snippets Groups Projects
Commit 2ab0052f authored by lnx build's avatar lnx build Committed by Gerrit - the friendly Code Review server
Browse files

Merge "lrdp-v2: iommu: Fix broken iommulib.py" into opensource-tools.lnx.1.0

parents 7c75c014 028170c6
Branches
No related tags found
No related merge requests found
...@@ -154,6 +154,7 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr, ...@@ -154,6 +154,7 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr,
elif map_type == LL_AP_PR_RO: elif map_type == LL_AP_PR_RO:
map_type_str = '[P RO]' map_type_str = '[P RO]'
shareability_str = 'N/A'
if shareability != -1: if shareability != -1:
if shareability == SH_NON_SHARE: if shareability == SH_NON_SHARE:
shareability_str = 'Non-Shareable' shareability_str = 'Non-Shareable'
...@@ -163,9 +164,8 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr, ...@@ -163,9 +164,8 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr,
shareability_str = 'Outer-Shareable' shareability_str = 'Outer-Shareable'
if shareability == SH_INNER_SHARE: if shareability == SH_INNER_SHARE:
shareability_str = 'Inner-Shareable' shareability_str = 'Inner-Shareable'
else:
shareability_str = 'N/A'
attr_indx_str = 'N/A'
if attr_indx != -1: if attr_indx != -1:
if attr_indx == ATTR_IDX_NONCACHED: if attr_indx == ATTR_IDX_NONCACHED:
attr_indx_str = 'Non-Cached' attr_indx_str = 'Non-Cached'
...@@ -173,8 +173,6 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr, ...@@ -173,8 +173,6 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr,
attr_indx_str = 'Cached' attr_indx_str = 'Cached'
if attr_indx == ATTR_IDX_DEV: if attr_indx == ATTR_IDX_DEV:
attr_indx_str = 'Device' attr_indx_str = 'Device'
else:
attr_indx_str = 'N/A'
if xn_bit == 1: if xn_bit == 1:
execute_never_str = 'True' execute_never_str = 'True'
...@@ -431,7 +429,7 @@ def parse_aarch64_tables(ramdump, d, domain_num): ...@@ -431,7 +429,7 @@ def parse_aarch64_tables(ramdump, d, domain_num):
iommu_context = iommu_context or 'None attached' iommu_context = iommu_context or 'None attached'
outfile.write( outfile.write(
'IOMMU Contextttt: %s. Domain: %s' 'IOMMU Context: %s. Domain: %s'
'[L2 cache redirect for page tables is %s]\n' % ( '[L2 cache redirect for page tables is %s]\n' % (
iommu_context, d.client_name, redirect)) iommu_context, d.client_name, redirect))
outfile.write( outfile.write(
......
# Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. # Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and # it under the terms of the GNU General Public License version 2 and
...@@ -76,11 +76,22 @@ class IommuLib(object): ...@@ -76,11 +76,22 @@ class IommuLib(object):
arm_smmu_ops = self.ramdump.address_of('arm_smmu_ops') arm_smmu_ops = self.ramdump.address_of('arm_smmu_ops')
dev_ptr = self.ramdump.read_structure_field( ptr = self.ramdump.read_structure_field(
node, 'struct iommu_debug_attachment', 'group')
if ptr is not None:
dev_list = ptr + self.ramdump.field_offset(
'struct iommu_group', 'devices')
dev = self.ramdump.read_structure_field(
dev_list, 'struct list_head', 'next')
client_name = self.ramdump.read_structure_cstring(
dev, 'struct iommu_device', 'name')
else:
"""Older kernel versions have the field 'dev'
instead of 'iommu_group'.
"""
ptr = self.ramdump.read_structure_field(
node, 'struct iommu_debug_attachment', 'dev') node, 'struct iommu_debug_attachment', 'dev')
kobj_ptr = ptr + self.ramdump.field_offset('struct device', 'kobj')
kobj_ptr = dev_ptr + self.ramdump.field_offset('struct device', 'kobj')
client_name = self.ramdump.read_structure_cstring( client_name = self.ramdump.read_structure_cstring(
kobj_ptr, 'struct kobject', 'name') kobj_ptr, 'struct kobject', 'name')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment