linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: make head.S less dependent on the compile time PHYS_OFFSET define
Date: Sat, 15 Jan 2011 00:44:49 +0000	[thread overview]
Message-ID: <20110115004449.GU15996@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.2.00.1101140050070.25804@xanadu.home>

On Fri, Jan 14, 2011 at 01:18:20AM -0500, Nicolas Pitre wrote:
> On Thu, 13 Jan 2011, Russell King - ARM Linux wrote:
> 
> > On Thu, Jan 13, 2011 at 05:04:28PM -0500, Nicolas Pitre wrote:
> > > +	.macro phys_offset, rd
> > > +	mov	\rd, pc
> > > +	and	\rd, \rd, #0xf8000000
> > > +	.endm
> > 
> > We can do loads better than that, as the p2v fixup code has proven.
> > Now that r8 has been eliminated, I may rebase the p2v stuff ontop of
> > that commit, and move the computation of phys_offset out of the p2v
> > fixup code - and have it in r8 for __create_page_tables to use.
> > FYI, the real PHYS_OFFSET value can be found by (eg):
> > 
> > 1:	.long	.
> > 	.long	PAGE_OFFSET
> > 
> > 	adr	r0, 1b
> > 	ldmia	r0, {r1, r2}
> > 	sub	r1, r0, r1
> > 	add	r3, r2, r1
> > 
> > r1 now contains the offset between virtual and physical spaces, r2
> > contains the compile-time PAGE_OFFSET constant, and r3 the runtime
> > equivalent of PHYS_OFFSET.
> > 
> > None of this uses troublesome masking which will trip up on platforms
> > such as MSM - we really must stop writing code which assumes that
> > physical memory is aligned to >= 32MB.
> 
> That is more reliable indeed.  But without visibility into your reworked 
> version of that code I opted for a less intrusive solution.
> 
> Unfortunately this trick can't work for CONFIG_AUTO_ZRELADDR.

I've pushed it out under the branch p2v.  I think before this
goes upstream, "ARM: P2V: Use pv_fixup trick to get physical address"
needs merging with "ARM: P2V: make head.S use PLAT_PHYS_OFFSET" -
it doesn't really make sense to fix the same code twice for the same
underlying problem in the same patch set when it's possible to only
fix it once.

  reply	other threads:[~2011-01-15  0:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 22:04 [PATCH] ARM: make head.S less dependent on the compile time PHYS_OFFSET define Nicolas Pitre
2011-01-13 23:23 ` Russell King - ARM Linux
2011-01-14  6:18   ` Nicolas Pitre
2011-01-15  0:44     ` Russell King - ARM Linux [this message]
2011-01-15  4:49       ` Nicolas Pitre
2011-01-15 12:01         ` Russell King - ARM Linux

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=20110115004449.GU15996@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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).