From patchwork Thu Jun 8 15:51:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 773359 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wk9Df1KzHz9s3w for ; Fri, 9 Jun 2017 02:02:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MMNBDWTv"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wk9Df0HsYzDqQy for ; Fri, 9 Jun 2017 02:02:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MMNBDWTv"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wk90511rdzDqMW for ; Fri, 9 Jun 2017 01:51:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MMNBDWTv"; dkim-atps=neutral Received: by mail-pf0-x242.google.com with SMTP id y7so5581474pfd.3 for ; Thu, 08 Jun 2017 08:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hRjrBIV8fK06aZ6+i6evcLRF7DXVrD/KHr4ogehjG7o=; b=MMNBDWTvvoSsxaiQm+uab9om9WIw5vtMFQraC2u1OAUpJ56WSYQPoXhCrVpixuBPPz zQLmcv81TgrFCrhmsuH8e7vhHYSmeUBwBdL3MQ1fsJWJM7svA8nDxNL/xdXP7NLNvOuY FC2FTR0vjZYwY0gYz8YCNuz0Ss4ZsEBzUmhSY8TQT42aDjbNkciZRktbEduHuOdMpt2/ OiZtM20xl0G08LybaAxq1CgQz06y6PyHyES7U2RPmEv/fngZ0xbeTMddmX+P8FgtS4mO 984EBqvpivNYLt4s18lyw2LZK/4TbN7zBfaLjA/dwRztpjLtGZnLiF3VJ9jRtNf1gXjc lT0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hRjrBIV8fK06aZ6+i6evcLRF7DXVrD/KHr4ogehjG7o=; b=kS2711wPIs9B0zmv0xh4jJLfOkMjSAX6BBDtDGYh4wluHwMw/mb9OlMswvoe9GdgpQ g4lFeKUZpveuYthaM9hToj6YDFXxw5XgU2NYJC+0SrKzRR49gH7kaS+/MEsijfig360I PxOfbo3LxvU8prvfhKIdnlNS+Cudq7JSnY0I8o/Rrsa6XsUXanOxrIlIBBy//KgcsPAP 5wExq+BQcXda+An6fyAtEkRlE0kHy0fLvy14KHggeZL96i4c7Q98FwIA9XZOLRs6oXTR yYjysSgisVFylzHwzrlM4TC5uID2gVOIo5IL2v/fQfFA8SofcjnTlewsIw0IWIw+y69C mMxQ== X-Gm-Message-State: AODbwcABnKlgf4aIMjGAl4/oCfpI6IeQ5X6oaIGzb5/M62qHuxHPrN5B IyuPhKwlJaGHM0pg X-Received: by 10.99.109.196 with SMTP id i187mr27962521pgc.56.1496937107171; Thu, 08 Jun 2017 08:51:47 -0700 (PDT) Received: from roar.au.ibm.com (14-202-185-133.tpgi.com.au. [14.202.185.133]) by smtp.gmail.com with ESMTPSA id k186sm12327286pgd.51.2017.06.08.08.51.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 08:51:46 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 06/14] powerpc/64s: interrupt replay balance the return branch predictor Date: Fri, 9 Jun 2017 01:51:05 +1000 Message-Id: <20170608155113.21300-7-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170608155113.21300-1-npiggin@gmail.com> References: <20170608155113.21300-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Gautham R . Shenoy" , Nicholas Piggin , "Shreyas B . Prabhu" Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The __replay_interrupt code is branched to with bl, but the caller is returned to directly with rfid from the interrupt. Instead return to a return stub that returns to the caller with blr, which should do better with the return predictor. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 9cc34547c3b6..52ad0789fa89 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -1646,7 +1646,7 @@ _GLOBAL(__replay_interrupt) * we don't give a damn about, so we don't bother storing them. */ mfmsr r12 - mflr r11 + LOAD_REG_ADDR(r11, __replay_interrupt_return) mfcr r9 ori r12,r12,MSR_EE cmpwi r3,0x900 @@ -1664,6 +1664,7 @@ FTR_SECTION_ELSE cmpwi r3,0xa00 beq doorbell_super_common_msgclr ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE) +__replay_interrupt_return: blr /* @@ -1673,7 +1674,7 @@ ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE) _GLOBAL(__replay_wakeup_interrupt) extrdi r3,r3,42,4 /* Get SRR1 wake reason in low bits */ mfmsr r12 - mflr r11 + LOAD_REG_ADDR(r11, __replay_wakeup_interrupt_return) mfcr r9 ori r12,r12,MSR_EE cmpwi r3,0x6 @@ -1692,4 +1693,5 @@ FTR_SECTION_ELSE beq doorbell_super_common_msgclr ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE) mtmsrd r12,1 +__replay_wakeup_interrupt_return: blr