Skip to content
Snippets Groups Projects
Commit a6485a35 authored by Liam Mark's avatar Liam Mark
Browse files

lrdp-v2: support for arm_smmu_domain container of iommu_domain

The arm_smmu_domain is no longer stored in the iommu_domain priv
field, from kernel version 4.1 the arm_smmu_domain is a container
of iommu_domain.

Add support for this configuration.

CRs-Fixed: 1034128
Change-Id: I949ec4a24a7dedc394aedc3e6e30e64f34ca3715
parent 4ddeef67
No related branches found
No related tags found
No related merge requests found
......@@ -59,12 +59,20 @@ class IommuLib(object):
def _iommu_domain_find_default(self, node, domain_list):
domain_ptr = self.ramdump.read_structure_field(
node, 'struct iommu_debug_attachment', 'domain')
priv_ptr = self.ramdump.read_structure_field(
domain_ptr, 'struct iommu_domain', 'priv')
if not (domain_ptr and priv_ptr):
if not domain_ptr:
return
if self.ramdump.field_offset('struct iommu_domain', 'priv') \
is not None:
priv_ptr = self.ramdump.read_structure_field(
domain_ptr, 'struct iommu_domain', 'priv')
if not priv_ptr:
return
else:
priv_ptr = None
arm_smmu_ops = self.ramdump.address_of('arm_smmu_ops')
dev_ptr = self.ramdump.read_structure_field(
......@@ -79,8 +87,14 @@ class IommuLib(object):
domain_ptr, 'struct iommu_domain', 'ops')
if iommu_domain_ops == arm_smmu_ops:
if priv_ptr is not None:
arm_smmu_domain_ptr = priv_ptr
else:
arm_smmu_domain_ptr = self.ramdump.container_of(
domain_ptr, 'struct arm_smmu_domain', 'domain')
pgtbl_ops_ptr = self.ramdump.read_structure_field(
priv_ptr, 'struct arm_smmu_domain', 'pgtbl_ops')
arm_smmu_domain_ptr, 'struct arm_smmu_domain', 'pgtbl_ops')
io_pgtable_ptr = self.ramdump.container_of(
pgtbl_ops_ptr, 'struct io_pgtable', '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