linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: head: fix virt/phys patching for big-endian systems
Date: Wed, 23 Apr 2014 17:49:19 +0100	[thread overview]
Message-ID: <20140423164919.GH5649@arm.com> (raw)
In-Reply-To: <1398265448-13541-1-git-send-email-will.deacon@arm.com>

On Wed, Apr 23, 2014 at 04:04:08PM +0100, Will Deacon wrote:
> Commit e26a9e00afc4 ("ARM: Better virt_to_page() handling") reworked the
> dynamic virt/phys patching to store the physical offset of the start of
> memory as a PFN (32-bit quantity) instead of a physical address (potentially
> a 64-bit quantity). Unfortunately, some of the old code was left behind,
> causing big-endian systems to store the calculated PFN to the next word
> *after* __pv_phys_pfn_offset and causing the kernel to treat PHYS_OFFSET
> as 0x0.
> 
> This patch fixes the patching code, so that we store the 32-bit PFN offset
> to the correct address, regardless of endianness.

Aha, this was already fixed in 8033/1 which Russell has pushed out on his
fixes branch.

Sorry for the noise,

Will

> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm/kernel/head.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> index f8c08839edf3..591d6e4a6492 100644
> --- a/arch/arm/kernel/head.S
> +++ b/arch/arm/kernel/head.S
> @@ -587,7 +587,7 @@ __fixup_pv_table:
>  	add	r6, r6, r3	@ adjust __pv_phys_pfn_offset address
>  	add	r7, r7, r3	@ adjust __pv_offset address
>  	mov	r0, r8, lsr #12	@ convert to PFN
> -	str	r0, [r6, #LOW_OFFSET]	@ save computed PHYS_OFFSET to __pv_phys_pfn_offset
> +	str	r0, [r6]	@ save computed PHYS_OFFSET to __pv_phys_pfn_offset
>  	strcc	ip, [r7, #HIGH_OFFSET]	@ save to __pv_offset high bits
>  	mov	r6, r3, lsr #24	@ constant for add/sub instructions
>  	teq	r3, r6, lsl #24 @ must be 16MiB aligned
> -- 
> 1.9.2
> 

      reply	other threads:[~2014-04-23 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 15:04 [PATCH] ARM: head: fix virt/phys patching for big-endian systems Will Deacon
2014-04-23 16:49 ` Will Deacon [this message]

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=20140423164919.GH5649@arm.com \
    --to=will.deacon@arm.com \
    --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).