* [PATCH] ARM: head: fix virt/phys patching for big-endian systems
@ 2014-04-23 15:04 Will Deacon
2014-04-23 16:49 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Will Deacon @ 2014-04-23 15:04 UTC (permalink / raw)
To: linux-arm-kernel
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.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] ARM: head: fix virt/phys patching for big-endian systems
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
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2014-04-23 16:49 UTC (permalink / raw)
To: linux-arm-kernel
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-23 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).