From patchwork Wed Feb 10 11:07:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 45011 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 260EFB8112 for ; Wed, 10 Feb 2010 22:08:51 +1100 (EST) Received: by ozlabs.org (Postfix) id 03141B7D52; Wed, 10 Feb 2010 22:08:44 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1010) id F2719B7D4C; Wed, 10 Feb 2010 22:08:43 +1100 (EST) Date: Wed, 10 Feb 2010 22:07:19 +1100 From: Anton Blanchard To: benh@kernel.crashing.org Subject: [PATCH 5/6] powerpc: Fix lwsync patching code on 64bit Message-ID: <20100210110719.GE3399@kryten> References: <20100210105728.GA3399@kryten> <20100210110236.GB3399@kryten> <20100210110306.GC3399@kryten> <20100210110406.GD3399@kryten> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100210110406.GD3399@kryten> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: npiggin@suse.de, linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org do_lwsync_fixups doesn't work on 64bit, we end up writing lwsyncs to the wrong addresses: 0:mon> di c0000001000bfacc c0000001000bfacc 7c2004ac lwsync Since the lwsync section has negative offsets we need to use a signed int pointer so we sign extend the value. Signed-off-by: Anton Blanchard Index: powerpc.git/arch/powerpc/lib/feature-fixups.c =================================================================== --- powerpc.git.orig/arch/powerpc/lib/feature-fixups.c 2010-02-10 18:34:32.645573355 +1100 +++ powerpc.git/arch/powerpc/lib/feature-fixups.c 2010-02-10 18:35:18.525571521 +1100 @@ -112,7 +112,7 @@ void do_feature_fixups(unsigned long val void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end) { - unsigned int *start, *end, *dest; + int *start, *end, *dest; if (!(value & CPU_FTR_LWSYNC)) return ;