Skip to content
Snippets Groups Projects
Commit 028170c6 authored by Sudarshan Rajagopalan's avatar Sudarshan Rajagopalan Committed by Gerrit - the friendly Code Review server
Browse files

lrdp-v2: iommu: Fix broken iommulib.py

The struct 'iommu_debug_attachment' no longer contains
the field 'dev'. Use appropriate fields to get the
required job done.

Change-Id: I794e0d507101c6cd131da97f31b18f319125eca0
parent 4d9f4f02
No related branches found
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,
elif map_type == LL_AP_PR_RO:
map_type_str = '[P RO]'
shareability_str = 'N/A'
if shareability != -1:
if shareability == SH_NON_SHARE:
shareability_str = 'Non-Shareable'
......@@ -163,9 +164,8 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr,
shareability_str = 'Outer-Shareable'
if shareability == SH_INNER_SHARE:
shareability_str = 'Inner-Shareable'
else:
shareability_str = 'N/A'
attr_indx_str = 'N/A'
if attr_indx != -1:
if attr_indx == ATTR_IDX_NONCACHED:
attr_indx_str = 'Non-Cached'
......@@ -173,8 +173,6 @@ def add_flat_mapping(mappings, fl_idx, sl_idx, tl_idx, ll_idx, phy_addr,
attr_indx_str = 'Cached'
if attr_indx == ATTR_IDX_DEV:
attr_indx_str = 'Device'
else:
attr_indx_str = 'N/A'
if xn_bit == 1:
execute_never_str = 'True'
......@@ -431,7 +429,7 @@ def parse_aarch64_tables(ramdump, d, domain_num):
iommu_context = iommu_context or 'None attached'
outfile.write(
'IOMMU Contextttt: %s. Domain: %s'
'IOMMU Context: %s. Domain: %s'
'[L2 cache redirect for page tables is %s]\n' % (
iommu_context, d.client_name, redirect))
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
# it under the terms of the GNU General Public License version 2 and
......@@ -76,13 +76,24 @@ class IommuLib(object):
arm_smmu_ops = self.ramdump.address_of('arm_smmu_ops')
dev_ptr = self.ramdump.read_structure_field(
node, 'struct iommu_debug_attachment', 'dev')
kobj_ptr = dev_ptr + self.ramdump.field_offset('struct device', 'kobj')
client_name = self.ramdump.read_structure_cstring(
kobj_ptr, 'struct kobject', 'name')
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')
kobj_ptr = ptr + self.ramdump.field_offset('struct device', 'kobj')
client_name = self.ramdump.read_structure_cstring(
kobj_ptr, 'struct kobject', 'name')
iommu_domain_ops = self.ramdump.read_structure_field(
domain_ptr, 'struct iommu_domain', 'ops')
......
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