Skip to content
Snippets Groups Projects
Commit 32dac4de authored by Kumar Harsh's avatar Kumar Harsh
Browse files

ldrp_V2 : Core context extraction if kernel executing at EL2


These changes add a new option --kernel-exception-level
which can be passed from command line to specify the
current exception level of kernel. This is to handle
a case where backtrace should get generated if kernel
is executing at EL2 instead of EL1.

Change-Id: If0d61119a6cc27e263d73ce9921a63cab4bdee45
Signed-off-by: default avatarKumar Harsh <harkumar@codeaurora.org>
parent ec023fea
No related branches found
No related tags found
No related merge requests found
......@@ -543,6 +543,7 @@ class RamDump():
self.autodump = options.autodump
self.module_table = module_table.module_table_class()
self.module_table.setup_sym_path(options.sym_path)
self.currentEL = options.currentEL or None
if self.minidump:
try:
mod = import_module('elftools.elf.elffile')
......
......@@ -120,6 +120,8 @@ if __name__ == '__main__':
parser.add_option(
'', '--force-version', type='int', dest='force_hardware_version',
help='Force the hardware detection to a specific hardware version')
parser.add_option('-l', '--kernel-exception-level', type='int',
dest='currentEL', help='Current exception level for kernel')
parser.add_option('', '--parse-qdss', action='store_true',
dest='qdss', help='Parse QDSS (deprecated)')
parser.add_option('', '--shell', action='store_true',
......
# Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
# Copyright (c) 2016-2018, 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
......@@ -243,7 +243,10 @@ class Scandump_v2():
pc = self.regs['pc']
if ram_dump.arm64:
lr = self.regs['x30']
bt = self.regs['sp_el1']
if ram_dump.currentEL == 0x2:
bt = self.regs['sp_el2']
else:
bt = self.regs['sp_el1']
fp = self.regs['x29']
else:
lr = self.regs['r14_svc']
......
# Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
# Copyright (c) 2012-2018, 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
......@@ -724,7 +724,10 @@ class TZRegDump_v2():
pc = self.core_regs.regs['pc']
if ram_dump.arm64:
lr = self.core_regs.regs['x30']
bt = self.core_regs.regs['sp_el1']
if ram_dump.currentEL == 0x2:
bt = self.core_regs.regs['sp_el2']
else:
bt = self.core_regs.regs['sp_el1']
fp = self.core_regs.regs['x29']
else:
lr = self.core_regs.regs['r14_svc']
......
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