From patchwork Wed Jul 11 00:34:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 170323 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 9756F2C0347 for ; Wed, 11 Jul 2012 10:35:47 +1000 (EST) Received: from am1outboundpool.messaging.microsoft.com (am1ehsobe003.messaging.microsoft.com [213.199.154.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8B8272C007E for ; Wed, 11 Jul 2012 10:35:20 +1000 (EST) Received: from mail120-am1-R.bigfish.com (10.3.201.239) by AM1EHSOBE002.bigfish.com (10.3.204.22) with Microsoft SMTP Server id 14.1.225.23; Wed, 11 Jul 2012 00:32:54 +0000 Received: from mail120-am1 (localhost [127.0.0.1]) by mail120-am1-R.bigfish.com (Postfix) with ESMTP id 2EF8B420164; Wed, 11 Jul 2012 00:32:54 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h944hd25hf0ah107ah) Received: from mail120-am1 (localhost.localdomain [127.0.0.1]) by mail120-am1 (MessageSwitch) id 1341966771360544_28752; Wed, 11 Jul 2012 00:32:51 +0000 (UTC) Received: from AM1EHSMHS012.bigfish.com (unknown [10.3.201.239]) by mail120-am1.bigfish.com (Postfix) with ESMTP id 562A960266; Wed, 11 Jul 2012 00:32:51 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS012.bigfish.com (10.3.207.112) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 11 Jul 2012 00:32:49 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.298.5; Tue, 10 Jul 2012 19:34:56 -0500 Received: from tyr.buserror.net ([10.214.83.133]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q6B0YttT004116; Tue, 10 Jul 2012 17:34:55 -0700 Date: Tue, 10 Jul 2012 19:34:54 -0500 From: Scott Wood To: Benjamin Herrenschmidt Subject: [PATCH] powerpc/booke: Eliminate rfi from exception entry path. Message-ID: <20120711003454.GA22757@tyr.buserror.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: freescale.com Cc: linuxppc-dev@lists.ozlabs.org, Alexander Graf , Stuart Yoder X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Unlike classic, we don't really need the MSR change to be atomic with the branch. This eliminates a trap as a KVM guest (in the absence of hardware hypervisor extensions), where mtmsr is paravirtualized but rfi is not. For a virtualized guest without any paravirtualization, this eliminates an additional two traps (SRR0/1). Signed-off-by: Scott Wood --- arch/powerpc/kernel/entry_32.S | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index ba3aeb4..6bb637c 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -193,6 +193,9 @@ transfer_to_handler_cont: lwz r11,0(r9) /* virtual address of handler */ lwz r9,4(r9) /* where to go when done */ #ifdef CONFIG_TRACE_IRQFLAGS +#ifdef CONFIG_BOOKE + mtmsr r10 +#else lis r12,reenable_mmu@h ori r12,r12,reenable_mmu@l mtspr SPRN_SRR0,r12 @@ -201,6 +204,7 @@ transfer_to_handler_cont: RFI reenable_mmu: /* re-enable mmu so we can */ mfmsr r10 +#endif /* !CONFIG_BOOKE */ lwz r12,_MSR(r1) xor r10,r10,r12 andi. r10,r10,MSR_EE /* Did EE change? */ @@ -247,11 +251,23 @@ reenable_mmu: /* re-enable mmu so we can */ mtlr r9 bctr /* jump to handler */ #else /* CONFIG_TRACE_IRQFLAGS */ +#ifdef CONFIG_BOOKE + /* + * We're not changing address space on Book E, and the extra rfi + * can hurt when virtualized without hardware support -- whereas + * mtmsr can be paravirtualized. + */ + mtmsr r10 + mtctr r11 + mtlr r9 + bctr +#else mtspr SPRN_SRR0,r11 mtspr SPRN_SRR1,r10 mtlr r9 SYNC RFI /* jump to handler, enable MMU */ +#endif /* !CONFIG_BOOKE */ #endif /* CONFIG_TRACE_IRQFLAGS */ #if defined (CONFIG_6xx) || defined(CONFIG_E500)