diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-06 16:56:47 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-06 01:18:13 -0600 |
commit | 0562b64e55b0e0780064823155f45b1ddf0893a6 (patch) | |
tree | b932d35a5f4fc884e31de50dd0199f0f836a04fc /core/opal.c | |
parent | 3647e9850660206f862cecad5abe62943ea727a1 (diff) | |
download | skiboot-0562b64e55b0e0780064823155f45b1ddf0893a6.zip skiboot-0562b64e55b0e0780064823155f45b1ddf0893a6.tar.gz skiboot-0562b64e55b0e0780064823155f45b1ddf0893a6.tar.bz2 |
Fix booting & OPAL call return values with DEBUG=1
On a debug build, _mcount would trash r3 and opal_exit_check
would not restore it, leaving OPAL calls returning garbage.
this fix simply preserves the return value and doesn't let
the compiler get fancy on us. We effectively just get an
extra `mr` instruction to restore r3.
Fixes: 9c565ee6bca4b665d9d1120bfff5e88ee80615bc
Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reported-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Suggested-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Tested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/opal.c')
-rw-r--r-- | core/opal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/opal.c b/core/opal.c index 193dc89..d33d527 100644 --- a/core/opal.c +++ b/core/opal.c @@ -171,9 +171,9 @@ again: return OPAL_SUCCESS; } -void opal_exit_check(int64_t retval, struct stack_frame *eframe); +int64_t opal_exit_check(int64_t retval, struct stack_frame *eframe); -void opal_exit_check(int64_t retval, struct stack_frame *eframe) +int64_t opal_exit_check(int64_t retval, struct stack_frame *eframe) { struct cpu_thread *cpu = this_cpu(); uint64_t token = eframe->gpr[0]; @@ -185,6 +185,7 @@ void opal_exit_check(int64_t retval, struct stack_frame *eframe) sync(); /* release barrier vs quiescing */ cpu->in_opal_call--; } + return retval; } int64_t opal_quiesce(uint32_t quiesce_type, int32_t cpu_target) |