summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2013-08-14 13:14:31 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-08-19 08:57:34 -0500
commit70b61b1c5a72e04461e47ea70d7a32cde6bc9dda (patch)
treea59f00c4d53ddd4f01326664e49ab1866dbf35b1
parent08d4d98624011c0a6523e0af660928be5ce112af (diff)
downloadtalos-hostboot-70b61b1c5a72e04461e47ea70d7a32cde6bc9dda.tar.gz
talos-hostboot-70b61b1c5a72e04461e47ea70d7a32cde6bc9dda.zip
Clear memstate on shutdown.
- Erase memory state once we switch to the payload so the dump tools do not try to extract Hostboot (and waste a lot of time). - Add 'limit' option to fsp-memdump that will prevent dumping more than 8MB. Change-Id: I14f553b12383de5c27aa558d706450e0eb1c844c CQ: SW219324 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5793 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-xsrc/build/debug/fsp-memdump.sh25
-rw-r--r--src/kernel/misc.C9
2 files changed, 30 insertions, 4 deletions
diff --git a/src/build/debug/fsp-memdump.sh b/src/build/debug/fsp-memdump.sh
index 75e72b9ea..ce951384c 100755
--- a/src/build/debug/fsp-memdump.sh
+++ b/src/build/debug/fsp-memdump.sh
@@ -27,12 +27,12 @@
# Print usage statement.
usage()
{
- echo "fsp-memdump.sh <filename> [STATE|discover]"
+ echo "fsp-memdump.sh <filename> [STATE|discover|limit]"
echo
echo " STATE should be a two nibble hex value corresponding to the"
- echo " MemSize enumeration in <kernel/memstate.H> or the ASCII string"
- echo " 'discover'."
- exit -1
+ echo " MemSize enumeration in <kernel/memstate.H> or the ASCII strings"
+ echo " 'discover', 'limit'."
+ exit 0
}
# @fn dump
@@ -77,6 +77,19 @@ discover()
STATE=`cipgetmempba ${state_addr_h} 1 -ox -quiet | tail -n1 | sed "s/0x//"`
}
+# @fn limit_memory
+# Limit the state to 8MB so that the memory can be dumpped in a reasonable time.
+limit_memory()
+{
+ case ${STATE} in
+ 20)
+ STATE=08
+ ;;
+ *)
+ ;;
+ esac
+}
+
# Read filename and state.
FILE=$1
STATE=$2
@@ -152,6 +165,10 @@ do
discover) # Call discover function to determine state.
discover
;;
+ limit) # Call discover function and then reduce to 8MB if bigger.
+ discover
+ limit_memory
+ ;;
*)
echo Unsupported STATE.
STATE=BREAK
diff --git a/src/kernel/misc.C b/src/kernel/misc.C
index 2cd8a48aa..07fb06e70 100644
--- a/src/kernel/misc.C
+++ b/src/kernel/misc.C
@@ -138,6 +138,15 @@ namespace KernelMisc
l_barrier->wait();
+ if (c->master)
+ {
+ // Reset the memory state register so that the dump tools
+ // don't attempt to dump all of memory once payload runs.
+ KernelMemState::setMemScratchReg(
+ KernelMemState::MEM_CONTAINED_NR,
+ KernelMemState::NO_MEM);
+ }
+
kernel_shutdown(CpuManager::getCpuCount(),
g_payload_base,
g_payload_entry,
OpenPOWER on IntegriCloud