[Skiboot] [PATCH 2/3] core/init: ensure the current thread is initialised
Oliver O'Halloran
oohall at gmail.com
Mon Sep 5 15:26:09 AEST 2016
This patch adds a check when to verify that we have initialised the
cpu_thread structure for the called in thread.
Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
core/init.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/core/init.c b/core/init.c
index 79aa048e9e2c..5900950d6552 100644
--- a/core/init.c
+++ b/core/init.c
@@ -622,6 +622,16 @@ static void copy_exception_vectors(void)
static void per_thread_sanity_checks(void)
{
+ struct cpu_thread *cpu = this_cpu();
+
+ /**
+ * @fwts-label UnknownSecondary
+ * @fwts-advice The boot CPU attampted to call in a secondary thread
+ * without initialising the corresponding cpu_thread structure. This may
+ * happen if the HDAT or devicetree reports too few threads or cores for
+ * this processor.
+ */
+ assert(cpu->state != cpu_state_no_cpu);
}
/* Called from head.S, thus no prototype. */
--
2.5.5
More information about the Skiboot
mailing list