From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] PPC: Correct the tophys/tovirt macros
Date: Sun, 30 Sep 2012 17:28:47 -0600 [thread overview]
Message-ID: <20120930232847.GG30637@obsidianresearch.com> (raw)
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 <jgunthorpe@obsidianresearch.com>
---
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; \
--
1.7.4.1
next reply other threads:[~2012-09-30 23:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-30 23:28 Jason Gunthorpe [this message]
2012-10-04 11:19 ` [PATCH] PPC: Correct the tophys/tovirt macros Benjamin Herrenschmidt
2012-10-04 17:08 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120930232847.GG30637@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).