Page MenuHomeFreeBSD

D48637.id150702.diff
No OneTemporary

D48637.id150702.diff

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);
+ pa = vm_phys_early_alloc_ex(NBPDR, NBPDR, -1, domain, 0);
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);
+ pa = vm_phys_early_alloc_ex(size, moea64_large_page_size, -1,
+ i, 0);
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);
+ pa = vm_phys_early_alloc_ex(L3_PAGE_SIZE, L3_PAGE_SIZE, -1,
+ domain, 0);
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
@@ -2373,11 +2373,15 @@
*
* 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)
{
- return (vm_phys_early_alloc_ex(alloc_size, alloc_size, -1, domain, 0));
+ return (vm_phys_early_alloc_ex(alloc_size, PAGE_SIZE, -1, domain, 0));
}
void

File Metadata

Mime Type
text/plain
Expires
Thu, Feb 26, 12:20 AM (19 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28997944
Default Alt Text
D48637.id150702.diff (2 KB)

Event Timeline