aboutsummaryrefslogtreecommitdiff
path: root/core/fast-reboot.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-03-26 15:05:59 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-03-27 00:40:50 -0500
commit8cabd06243ac077a4ca6c09424fac92941b72321 (patch)
tree3c91635af86c4074a9bb9ba988a8d2e4a5305cbe /core/fast-reboot.c
parent0ce7482fb650f3b2ffd52bbfb1546cdd8aa9117c (diff)
downloadskiboot-8cabd06243ac077a4ca6c09424fac92941b72321.zip
skiboot-8cabd06243ac077a4ca6c09424fac92941b72321.tar.gz
skiboot-8cabd06243ac077a4ca6c09424fac92941b72321.tar.bz2
core/fast-reboot: verify mem regions before fast reboot
Run the mem_region sanity checkers before proceeding with fast reboot. This is the beginning of proactive sanity checks on opal data for fast reboot (with complements the reactive disable_fast_reboot cases). This is encouraged to re-use and share any kind of debug code and unit test code. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/fast-reboot.c')
-rw-r--r--core/fast-reboot.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/core/fast-reboot.c b/core/fast-reboot.c
index 0fe16cc..6d9ce90 100644
--- a/core/fast-reboot.c
+++ b/core/fast-reboot.c
@@ -19,6 +19,7 @@
#include <fsp.h>
#include <psi.h>
#include <opal.h>
+#include <mem_region.h>
#include <xscom.h>
#include <interrupts.h>
#include <cec.h>
@@ -70,6 +71,23 @@ void disable_fast_reboot(const char *reason)
fast_reboot_disabled = reason;
}
+/*
+ * This is called by the reboot CPU after all other CPUs have been
+ * quiesced and stopped, to perform various sanity checks on firmware
+ * data (and potentially hardware), to determine whether the fast
+ * reboot should go ahead.
+ */
+static bool fast_reboot_sanity_check(void)
+{
+ if (!mem_check_all()) {
+ prlog(PR_NOTICE, "REST: Fast reboot failed due to inconsistent "
+ "firmware data\n");
+ return false;
+ }
+
+ return true;
+}
+
void fast_reboot(void)
{
struct cpu_thread *cpu;
@@ -103,8 +121,6 @@ void fast_reboot(void)
return;
}
- /* Should mem_check() all regions before allowing fast reboot? */
-
prlog(PR_NOTICE, "RESET: Initiating fast reboot %d...\n", ++fast_reboot_count);
fast_boot_release = false;
sync();
@@ -117,6 +133,11 @@ void fast_reboot(void)
return;
}
+ if (!fast_reboot_sanity_check()) {
+ opal_quiesce(QUIESCE_RESUME, -1);
+ return;
+ }
+
/*
* There is no point clearing special wakeup or un-quiesce due to
* failure after this point, because we will be going to full IPL.