From patchwork Wed Dec 6 17:13:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 845263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ysQDv4r5Jz9s03 for ; Thu, 7 Dec 2017 04:13:35 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ysQDv1zz1zDsGJ for ; Thu, 7 Dec 2017 04:13:35 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=permerror (mailfrom) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=benh@kernel.crashing.org; receiver=) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ysQDn11dzzDrbq for ; Thu, 7 Dec 2017 04:13:28 +1100 (AEDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id vB6HDLNP018031; Wed, 6 Dec 2017 11:13:22 -0600 Message-ID: <1512580401.2224.126.camel@kernel.crashing.org> From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Wed, 06 Dec 2017 11:13:21 -0600 X-Mailer: Evolution 3.26.2 (3.26.2-1.fc27) Mime-Version: 1.0 Subject: [Skiboot] [PATCH] opal: Fix corruption of OPAL call return value in opal_exit_check() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The new opal_exit_check needs to return retval otherwise r3 gets clobbered in debug builds. Signed-off-by: Benjamin Herrenschmidt --- 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)