Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1244504ybl; Sun, 1 Dec 2019 23:59:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzK7xliiTFKQqQWMi1sDQtoabBXhNQujMDQ5CMFh4MDGXmyjeKeQPpe1Zu+qkc7IdxfZ5r2 X-Received: by 2002:aa7:c742:: with SMTP id c2mr3417296eds.261.1575273573202; Sun, 01 Dec 2019 23:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575273573; cv=none; d=google.com; s=arc-20160816; b=wS0UJ3JLsqT79twPUv1j6FH6zIJPctiORYvjrVcQzCv3VjOFbx4WSSd94RuExAWR+x 8+zCCa44UbJgAA/i8muWp8FoCEg/JR/TaqaKVSnLJVk2ufi8d49WjIAMJBiacF8Qd+Yo OF/sInRk7crnMAE0qdD8ghOrhFxE4FBJbx0EmnqnisGhkhsyywTLygbmZnXxMzaJbzd4 X7Pk2k3J4p92IS3qeb9jAyiSsT+zZVJD4vj7prV7qpd8srtf1xcu9mtD3mB8RfRTliL4 hy5EBMt2YgtS+N0X79d59NCo6WzMVl0xkP9UFboTuOQaJj7+qLeW2UIN3QAlZNKCTA+Y hV1A== 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=BOyz3x2j8FqwDgap1e4M4TWLLhjHOTpc8nf8rczMHLA=; b=PF6nzPdcYtNsCQZJf7Ds6oJMahlMwKnbjFSnN/3csjeS5iBkzUSVhrahe2ndrmkXGU /4CQMCNfpjBCAqovPjK7W0OYtmHZyFHEoWhbMyPtIlBpAC5BP6fnRdfEuR1XJwFE085S wyIi8lXUyQrQ29R2c0Q9RBZqtk6JuC/eOJX2TiA3mHpnYvpUrvpZkWwU1iZ8lY02Dlkk lvkTFZBqthW7QDxxOs9WmXte9qXnA7ln45PqUBVTNwNymUTnFP22CGTvuPgn2Qvq0Msg 2P+1+zHvdnGCMmQUeqsZhc+EBBmQBBrjjlnA7EHAmQji0kLbMkQl4VOg9U5oSWGpu4mL Zj6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=dBB7rcYa; 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 o18si19809865ejj.427.2019.12.01.23.59.00; Sun, 01 Dec 2019 23:59:33 -0800 (PST) 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=dBB7rcYa; 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 S1727428AbfLBH5j (ORCPT + 99 others); Mon, 2 Dec 2019 02:57:39 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:7492 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbfLBH5h (ORCPT ); Mon, 2 Dec 2019 02:57:37 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47RHXB5kv6z9txt5; Mon, 2 Dec 2019 08:57:30 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=dBB7rcYa; 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 TEHXNNCSGy1Q; Mon, 2 Dec 2019 08:57:30 +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 47RHXB4Yvnz9txsp; Mon, 2 Dec 2019 08:57:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1575273450; bh=BOyz3x2j8FqwDgap1e4M4TWLLhjHOTpc8nf8rczMHLA=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=dBB7rcYagcdpzDPv19SjvEFDXdH0yAB2KFkvaS8RBc+12wgXF73tZgEo7s1jegx37 uR7YEa4uBs+tynuo3pJBw/fQz3zdHg2OwXTiIGh3H83LRPvR2HMlm8y7FN/Vw7hQRT +oELpgdx2pWxmE5iDi7ShOXIhfsscd7QVLbWOTOw= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4292E8B79B; Mon, 2 Dec 2019 08:57:35 +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 Yi90lTl3K24X; Mon, 2 Dec 2019 08:57:35 +0100 (CET) Received: from po16098vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.103]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1DC4B8B79A; Mon, 2 Dec 2019 08:57:35 +0100 (CET) Received: by po16098vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 18A1363600; Mon, 2 Dec 2019 07:57:35 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 8/8] powerpc/vdso32: miscellaneous optimisations To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, arnd@arndb.de Date: Mon, 2 Dec 2019 07:57:35 +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 1095d818f94a..217bb630f8f9 100644 --- a/arch/powerpc/kernel/vdso32/datapage.S +++ b/arch/powerpc/kernel/vdso32/datapage.S @@ -30,11 +30,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 90b39af14383..ff5e214fec41 100644 --- a/arch/powerpc/kernel/vdso32/getcpu.S +++ b/arch/powerpc/kernel/vdso32/getcpu.S @@ -25,10 +25,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 20ae38f3a5a3..a3951567118a 100644 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S @@ -32,10 +32,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 */ @@ -43,15 +42,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) @@ -245,10 +245,10 @@ V_FUNCTION_BEGIN(__kernel_time) lwz r3,STAMP_XTIME_SEC+LOPART(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