From patchwork Wed Sep 26 13:56:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10616035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BF69913 for ; Wed, 26 Sep 2018 14:00:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 161D52B01D for ; Wed, 26 Sep 2018 14:00:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13E212AFEE; Wed, 26 Sep 2018 14:00:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1EBF52AFBF for ; Wed, 26 Sep 2018 14:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XebD3Dkh6K4/QuUxeCAFUApMe2ULhSsXXa2D5zTZMC8=; b=sDIVHGCiDFQEF0cXpDwLS805IE jBkhIgSumrHgPNlAFXFr3kA2mwCRGP2fwjGFa6XYV362Qi7WPZh2ofPaCAqypUWl4Fa5eqjB8jvFM GkZaGX/jQfCxENQDiG7u2z3nSe0AWEvz1y1QApGyGPLOU6YQI2+VOpgBjLk7OU/3AMAQQTO6310gT lSWitFN/Aa977DXiZrEvGKj58MCJgN7dbAntzzAuJ4PUrR+9eLcDCvs8TDS8zMKUVniZSfhkBW1o2 aBvmFm3X3Q7iILrsbtzNoErzY/JIOxrSjDwZgGUV+8ykprYqEWie5l9dNGHDVvDuAVJxJyVBZoAUa ZNLF8rGg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5AMH-0008FW-7y; Wed, 26 Sep 2018 14:00:05 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5AJM-00077q-Dw for linux-arm-kernel@lists.infradead.org; Wed, 26 Sep 2018 13:57:38 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B35C1688; Wed, 26 Sep 2018 06:56:37 -0700 (PDT) Received: from e112298-lin.Emea.Arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0AD323F5B3; Wed, 26 Sep 2018 06:56:35 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/7] arm64: Add fast-path for stack alignment Date: Wed, 26 Sep 2018 14:56:21 +0100 Message-Id: <1537970184-44348-5-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1537970184-44348-1-git-send-email-julien.thierry@arm.com> References: <1537970184-44348-1-git-send-email-julien.thierry@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180926_065704_545743_13B8DA98 X-CRM114-Status: GOOD ( 11.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Thierry , marc.zyngier@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, christoffer.dall@arm.com, james.morse@arm.com, Dave.Martin@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Avoiding stack alignment for already aligned stack can give a small performance boost. Branch out of the aligning code when the stack is known to be aligned. Signed-off-by: Julien Thierry Acked-by: Will Deacon --- arch/arm64/kernel/entry.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 8fb66e4..bd8d52c 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -61,6 +61,10 @@ .macro force_stack_align xchg_sp x0 + + tst x0, #0xf + b.eq 0f + str x1, [x0] // store x1 far away from S_SP // aligned_sp[S_SP] = old_sp @@ -69,6 +73,11 @@ ldr x1, [x0] bic x0, x0, #0xf // x0 = aligned_sp + b 1f + +0: + str x0, [x0, #S_SP] +1: xchg_sp x0 .endm