Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145827586
D48637.id150702.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D48637.id150702.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D48637: vm_phys_early_alloc(): Align to PAGE_SIZE; Review callers' alignment
Attached
Detach File
Event Timeline
Log In to Comment