diff mbox series

[v2,22/25] core/opal: always verify cpu->pir on entry

Message ID 20171124140834.7099-23-npiggin@gmail.com
State Superseded
Headers show
Series move direct controls out of fast-reboot, generalize them, add quiescing | expand

Commit Message

Nicholas Piggin Nov. 24, 2017, 2:08 p.m. UTC
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 core/opal.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/core/opal.c b/core/opal.c
index 4d5282791..752dd3023 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -98,11 +98,6 @@  static void opal_trace_entry(struct stack_frame *eframe __unused)
 	union trace t;
 	unsigned nargs, i;
 
-	if (this_cpu()->pir != mfspr(SPR_PIR)) {
-		printf("CPU MISMATCH ! PIR=%04lx cpu @%p -> pir=%04x\n",
-		       mfspr(SPR_PIR), this_cpu(), this_cpu()->pir);
-		abort();
-	}
 	if (eframe->gpr[0] > OPAL_LAST)
 		nargs = 0;
 	else
@@ -125,8 +120,15 @@  int64_t opal_entry_check(struct stack_frame *eframe);
 
 int64_t opal_entry_check(struct stack_frame *eframe)
 {
+	struct cpu_thread *cpu = this_cpu();
 	uint64_t token = eframe->gpr[0];
 
+	if (cpu->pir != mfspr(SPR_PIR)) {
+		printf("CPU MISMATCH ! PIR=%04lx cpu @%p -> pir=%04x token=%llu\n",
+		       mfspr(SPR_PIR), cpu, cpu->pir, token);
+		abort();
+	}
+
 	opal_trace_entry(eframe);
 
 	if (!opal_check_token(token))