From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25D9AC2D0A3 for ; Tue, 3 Nov 2020 18:07:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAE6320757 for ; Tue, 3 Nov 2020 18:07:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729190AbgKCSHq (ORCPT ); Tue, 3 Nov 2020 13:07:46 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:51604 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729048AbgKCSHU (ORCPT ); Tue, 3 Nov 2020 13:07:20 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4CQd6D0BfPz9v1Yn; Tue, 3 Nov 2020 19:07:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id a3DsNHL4upop; Tue, 3 Nov 2020 19:07:15 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4CQd6C6H4Jz9v1Ym; Tue, 3 Nov 2020 19:07:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id AADA28B7DB; Tue, 3 Nov 2020 19:07:17 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 5nKDdh72SaHZ; Tue, 3 Nov 2020 19:07:17 +0100 (CET) Received: from po17688vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 712F58B7D9; Tue, 3 Nov 2020 19:07:17 +0100 (CET) Received: by po17688vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 52E5666860; Tue, 3 Nov 2020 18:07:17 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v13 6/8] powerpc/vdso: Save and restore TOC pointer on PPC64 To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , nathanl@linux.ibm.com, anton@ozlabs.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, arnd@arndb.de, tglx@linutronix.de, vincenzo.frascino@arm.com, luto@kernel.org, linux-arch@vger.kernel.org Date: Tue, 3 Nov 2020 18:07:17 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On PPC64, the TOC pointer needs to be saved and restored. Suggested-by: Michael Ellerman Signed-off-by: Christophe Leroy --- v13: Using __powerpc64__ instead of CONFIG_PPC64 to exclude it from VDSO32 build on PPC64. v9: New. I'm not sure this is really needed, I can't see the VDSO C code doing anything with r2, at least on ppc64_defconfig. So I let you decide whether you take it or not. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/vdso/gettimeofday.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h b/arch/powerpc/include/asm/vdso/gettimeofday.h index 7a8eb9dfd06b..cdbd297e61b8 100644 --- a/arch/powerpc/include/asm/vdso/gettimeofday.h +++ b/arch/powerpc/include/asm/vdso/gettimeofday.h @@ -19,10 +19,16 @@ .cfi_register lr, r0 PPC_STLU r1, -PPC_MIN_STKFRM(r1) PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) +#ifdef __powerpc64__ + PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1) +#endif get_datapage r5, r0 addi r5, r5, VDSO_DATA_OFFSET bl DOTSYM(\funct) PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) +#ifdef __powerpc64__ + PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1) +#endif cmpwi r3, 0 mtlr r0 .cfi_restore lr @@ -42,10 +48,16 @@ .cfi_register lr, r0 PPC_STLU r1, -PPC_MIN_STKFRM(r1) PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) +#ifdef __powerpc64__ + PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1) +#endif get_datapage r4, r0 addi r4, r4, VDSO_DATA_OFFSET bl DOTSYM(\funct) PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) +#ifdef __powerpc64__ + PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1) +#endif crclr so mtlr r0 .cfi_restore lr -- 2.25.0