summaryrefslogtreecommitdiffstats
path: root/src/build/debug/simics-debug-framework.py
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2016-09-23 10:28:52 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-09-28 12:02:29 -0400
commit61e3ac4d305b4611afc41353b3bcdb210d05f616 (patch)
tree420c441a9d31e8f8eeb66d95ccd21d9929e0d69f /src/build/debug/simics-debug-framework.py
parentfd12782e215bd1977f4bb519fae21326dd19b993 (diff)
downloadtalos-hostboot-61e3ac4d305b4611afc41353b3bcdb210d05f616.tar.gz
talos-hostboot-61e3ac4d305b4611afc41353b3bcdb210d05f616.zip
Add support to disable hap handler for MAGIC instructions
If the HB_DISABLE_MAGIC environment variable is set to 1, we will skip all of the handling in our hap handler. Change-Id: I56e84ea160a6345497a505f7bcaeb6c8b20b60c3 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30175 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/debug/simics-debug-framework.py')
-rwxr-xr-xsrc/build/debug/simics-debug-framework.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index ff7bf0844..44fb49c51 100755
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -485,6 +485,19 @@ except:
# See src/include/arch/ppc.H for the definitions of the magic args.
# Hostboot magic args should range 7000..7999.
def magic_instruction_callback(user_arg, cpu, arg):
+ # Disable our handler if someone tells us to
+ if( os.environ.has_key('HB_DISABLE_MAGIC')
+ and (os.environ['HB_DISABLE_MAGIC'] == '1') ):
+ print 'Skipping HB magic (disabled)', arg
+ return;
+
+ # Disable our handler if we aren't inside HB part of IPL
+ # If HB is running then HRMOR==128MB (ignoring high bits)
+ # 0x40000000=1GB, 0x8000000=128MB
+ if( (getHRMOR() % 0x40000000) != 0x8000000 ):
+ print 'Skipping HB magic (outside of HB)', arg
+ return;
+
if arg == 7006: # MAGIC_SHUTDOWN
# KernelMisc::shutdown()
print "KernelMisc::shutdown() called."
@@ -650,6 +663,5 @@ rc = os.system( "rm -f tracBINARY" )
# Register the magic instruction hap handler (a callback).
SIM_hap_add_callback_range( "Core_Magic_Instruction", magic_instruction_callback, None, 7000, 7999 )
-
# Run the registration automatically whenever this script is loaded.
register_hb_debug_framework_tools()
OpenPOWER on IntegriCloud