[Skiboot] [PATCH v3 22/29] core/opal: always verify cpu->pir on entry

Nicholas Piggin npiggin at gmail.com
Wed Nov 29 16:37:00 AEDT 2017


Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 core/opal.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

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))
-- 
2.15.0



More information about the Skiboot mailing list