From patchwork Tue Mar 31 07:47:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 456528 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7FB41140187 for ; Tue, 31 Mar 2015 18:47:10 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4F8661A072B for ; Tue, 31 Mar 2015 18:47:10 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3AB181A0427 for ; Tue, 31 Mar 2015 18:47:06 +1100 (AEDT) Received: by ozlabs.org (Postfix, from userid 1023) id BD06814019D; Tue, 31 Mar 2015 18:47:05 +1100 (AEDT) MIME-Version: 1.0 Message-Id: <1427788021.662389.12407382643.1.gpush@pablo> To: skiboot@lists.ozlabs.org From: Jeremy Kerr Date: Tue, 31 Mar 2015 15:47:01 +0800 Cc: Michael Ellerman Subject: [Skiboot] [PATCH] external/opal-prd: Use link register for cross-endian branch X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 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" With the change to the official switch_endian system call, we lost preservation of the counter across the system call. This change uses the LR instead. It's preserved across the system call, and is going to be overwritten by the branch-and-link instruction anyway. Signed-off-by: Jeremy Kerr --- external/opal-prd/thunk.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S index 773df26..ab1e737 100644 --- a/external/opal-prd/thunk.S +++ b/external/opal-prd/thunk.S @@ -47,15 +47,15 @@ call_be: ld %r2,8(%r11) #endif - mtctr %r0 + mtlr %r0 #if __BYTE_ORDER == __LITTLE_ENDIAN /* Switch to the "other endian" */ li %r0,__NR_switch_endian sc - /* Branch to CTR */ - .long 0x2104804e /* (byteswapped bctrl) */ + /* Branch to LR */ + .long 0x2100804e /* (byteswapped blrl) */ /* Switch endian back */ .long 0x00000038 | le_si16(__NR_switch_endian)