diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -5100,7 +5100,7 @@ pde = pmap_pdpe_to_pde(pdpe, va); if ((*pde & X86_PG_V) != 0) panic("Unexpected pde"); - pa = vm_phys_early_alloc(NBPDR, domain); + vm_phys_early_alloc_ex(NBPDR, NBPDR, -1, domain, 0, &pa); for (i = 0; i < NPDEPG; i++) dump_add_page(pa + i * PAGE_SIZE); newpdir = (pd_entry_t)(pa | X86_PG_V | X86_PG_RW | X86_PG_A | diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -3484,7 +3484,8 @@ size = round_page(size * sizeof(struct vm_page)); needed = size; size = roundup2(size, moea64_large_page_size); - pa = vm_phys_early_alloc(size, i); + vm_phys_early_alloc_ex(size, moea64_large_page_size, -1, i, 0, + &pa); vm_page_array_size += size / sizeof(struct vm_page); moea64_map_range(va, pa, size >> PAGE_SHIFT); /* Scoot up domain 0, to reduce the domain page overlap. */ diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -6456,7 +6456,8 @@ pde = pmap_l2e_to_l3e(l2e, va); if ((be64toh(*pde) & PG_V) != 0) panic("Unexpected pde %p", pde); - pa = vm_phys_early_alloc(L3_PAGE_SIZE, domain); + vm_phys_early_alloc_ex(L3_PAGE_SIZE, L3_PAGE_SIZE, 0, domain, + 0, &pa); for (i = 0; i < NPDEPG; i++) dump_add_page(pa + i * PAGE_SIZE); newl3 = (pml3_entry_t)(pa | RPTE_EAA_P | RPTE_EAA_R | RPTE_EAA_W); diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -2362,6 +2362,10 @@ * * Can't request a specific alignment, chunk, nor pass flags. In particular, it * will panic on failure. + * + * CAUTION: Contrary to the previous vm_phys_early_alloc() implementation, it + * only aligns the requested memory on PAGE_SIZE, regardless of 'alloc_size'. + * If a greater alignment is needed, use vm_phys_early_alloc_ex() instead. */ vm_paddr_t vm_phys_early_alloc(size_t alloc_size, int domain) @@ -2369,7 +2373,7 @@ vm_paddr_t res; /* This call will panic() on error. */ - vm_phys_early_alloc_ex(alloc_size, alloc_size, -1, domain, 0, &res); + vm_phys_early_alloc_ex(alloc_size, PAGE_SIZE, -1, domain, 0, &res); return (res); }