[Skiboot] [PATCH] opal: Fix corruption of OPAL call return value in opal_exit_check()

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Dec 7 04:13:21 AEDT 2017


The new opal_exit_check needs to return retval otherwise
r3 gets clobbered in debug builds.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 core/opal.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/opal.c b/core/opal.c
index 193dc898..d33d527c 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)



More information about the Skiboot mailing list