Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299275
b: refs/heads/master
c: e5ab858
h: refs/heads/master
i:
  299273: 244a67f
  299271: d0fe8f5
v: v3
  • Loading branch information
Will Deacon authored and Russell King committed Apr 15, 2012
1 parent bf96797 commit 8d4f411
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f85550347f51c79a917b2aec04c90691c11e20a
refs/heads/master: e5ab85800820edd907d3f43f285e1232f84d5a41
16 changes: 15 additions & 1 deletion trunk/arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,21 @@ int __init arm_add_memory(phys_addr_t start, unsigned long size)
*/
size -= start & ~PAGE_MASK;
bank->start = PAGE_ALIGN(start);
bank->size = size & PAGE_MASK;

#ifndef CONFIG_LPAE
if (bank->start + size < bank->start) {
printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in "
"32-bit physical address space\n", (long long)start);
/*
* To ensure bank->start + bank->size is representable in
* 32 bits, we use ULONG_MAX as the upper limit rather than 4GB.
* This means we lose a page after masking.
*/
size = ULONG_MAX - bank->start;
}
#endif

bank->size = size & PAGE_MASK;

/*
* Check whether this memory region has non-zero size or
Expand Down

0 comments on commit 8d4f411

Please sign in to comment.