aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-01-11 06:22:18 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-01-21 11:42:12 -0500
commit571b14375019c3a66ef70d4d4a7083f4238aca30 (patch)
treea5e0f283bca3a46eadc5061030c30a607d9b5377 /arch/arm/kernel
parent1096813131dcfd7d86f156c14b43eb0fdbc090b6 (diff)
ARM: ignore memory below PHYS_OFFSET
If the kernel is loaded higher in physical memory than normal, and we calculate PHYS_OFFSET higher than the start of RAM, this leads to boot problems as we attempt to map part of this RAM into userspace. Rather than struggle with this, just truncate the mapping. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/setup.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 7a2dd4689a75..061cea820e3f 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -660,6 +660,20 @@ int __init arm_add_memory(u64 start, u64 size)
660 } 660 }
661#endif 661#endif
662 662
663 if (aligned_start < PHYS_OFFSET) {
664 if (aligned_start + size <= PHYS_OFFSET) {
665 pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
666 aligned_start, aligned_start + size);
667 return -EINVAL;
668 }
669
670 pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
671 aligned_start, (u64)PHYS_OFFSET);
672
673 size -= PHYS_OFFSET - aligned_start;
674 aligned_start = PHYS_OFFSET;
675 }
676
663 bank->start = aligned_start; 677 bank->start = aligned_start;
664 bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1); 678 bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1);
665 679