diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2018-03-16 20:15:16 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-03-22 22:53:01 -0700 |
commit | 1312e82d84e3b73dccfa1fe7021e8869cae28440 (patch) | |
tree | 733e4d2b191462c3d568c3844bfbec83c8f12a98 | |
parent | 4a136d2cfcad5afc04be30ba1d6412e87fcdf11d (diff) | |
download | skiboot-1312e82d84e3b73dccfa1fe7021e8869cae28440.zip skiboot-1312e82d84e3b73dccfa1fe7021e8869cae28440.tar.gz skiboot-1312e82d84e3b73dccfa1fe7021e8869cae28440.tar.bz2 |
core/opal: allow some re-entrant calls
This allows a small number of OPAL calls to succeed despite re-entering
the firmware, and rejects others rather than aborting.
This allows a system reset interrupt that interrupts OPAL to do something
useful. Sreset other CPUs, use the console, which allows xmon to work or
stack traces to be printed, reboot the system.
Use OPAL_INTERNAL_ERROR when rejecting, rather than OPAL_BUSY, which is
used for many other things that does not mean a serious permanent error.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
(cherry picked from commit 82fd5d06beee81b7f219937f3ed311c42b1eb3d8)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/opal.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/core/opal.c b/core/opal.c index ebb35fd..0d06e31 100644 --- a/core/opal.c +++ b/core/opal.c @@ -143,9 +143,22 @@ int64_t opal_entry_check(struct stack_frame *eframe) return opal_bad_token(token); 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); - abort(); + switch (token) { + case OPAL_CONSOLE_READ: + case OPAL_CONSOLE_WRITE: + case OPAL_CONSOLE_WRITE_BUFFER_SPACE: + case OPAL_CONSOLE_FLUSH: + case OPAL_POLL_EVENTS: + case OPAL_CHECK_TOKEN: + case OPAL_CEC_REBOOT: + case OPAL_CEC_REBOOT2: + case OPAL_SIGNAL_SYSTEM_RESET: + break; + default: + printf("CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=%04lx cpu @%p -> pir=%04x token=%llu\n", + mfspr(SPR_PIR), cpu, cpu->pir, token); + return OPAL_INTERNAL_ERROR; + } } again: |