public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail•com>
To: linuxppc-dev@lists•ozlabs.org, skiboot@lists•ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail•com>
Subject: [PATCH][RFC] opal: allow some opal calls to re-enter OPAL in case we take a NMI
Date: Wed, 17 Jan 2018 22:08:31 +1000	[thread overview]
Message-ID: <20180117120831.22533-2-npiggin@gmail.com> (raw)
In-Reply-To: <20180117120831.22533-1-npiggin@gmail.com>

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

      reply	other threads:[~2018-01-17 12:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 12:08 [PATCH][RFC] powerpc/powernv: Taking non-maskable interrupts in OPAL Nicholas Piggin
2018-01-17 12:08 ` Nicholas Piggin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180117120831.22533-2-npiggin@gmail.com \
    --to=npiggin@gmail$(echo .)com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=skiboot@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox