Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146128694
D42734.1779275023.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D42734.1779275023.diff
View Options
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -1268,7 +1268,8 @@
pmap_bootstrap(vm_size_t kernlen)
{
vm_offset_t dpcpu, msgbufpv;
- vm_paddr_t start_pa, pa, min_pa;
+ vm_paddr_t start_pa, pa, min_pa, largest_phys;
+ size_t largest_phys_size;
int i;
/* Verify that the ASID is set through TTBR0. */
@@ -1295,12 +1296,17 @@
physmap_idx /= 2;
/*
- * Find the minimum physical address. physmap is sorted,
- * but may contain empty ranges.
+ * Find the minimum physical address and largest region.
*/
+ largest_phys = 0;
+ largest_phys_size = 0;
for (i = 0; i < physmap_idx * 2; i += 2) {
if (physmap[i] == physmap[i + 1])
continue;
+ if ((physmap[i + 1] - physmap[i]) > largest_phys_size) {
+ largest_phys = physmap[i];
+ largest_phys_size = physmap[i + 1] - physmap[i];
+ }
if (physmap[i] <= min_pa)
min_pa = physmap[i];
}
@@ -1330,6 +1336,19 @@
cpu_tlb_flushID();
+ pa = pmap_early_vtophys(bs_state.freemempos);
+ physmem_exclude_region(start_pa, pa - start_pa, EXFLAG_NOALLOC);
+
+ /* Reserve some VA space for early BIOS/ACPI mapping */
+ preinit_map_va = roundup2(bs_state.freemempos, L2_SIZE);
+
+ virtual_avail = preinit_map_va + PMAP_PREINIT_MAPPING_SIZE;
+ virtual_avail = roundup2(virtual_avail, L1_SIZE);
+ virtual_end = VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE);
+ kernel_vm_end = virtual_avail;
+
+ bs_state.freemempos = PHYS_TO_DMAP(largest_phys);
+
#define alloc_pages(var, np) \
(var) = bs_state.freemempos; \
bs_state.freemempos += (np * PAGE_SIZE); \
@@ -1343,17 +1362,8 @@
alloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE);
msgbufp = (void *)msgbufpv;
- /* Reserve some VA space for early BIOS/ACPI mapping */
- preinit_map_va = roundup2(bs_state.freemempos, L2_SIZE);
-
- virtual_avail = preinit_map_va + PMAP_PREINIT_MAPPING_SIZE;
- virtual_avail = roundup2(virtual_avail, L1_SIZE);
- virtual_end = VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE);
- kernel_vm_end = virtual_avail;
-
pa = pmap_early_vtophys(bs_state.freemempos);
-
- physmem_exclude_region(start_pa, pa - start_pa, EXFLAG_NOALLOC);
+ physmem_exclude_region(largest_phys, pa - largest_phys, EXFLAG_NOALLOC);
cpu_tlb_flushID();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 20, 11:03 AM (20 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28753502
Default Alt Text
D42734.1779275023.diff (2 KB)
Attached To
Mode
D42734: arm64: Move cpu0 dpcpu and msgbuf to the DMAP
Attached
Detach File
Event Timeline
Log In to Comment