Allow platform modules to set the size of large pizes, as potentially

discovered from firmware, and better handle highly-discontiguous memory
and CPU maps.

MFC after:	3 weeks
This commit is contained in:
Nathan Whitehorn 2017-11-25 22:13:19 +00:00
parent 312fb3d8dd
commit 5bcc3e4277

View File

@ -572,8 +572,10 @@ moea64_probe_large_page(void)
/* FALLTHROUGH */ /* FALLTHROUGH */
default: default:
moea64_large_page_size = 0x1000000; /* 16 MB */ if (moea64_large_page_size == 0) {
moea64_large_page_shift = 24; moea64_large_page_size = 0x1000000; /* 16 MB */
moea64_large_page_shift = 24;
}
} }
moea64_large_page_mask = moea64_large_page_size - 1; moea64_large_page_mask = moea64_large_page_size - 1;
@ -873,9 +875,9 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend
/* /*
* Calculate the last available physical address. * Calculate the last available physical address.
*/ */
Maxmem = 0;
for (i = 0; phys_avail[i + 2] != 0; i += 2) for (i = 0; phys_avail[i + 2] != 0; i += 2)
; Maxmem = max(Maxmem, powerpc_btop(phys_avail[i + 1]));
Maxmem = powerpc_btop(phys_avail[i + 1]);
/* /*
* Initialize MMU and remap early physical mappings * Initialize MMU and remap early physical mappings
@ -956,7 +958,7 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend
pa += PAGE_SIZE; pa += PAGE_SIZE;
va += PAGE_SIZE; va += PAGE_SIZE;
} }
dpcpu_init(dpcpu, 0); dpcpu_init(dpcpu, curcpu);
/* /*
* Allocate some things for page zeroing. We put this directly * Allocate some things for page zeroing. We put this directly