Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1172558ybl; Thu, 22 Aug 2019 10:21:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWMDWuNjB9coWH90ThMk+xKIiXA66Ve8FZv+kdsy5Kk4XP98vjD7PRl5D9nB/R/2ZtBoes X-Received: by 2002:a17:90a:fe07:: with SMTP id ck7mr784608pjb.68.1566494482540; Thu, 22 Aug 2019 10:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566494482; cv=none; d=google.com; s=arc-20160816; b=x+DtGft6nVcBYpaUwkGydOeMAPH4LdL1MCI1VfW5rDWZgpcqOXhv3ZUTVMjSF0RE1p KemGqi+k+ChpCPwNzUENF/OxAyyCwxJGfqESf3VHEhhs6rfF6D8AQBayAKCNyuh/zXaB YELKMuzv/NK2xcz2iLxzsHp3FtYUSbPw8vCt/QmwyBHH1gUn93TN0UE3o19yVHp0DTMp V/0UxXIrHjWLVqU7lTwKOsfUiuqYzda+vpQMlLFU7v34FQhXNkeJVmePdFdav1JXHVMk EiH3VYO9FE/qDcrxp3Y6zaeAk+fNz00p73KvoK8iTAJBvpcIXcmm7TrPg+IQURe4WfwW 9qHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=gGn5zKI12MfYcvKD0vSwYEdB1ZM6vfMWNiGVdpDB/J8=; b=iAmgi9aq4wlS82PBHmZu4csi36tqxym+PpxyJ8sQ7L9UNvxJMGt3yy3/BaJogHS41d bRzzQa9cENxYgYDd3Je+Bd6pRVkxi0kcX2J4vLlLdmZ4g5I4r4EUYWtSrFYT2Cnr+8ru 5i1pKOOxS3Rdm5cFRQo6Dogjd4+LLMbEsSg1C9QPNLE42JpljEaXwUbKm3Aati32HHgo Ec+SI78IOyQtGEKX2/6JOieOB7LKPwu+n3YyMdWVSiokGrv8hDbcKKOPzlc39P0rlMJV 0BRHok8ybD++2c73TEJYr9EltXd/nDaW2855t0n6bBFtsqo+dsdO3c5+05QQubrObTi9 YKaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=SubWR7TI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b31si17320867pgb.128.2019.08.22.10.21.07; Thu, 22 Aug 2019 10:21:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=SubWR7TI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390066AbfHVQeN (ORCPT + 99 others); Thu, 22 Aug 2019 12:34:13 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:37707 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390042AbfHVQeL (ORCPT ); Thu, 22 Aug 2019 12:34:11 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 46DqqM6Lmxz9v0dC; Thu, 22 Aug 2019 18:34:07 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=SubWR7TI; dkim-adsp=pass; dkim-atps=neutral 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 dEgUR9WrCzhv; Thu, 22 Aug 2019 18:34:07 +0200 (CEST) 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 46DqqM5JbVz9v0d3; Thu, 22 Aug 2019 18:34:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1566491647; bh=gGn5zKI12MfYcvKD0vSwYEdB1ZM6vfMWNiGVdpDB/J8=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=SubWR7TIqg/PzZuoIcAHNxsxbfyY7qX3fbg2Ldg40vBeC6GUS0N6BdYLy2w6m7Qmi uQEnN+GtMM+PZwh3K8KpDLxYXk8QLMgaXnBu3ohz8i/PwCp0oqp5KbVE6QPrbaPw6/ HwcEwZwwmoRQbHpE9mqxFG5+o7Zauncw5mUpFAig= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 719E58B84C; Thu, 22 Aug 2019 18:34:09 +0200 (CEST) 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 Ga2Ka04W_XTm; Thu, 22 Aug 2019 18:34:09 +0200 (CEST) Received: from pc16032vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3C6A48B81D; Thu, 22 Aug 2019 18:34:09 +0200 (CEST) Received: by pc16032vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0D8AC6B730; Thu, 22 Aug 2019 16:34:09 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 8/8] powerpc/vdso32: miscellaneous optimisations To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 22 Aug 2019 16:34:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Various optimisations by inverting branches and removing redundant instructions. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/vdso32/datapage.S | 3 +-- arch/powerpc/kernel/vdso32/getcpu.S | 6 +++--- arch/powerpc/kernel/vdso32/gettimeofday.S | 18 +++++++++--------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S index d480d2d4a3fe..436b88c455d1 100644 --- a/arch/powerpc/kernel/vdso32/datapage.S +++ b/arch/powerpc/kernel/vdso32/datapage.S @@ -31,11 +31,10 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) .cfi_startproc mflr r12 .cfi_register lr,r12 - mr r4,r3 + mr. r4,r3 get_datapage r3, r0 mtlr r12 addi r3,r3,CFG_SYSCALL_MAP32 - cmpli cr0,r4,0 beqlr li r0,NR_syscalls stw r0,0(r4) diff --git a/arch/powerpc/kernel/vdso32/getcpu.S b/arch/powerpc/kernel/vdso32/getcpu.S index bde226ad904d..ac1faa8a2bfd 100644 --- a/arch/powerpc/kernel/vdso32/getcpu.S +++ b/arch/powerpc/kernel/vdso32/getcpu.S @@ -31,10 +31,10 @@ V_FUNCTION_BEGIN(__kernel_getcpu) rlwinm r7,r5,16,31-15,31-0 beq cr0,1f stw r6,0(r3) -1: beq cr1,2f - stw r7,0(r4) -2: crclr cr0*4+so +1: crclr cr0*4+so li r3,0 /* always success */ + beqlr cr1 + stw r7,0(r4) blr .cfi_endproc V_FUNCTION_END(__kernel_getcpu) diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S index c65f41c612f7..47aa44ab8bbb 100644 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S @@ -35,10 +35,9 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) mflr r12 .cfi_register lr,r12 - mr r10,r3 /* r10 saves tv */ + mr. r10,r3 /* r10 saves tv */ mr r11,r4 /* r11 saves tz */ get_datapage r9, r0 - cmplwi r10,0 /* check if tv is NULL */ beq 3f LOAD_REG_IMMEDIATE(r7, 1000000) /* load up USEC_PER_SEC */ bl __do_get_tspec@local /* get sec/usec from tb & kernel */ @@ -46,15 +45,16 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) stw r4,TVAL32_TV_USEC(r10) 3: cmplwi r11,0 /* check if tz is NULL */ - beq 1f + mtlr r12 + crclr cr0*4+so + li r3,0 + beqlr + lwz r4,CFG_TZ_MINUTEWEST(r9)/* fill tz */ lwz r5,CFG_TZ_DSTTIME(r9) stw r4,TZONE_TZ_MINWEST(r11) stw r5,TZONE_TZ_DSTTIME(r11) -1: mtlr r12 - crclr cr0*4+so - li r3,0 blr .cfi_endproc V_FUNCTION_END(__kernel_gettimeofday) @@ -248,10 +248,10 @@ V_FUNCTION_BEGIN(__kernel_time) lwz r3,STAMP_XTIME+TSPEC_TV_SEC(r9) cmplwi r11,0 /* check if t is NULL */ - beq 2f - stw r3,0(r11) /* store result at *t */ -2: mtlr r12 + mtlr r12 crclr cr0*4+so + beqlr + stw r3,0(r11) /* store result at *t */ blr .cfi_endproc V_FUNCTION_END(__kernel_time) -- 2.13.3