From patchwork Thu Apr 9 08:21:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 6184141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AC2FEBF4A6 for ; Thu, 9 Apr 2015 08:24:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BCE04203C0 for ; Thu, 9 Apr 2015 08:24:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98B9C203DA for ; Thu, 9 Apr 2015 08:24:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yg7ig-0003D4-PY; Thu, 09 Apr 2015 08:21:50 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yg7id-0002xz-CB for linux-arm-kernel@lists.infradead.org; Thu, 09 Apr 2015 08:21:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=E5s23JWZ7quS4lxOws73Ln6HpPBJ1p/WwlwwKQqibAo=; b=fOMRQqibGhJoXIxAQnW4Fa+1AhXTZfP56nGRsYeNW7Rh74R2Vu9r6ziAg9mEefJWBBovo4uwh2+p9KyJLWuiieIIz7oeeJpnpryh02jrdxnOrZr99AhDtW1amEs8sIumchn3hv65lV4tvsc4ED2Ga2M5BcviCVw2a7AZJ4e6+Sk=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:54282) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Yg7iB-0001XM-VM; Thu, 09 Apr 2015 09:21:20 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1Yg7i8-0005Wx-SL; Thu, 09 Apr 2015 09:21:16 +0100 Date: Thu, 9 Apr 2015 09:21:16 +0100 From: Russell King - ARM Linux To: Arnd Bergmann Subject: Re: [PATCH 4/7] ARM: cache-v7: optimise branches in v7_flush_cache_louis Message-ID: <20150409082116.GV12732@n2100.arm.linux.org.uk> References: <20150403100848.GZ24899@n2100.arm.linux.org.uk> <2570741.Vc3c6Ovx3m@wuerfel> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2570741.Vc3c6Ovx3m@wuerfel> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150409_012147_720921_3EF6C4AB X-CRM114-Status: GOOD ( 16.32 ) X-Spam-Score: -0.1 (/) Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Apr 09, 2015 at 10:13:06AM +0200, Arnd Bergmann wrote: > On Friday 03 April 2015 11:54:32 Russell King wrote: > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > index 5b5d0c00bca7..793d061b4dce 100644 > > --- a/arch/arm/mm/cache-v7.S > > +++ b/arch/arm/mm/cache-v7.S > > @@ -93,17 +93,18 @@ ENTRY(v7_flush_dcache_louis) > > ALT_SMP(mov r3, r0, lsr #20) @ move LoUIS into position > > ALT_UP( mov r3, r0, lsr #26) @ move LoUU into position > > ands r3, r3, #7 << 1 @ extract LoU*2 field from clidr > > + bne start_flush_levels @ LoU != 0, start flushing > > #ifdef CONFIG_ARM_ERRATA_643719 > > - ALT_SMP(mrceq p15, 0, r2, c0, c0, 0) @ read main ID register > > - ALT_UP(reteq lr) @ LoUU is zero, so nothing to do > > - movweq r1, #:lower16:0x410fc090 @ ID of ARM Cortex A9 r0p? > > - movteq r1, #:upper16:0x410fc090 > > - biceq r2, r2, #0x0000000f @ clear minor revision number > > - teqeq r2, r1 @ test for errata affected core and if so... > > - moveqs r3, #1 << 1 @ fix LoUIS value (and set flags state to 'ne') > > +ALT_SMP(mrc p15, 0, r2, c0, c0, 0) @ read main ID register > > +ALT_UP( ret lr) @ LoUU is zero, so nothing to do > > + movw r1, #:lower16:0x410fc090 @ ID of ARM Cortex A9 r0p? > > With this in linux-next, I get a build failure on randconfig kernels with > THUMB2_KERNEL enabled: > > arch/arm/mm/cache-v7.S: Assembler messages: > arch/arm/mm/cache-v7.S:99: Error: ALT_UP() content must assemble to exactly 4 bytes > > Any idea for a method that will work with all combinations of SMP/UP > and ARM/THUMB? The best I could come up with was to add an extra 'mov r0,r0', > but that gets rather ugly as you then have to do it only for THUMB2. How about we make ALT_UP() add the additional padding? Something like this maybe? Acked-by: Arnd Bergmann diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index f67fd3afebdf..79f421796aab 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -237,6 +237,9 @@ .pushsection ".alt.smp.init", "a" ;\ .long 9998b ;\ 9997: instr ;\ + .if . - 9997b == 2 ;\ + nop ;\ + .endif .if . - 9997b != 4 ;\ .error "ALT_UP() content must assemble to exactly 4 bytes";\ .endif ;\