mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Work around problems that happen when there is ram at the end of the
physical address space.
This commit is contained in:
parent
76cbcfdcfc
commit
95181ed7ff
1 changed files with 14 additions and 0 deletions
|
|
@ -280,10 +280,24 @@ arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz)
|
|||
/*
|
||||
* Filter out the page at PA 0x00000000. The VM can't handle it, as
|
||||
* pmap_extract() == 0 means failure.
|
||||
*
|
||||
* Also filter out the page at the end of the physical address space --
|
||||
* if addr is non-zero and addr+size is zero that means we wrapped to
|
||||
* the next byte beyond what vm_paddr_t can express. The calculations
|
||||
* in vm_page_startup() are going to have the same problem, so just work
|
||||
* around it by leaving the last page out.
|
||||
*
|
||||
* XXX This just in: subtract out a whole megabyte, not just 1 page.
|
||||
* Reducing the size by anything less than 1MB results in a NULL pointer
|
||||
* deref in _vm_map_lock_read() very early in startup. Better to give
|
||||
* up a whole megabyte than leave some folks with an unusable system
|
||||
* while we investigate.
|
||||
*/
|
||||
if (pa == 0) {
|
||||
pa = PAGE_SIZE;
|
||||
sz -= PAGE_SIZE;
|
||||
} else if (pa + sz == 0) {
|
||||
sz -= 1024 * 1024;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue