From patchwork Sun Sep 30 23:28:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 188204 X-Patchwork-Delegate: benh@kernel.crashing.org 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 785C92C0304 for ; Mon, 1 Oct 2012 09:49:49 +1000 (EST) Received: from quartz.orcorp.ca (quartz.orcorp.ca [184.70.90.242]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A71692C0103 for ; Mon, 1 Oct 2012 09:48:53 +1000 (EST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=uXb5YBgPscZDCR2LoNwkTvZN8bpGse3nTBzxsXWG9hU=; b=p55zl5a4m9HEr4tSwcrzQLuGg6mKmATy2y5YjKhA5CMGjDLNqPVB2rw2eOZ7YK6C5fBpULQ9dM5Ej2MFqvHtIcPexh4UxGfqcnyuEPzUv21n+BAQ+lrCDalqoURaznx3Z3avylCxQ6kJ1DMni3ntjhy613Dhj4y9VsEOFFgpQCY=; Received: from jgg by quartz.orcorp.ca with local (Exim 4.72) (envelope-from ) id 1TISwJ-00086u-Kq for linuxppc-dev@lists.ozlabs.org; Sun, 30 Sep 2012 17:28:47 -0600 Date: Sun, 30 Sep 2012 17:28:47 -0600 From: Jason Gunthorpe To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] PPC: Correct the tophys/tovirt macros Message-ID: <20120930232847.GG30637@obsidianresearch.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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" asm/page.h discusses the calculation for v2p and p2v, it should be: va = pa + KERNELBASE - PHYSICAL_START which is the same as: va = pa + LOAD_OFFSET tophys/tovirt were using PAGE_OFFSET, which as page.h says, is almost always the same thing. Signed-off-by: Jason Gunthorpe --- arch/powerpc/include/asm/ppc_asm.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index ea2a86e..44edc3a 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -461,14 +461,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) #define fromreal(rd) tovirt(rd,rd) #define tophys(rd,rs) \ -0: addis rd,rs,-PAGE_OFFSET@h; \ +0: addis rd,rs,-LOAD_OFFSET@h; \ .section ".vtop_fixup","aw"; \ .align 1; \ .long 0b; \ .previous #define tovirt(rd,rs) \ -0: addis rd,rs,PAGE_OFFSET@h; \ +0: addis rd,rs,LOAD_OFFSET@h; \ .section ".ptov_fixup","aw"; \ .align 1; \ .long 0b; \