Thread (2 messages) flat view 2 messages, 1 author, 2018-01-17
DORMANTno replies

[PATCH][RFC] opal: allow some opal calls to re-enter OPAL in case we take a NMI

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2018-01-17 12:08:31
Subsystem: the rest · Maintainer: Linus Torvalds

I'm not sure if I like this, as said in the other mail. Seems a bit
arbitrary. I wouldn't mind making a single special opal call,
OPAL_MAYDAY, which is allowed through the reentrancy check, stops
all other CPUs, prints some opal backtraces, then allows the remaining
CPU to issue more OPAL calls, so we can print the Linux console out,
reboot, etc.

That would require kernel change, so maybe we can do something like
this for older kernels.
---
 core/opal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/opal.c b/core/opal.c
index fd69359c4..d0dd5b3b3 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -145,7 +145,8 @@ int64_t opal_entry_check(struct stack_frame *eframe)
 	if (!opal_quiesce_state && cpu->in_opal_call) {
 		printf("CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=%04lx cpu @%p -> pir=%04x token=%llu\n",
 		       mfspr(SPR_PIR), cpu, cpu->pir, token);
-		if (token != OPAL_CEC_REBOOT &&
+		if (token != OPAL_QUIESCE &&
+				token != OPAL_CEC_REBOOT &&
 				token != OPAL_CEC_POWER_DOWN &&
 				token != OPAL_CEC_REBOOT2 &&
 				token != OPAL_SIGNAL_SYSTEM_RESET)
-- 
2.15.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help