summaryrefslogtreecommitdiffstats
path: root/src/usr/runtime/fakepayload.H
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2013-03-19 10:24:12 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-03-26 14:10:21 -0500
commitb229ae320d4aa5225984699e3c89562df219bf03 (patch)
tree1f5f83b4c1c22731eea5c8bd9b531f46bb1fabae /src/usr/runtime/fakepayload.H
parent9be68869292bbfca67490e772ce59093b4ed7df7 (diff)
downloadtalos-hostboot-b229ae320d4aa5225984699e3c89562df219bf03.tar.gz
talos-hostboot-b229ae320d4aa5225984699e3c89562df219bf03.zip
Load a fake payload
Support loading a fake payload that simply naps all the threads. I am not enabling this via the simics_MACHINE.system.xml files because it causes drastic usability concerns for developers wanting to use the debug tools. When the payload is launched, the HRMOR changes, which means the debug tools no longer point at Hostboot. Change-Id: Ic899cf96af4d315f01c0ca4b7fc99e97c15d4dc1 RTC: 43029 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3642 Tested-by: Jenkins Server Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/runtime/fakepayload.H')
-rw-r--r--src/usr/runtime/fakepayload.H80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/usr/runtime/fakepayload.H b/src/usr/runtime/fakepayload.H
new file mode 100644
index 000000000..81cdce0a6
--- /dev/null
+++ b/src/usr/runtime/fakepayload.H
@@ -0,0 +1,80 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/runtime/fakepayload.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __RUNTIME_FAKEPAYLOAD_H
+#define __RUNTIME_FAKEPAYLOAD_H
+
+/** @file fakepayload.H
+ * @brief Interfaces for loading a 'fake' payload when a payload is not
+ * present.
+ *
+ * The purpose of the fake payload is to be able to exercise the Hostboot
+ * shutdown path, even when there is not a real payload.
+ *
+ * This payload will simply nap all of the processors.
+ */
+#include <stdint.h>
+#include <arch/ppc.H>
+
+namespace RUNTIME
+{
+ /** @class FakePayload
+ *
+ * @brief Handles loading of the fake payload.
+ *
+ * Places the payload into the area of memory determined by the
+ * PAYLOAD_BASE / PAYLOAD_ENTRY attributes.
+ *
+ * @note This class does not perform verification that the addresses
+ * in the attributes are actually reasonable values. It is assumed
+ * that attribute verification (ex. for SecureBoot) will be done
+ * elsewhere in a central place for all payloads.
+ */
+ class FakePayload
+ {
+ public:
+ /** Load payload into memory. */
+ static void load();
+ private:
+ /** The fake payload itself. */
+ static void payload()
+ __attribute__((no_instrument_function));
+
+ /** Size of the payload (in bytes). */
+ static const size_t size;
+
+ /** @brief Size of memory to securely erase before loading
+ * the payload.
+ *
+ * For SecureBoot we cannot trust anything the FSP has left in
+ * memory. While we're loading a payload function into memory,
+ * the FSP had access to memory and could have loaded exception
+ * handlers. We need to clear out at least this much space in
+ * order to ensure that none of the interrupt handlers could be
+ * residing in memory.
+ */
+ static const size_t safeClearArea;
+ };
+}
+
+
+#endif
OpenPOWER on IntegriCloud