Skip to content
Snippets Groups Projects
Commit e2a36f61 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 50a2a03a on remote branch

Change-Id: I11f9d72141168de6694a8b8656ab3687dca85ade
parents 9c8548e8 50a2a03a
Branches
No related tags found
No related merge requests found
# Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. # Copyright (c) 2015-2020, 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
...@@ -1409,3 +1409,14 @@ lookuptable[("bengal", 0x64, 0x14)] = L1_ICache_KRYO2XX_GOLD() ...@@ -1409,3 +1409,14 @@ lookuptable[("bengal", 0x64, 0x14)] = L1_ICache_KRYO2XX_GOLD()
lookuptable[("bengal", 0x65, 0x14)] = L1_ICache_KRYO2XX_GOLD() lookuptable[("bengal", 0x65, 0x14)] = L1_ICache_KRYO2XX_GOLD()
lookuptable[("bengal", 0x66, 0x14)] = L1_ICache_KRYO2XX_GOLD() lookuptable[("bengal", 0x66, 0x14)] = L1_ICache_KRYO2XX_GOLD()
lookuptable[("bengal", 0x67, 0x14)] = L1_ICache_KRYO2XX_GOLD() lookuptable[("bengal", 0x67, 0x14)] = L1_ICache_KRYO2XX_GOLD()
# "scuba"
lookuptable[("scuba", 0x80, 0x14)] = L1_DCache_KRYO2XX_SILVER()
lookuptable[("scuba", 0x81, 0x14)] = L1_DCache_KRYO2XX_SILVER()
lookuptable[("scuba", 0x82, 0x14)] = L1_DCache_KRYO2XX_SILVER()
lookuptable[("scuba", 0x83, 0x14)] = L1_DCache_KRYO2XX_SILVER()
lookuptable[("scuba", 0x60, 0x14)] = L1_ICache_KYRO2XX_SILVER()
lookuptable[("scuba", 0x61, 0x14)] = L1_ICache_KYRO2XX_SILVER()
lookuptable[("scuba", 0x62, 0x14)] = L1_ICache_KYRO2XX_SILVER()
lookuptable[("scuba", 0x63, 0x14)] = L1_ICache_KYRO2XX_SILVER()
# Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. # Copyright (c) 2014-2019, 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
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
import rb_tree import rb_tree
import linux_list as llist import linux_list as llist
from mm import phys_to_virt from mm import phys_to_virt
from print_out import print_out_str
ARM_SMMU_DOMAIN = 0 ARM_SMMU_DOMAIN = 0
MSM_SMMU_DOMAIN = 1 MSM_SMMU_DOMAIN = 1
...@@ -38,47 +39,50 @@ class IommuLib(object): ...@@ -38,47 +39,50 @@ class IommuLib(object):
self.ramdump = ramdump self.ramdump = ramdump
self.domain_list = [] self.domain_list = []
root = self.ramdump.read_word('domain_root') if self.find_iommu_domains_msm_iommu():
pass
elif self.find_iommu_domains_debug_attachments():
pass
elif self.find_iommu_domains_device_core():
pass
else:
print_out_str("Unable to find any iommu domains")
list_head_attachments = self.ramdump.read_pointer( """
'iommu_debug_attachments') legacy code - pre-8996/kernel 4.4?
"""
def find_iommu_domains_msm_iommu(self):
domains = list()
root = self.ramdump.read_word('domain_root')
if root is None:
return False
if list_head_attachments is not None:
list_head_arm_addr = self.ramdump.read_structure_field(
list_head_attachments, 'struct list_head', 'prev')
list_walker = llist.ListWalker(
self.ramdump, list_head_arm_addr,
self.ramdump.field_offset('struct iommu_debug_attachment',
'list'))
list_walker.walk(list_head_attachments,
self._iommu_domain_find_default,
self.domain_list)
if root is not None:
rb_walker = rb_tree.RbTreeWalker(self.ramdump) rb_walker = rb_tree.RbTreeWalker(self.ramdump)
rb_walker.walk(root, self._iommu_domain_func, self.domain_list) rb_walker.walk(root, self._iommu_domain_func, self.domain_list)
return True
def _iommu_domain_find_default(self, node, domain_list): """
domain_ptr = self.ramdump.read_structure_field( depends on CONFIG_IOMMU_DEBUG_TRACKING
node, 'struct iommu_debug_attachment', 'domain') """
def find_iommu_domains_debug_attachments(self):
if not domain_ptr: list_head_attachments = self.ramdump.address_of(
return 'iommu_debug_attachments')
if list_head_attachments is None:
return False
if self.ramdump.field_offset('struct iommu_domain', 'priv') \ offset = self.ramdump.field_offset('struct iommu_debug_attachment',
is not None: 'list')
priv_ptr = self.ramdump.read_structure_field( list_walker = llist.ListWalker(self.ramdump, list_head_attachments, offset)
domain_ptr, 'struct iommu_domain', 'priv')
if not priv_ptr: for debug_attachment in list_walker:
return domain_ptr = self.ramdump.read_structure_field(
else: debug_attachment, 'struct iommu_debug_attachment', 'domain')
priv_ptr = None
arm_smmu_ops = self.ramdump.address_of('arm_smmu_ops') if not domain_ptr:
continue
ptr = self.ramdump.read_structure_field( ptr = self.ramdump.read_structure_field(
node, 'struct iommu_debug_attachment', 'group') debug_attachment, 'struct iommu_debug_attachment', 'group')
if ptr is not None: if ptr is not None:
dev_list = ptr + self.ramdump.field_offset( dev_list = ptr + self.ramdump.field_offset(
'struct iommu_group', 'devices') 'struct iommu_group', 'devices')
...@@ -95,11 +99,67 @@ class IommuLib(object): ...@@ -95,11 +99,67 @@ class IommuLib(object):
instead of 'iommu_group'. instead of 'iommu_group'.
""" """
ptr = self.ramdump.read_structure_field( ptr = self.ramdump.read_structure_field(
node, 'struct iommu_debug_attachment', 'dev') debug_attachment, 'struct iommu_debug_attachment', 'dev')
kobj_ptr = ptr + self.ramdump.field_offset('struct device', 'kobj') kobj_ptr = 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')
self._find_iommu_domains_arm_smmu(domain_ptr, client_name, self.domain_list)
return True
"""
will only find active iommu domains. This means it will exclude most gpu domains.
"""
def find_iommu_domains_device_core(self):
domains = set()
devices_kset = self.ramdump.read_pointer('devices_kset')
if not devices_kset:
return False
list_head = devices_kset + self.ramdump.field_offset('struct kset',
'list')
offset = self.ramdump.field_offset('struct device', 'kobj.entry')
list_walker = llist.ListWalker(self.ramdump, list_head, offset)
for dev in list_walker:
iommu_group = self.ramdump.read_structure_field(dev, 'struct device', 'iommu_group')
if not iommu_group:
continue
domain_ptr = self.ramdump.read_structure_field(iommu_group, 'struct iommu_group', 'domain')
if not domain_ptr:
continue
if domain_ptr in domains:
continue
domains.add(domain_ptr)
client_name_addr = self.ramdump.read_structure_field(dev, 'struct device', 'kobj.name')
client_name = self.ramdump.read_cstring(client_name_addr)
self._find_iommu_domains_arm_smmu(domain_ptr, client_name, self.domain_list)
return True
def _find_iommu_domains_arm_smmu(self, domain_ptr, client_name, domain_list):
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')
iommu_domain_ops = self.ramdump.read_structure_field( iommu_domain_ops = self.ramdump.read_structure_field(
domain_ptr, 'struct iommu_domain', 'ops') domain_ptr, 'struct iommu_domain', 'ops')
if iommu_domain_ops is None or iommu_domain_ops == 0: if iommu_domain_ops is None or iommu_domain_ops == 0:
......
...@@ -15,15 +15,23 @@ from print_out import print_out_str ...@@ -15,15 +15,23 @@ from print_out import print_out_str
DEFAULT_MIGRATION_NR=32 DEFAULT_MIGRATION_NR=32
DEFAULT_MIGRATION_COST=500000 DEFAULT_MIGRATION_COST=500000
def mask_bitset_pos(cpumask):
obj = [i for i in range(cpumask.bit_length()) if cpumask & (1<<i)]
if len(obj) == 0:
return None
else:
return obj
def verify_active_cpus(ramdump): def verify_active_cpus(ramdump):
core_sib_off = ramdump.field_offset('struct cpu_topology', 'core_sibling')
cpu_topology_addr = ramdump.address_of('cpu_topology') cpu_topology_addr = ramdump.address_of('cpu_topology')
cpu_topology_size = ramdump.sizeof('struct cpu_topology') cpu_topology_size = ramdump.sizeof('struct cpu_topology')
if (ramdump.kernel_version >= (4, 19, 0)): if (ramdump.kernel_version >= (4, 19, 0)):
cluster_id_off = ramdump.field_offset('struct cpu_topology', 'package_id') cluster_id_off = ramdump.field_offset('struct cpu_topology', 'package_id')
core_sib_off = ramdump.field_offset('struct cpu_topology', 'core_possible_sibling')
else: else:
cluster_id_off = ramdump.field_offset('struct cpu_topology', 'cluster_id') cluster_id_off = ramdump.field_offset('struct cpu_topology', 'cluster_id')
core_sib_off = ramdump.field_offset('struct cpu_topology', 'core_sibling')
if (ramdump.kernel_version >= (4, 9, 0)): if (ramdump.kernel_version >= (4, 9, 0)):
cpu_online_bits = ramdump.read_word('__cpu_online_mask') cpu_online_bits = ramdump.read_word('__cpu_online_mask')
...@@ -72,11 +80,14 @@ def verify_active_cpus(ramdump): ...@@ -72,11 +80,14 @@ def verify_active_cpus(ramdump):
min_req_cpus = 1 min_req_cpus = 1
if ((cluster_nr_oncpus - cluster_nr_isocpus) < min_req_cpus): if ((cluster_nr_oncpus - cluster_nr_isocpus) < min_req_cpus):
print_out_str("\n************ WARNING **************\n") print_out_str("\n" + "*" * 10 + " WARNING " + "*" * 10 + "\n")
print_out_str("\tMinimum active cpus are not available in the cluster {0}\n".format(i)) print_out_str("\tMinimum active cpus are not available in the cluster {0}\n".format(i))
print_out_str("\tCluster cpus: {0:b} Online cpus: {1:b} Isolated cpus: {2:b}\n".format(
cluster_cpus, cluster_online_cpus, cluster_isolated_cpus)) print_out_str("\tCluster cpus: {0} Online cpus: {1} Isolated cpus: {2}\n".format(
print_out_str("\n***********************************\n") mask_bitset_pos(cluster_cpus),
mask_bitset_pos(cluster_online_cpus),
mask_bitset_pos(cluster_isolated_cpus)))
print_out_str("*" * 10 + " WARNING " + "*" * 10 + "\n")
@register_parser('--sched-info', 'Verify scheduler\'s various parameter status') @register_parser('--sched-info', 'Verify scheduler\'s various parameter status')
class Schedinfo(RamParser): class Schedinfo(RamParser):
...@@ -87,20 +98,41 @@ class Schedinfo(RamParser): ...@@ -87,20 +98,41 @@ class Schedinfo(RamParser):
# verify nr_migrates # verify nr_migrates
sched_nr_migrate = self.ramdump.read_u32('sysctl_sched_nr_migrate') sched_nr_migrate = self.ramdump.read_u32('sysctl_sched_nr_migrate')
if (sched_nr_migrate != DEFAULT_MIGRATION_NR): if (sched_nr_migrate != DEFAULT_MIGRATION_NR):
print_out_str("\n************ WARNING **************\n") print_out_str("*" * 5 + " WARNING:" + "\n")
print_out_str("\t sysctl_sched_nr_migrate has changed!!\n") print_out_str("\t sysctl_sched_nr_migrate has changed!!\n")
print_out_str("\t If it is single digit, scheduler's load balancer has broken in the dump\n") print_out_str("\t If it is single digit, scheduler's load balancer has broken in the dump\n")
# verify migration cost # verify migration cost
sched_migration_cost = self.ramdump.read_u32('sysctl_sched_migration_cost') sched_migration_cost = self.ramdump.read_u32('sysctl_sched_migration_cost')
if (sched_migration_cost != DEFAULT_MIGRATION_COST): if (sched_migration_cost != DEFAULT_MIGRATION_COST):
print_out_str("\n************ WARNING **************\n") print_out_str("*" * 5 + " WARNING:" + "\n")
print_out_str("\t sysctl_sched_migration_cost has changed!!\n") print_out_str("\t sysctl_sched_migration_cost has changed!!\n")
print_out_str("\t\tDefault: 500000 and Value in dump:{0}\n".format(sched_migration_cost)) print_out_str("\t\tDefault: 500000 and Value in dump:{0}\n".format(sched_migration_cost))
# verify CFS BANDWIDTH enabled # verify CFS BANDWIDTH enabled
cfs_bandwidth_enabled = self.ramdump.read_u32('sysctl_sched_cfs_bandwidth_slice') cfs_bandwidth_enabled = self.ramdump.read_u32('sysctl_sched_cfs_bandwidth_slice')
if cfs_bandwidth_enabled is not None: if cfs_bandwidth_enabled is not None:
print_out_str("\n************ INFORMATION **************\n") print_out_str("*" * 5 + " INFORMATION:" + "\n")
print_out_str("\tCFS_BANDWIDTH is enabled in the dump!!\n") print_out_str("\tCFS_BANDWIDTH is enabled in the dump!!\n")
print_out_str("\tBandwidth slice: {0}\n".format(cfs_bandwidth_enabled)) print_out_str("\tBandwidth slice: {0}\n".format(cfs_bandwidth_enabled))
# verify rq root domain
if (self.ramdump.kernel_version >= (4, 9, 0)):
cpu_online_bits = self.ramdump.read_word('__cpu_online_mask')
else:
cpu_online_bits = self.ramdump.read_word('cpu_online_bits')
runqueues_addr = self.ramdump.address_of('runqueues')
rd_offset = self.ramdump.field_offset('struct rq', 'rd')
sd_offset = self.ramdump.field_offset('struct rq', 'sd')
def_rd_addr = self.ramdump.address_of('def_root_domain')
for cpu in (mask_bitset_pos(cpu_online_bits)):
rq_addr = runqueues_addr + self.ramdump.per_cpu_offset(cpu)
rd = self.ramdump.read_word(rq_addr + rd_offset)
sd = self.ramdump.read_word(rq_addr + sd_offset)
if rd == def_rd_addr :
print_out_str("*" * 5 + " WARNING:" + "\n")
print_out_str("Online cpu:{0} has attached to default sched root domain {1:x}\n".format(cpu, def_rd_addr))
if sd == 0 or sd == None:
print_out_str("*" * 5 + " WARNING:" + "\n")
print_out_str("Online cpu:{0} has Null sched_domain!!\n".format(cpu))
# Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. # Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are # modification, are permitted provided that the following conditions are
...@@ -837,11 +837,17 @@ lookuptable[("8998", 0x46, 0x14)] = L1_TLB_KRYO2XX_GOLD() ...@@ -837,11 +837,17 @@ lookuptable[("8998", 0x46, 0x14)] = L1_TLB_KRYO2XX_GOLD()
lookuptable[("8998", 0x47, 0x14)] = L1_TLB_KRYO2XX_GOLD() lookuptable[("8998", 0x47, 0x14)] = L1_TLB_KRYO2XX_GOLD()
# "bengal" # "bengal"
lookuptable[("bengal", 0x20, 0x14)] = L1_TLB_A53() lookuptable[("bengal", 0x120, 0x14)] = L1_TLB_A53()
lookuptable[("bengal", 0x21, 0x14)] = L1_TLB_A53() lookuptable[("bengal", 0x121, 0x14)] = L1_TLB_A53()
lookuptable[("bengal", 0x22, 0x14)] = L1_TLB_A53() lookuptable[("bengal", 0x122, 0x14)] = L1_TLB_A53()
lookuptable[("bengal", 0x23, 0x14)] = L1_TLB_A53() lookuptable[("bengal", 0x123, 0x14)] = L1_TLB_A53()
lookuptable[("bengal", 0x24, 0x14)] = L1_TLB_KRYO2XX_GOLD() lookuptable[("bengal", 0x124, 0x14)] = L1_TLB_KRYO2XX_GOLD()
lookuptable[("bengal", 0x25, 0x14)] = L1_TLB_KRYO2XX_GOLD() lookuptable[("bengal", 0x125, 0x14)] = L1_TLB_KRYO2XX_GOLD()
lookuptable[("bengal", 0x26, 0x14)] = L1_TLB_KRYO2XX_GOLD() lookuptable[("bengal", 0x126, 0x14)] = L1_TLB_KRYO2XX_GOLD()
lookuptable[("bengal", 0x27, 0x14)] = L1_TLB_KRYO2XX_GOLD() lookuptable[("bengal", 0x127, 0x14)] = L1_TLB_KRYO2XX_GOLD()
# "scuba"
lookuptable[("scuba", 0x120, 0x14)] = L1_TLB_A53()
lookuptable[("scuba", 0x121, 0x14)] = L1_TLB_A53()
lookuptable[("scuba", 0x122, 0x14)] = L1_TLB_A53()
lookuptable[("scuba", 0x123, 0x14)] = L1_TLB_A53()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment