Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147747647
D42734.id153738.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
D42734.id153738.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
@@ -1332,6 +1332,7 @@
{
vm_offset_t dpcpu, msgbufpv;
vm_paddr_t start_pa, pa;
+ size_t largest_phys_size;
/* Set this early so we can use the pagetable walking functions */
kernel_pmap_store.pm_l0 = pagetable_l0_ttbr1;
@@ -1346,12 +1347,34 @@
kernel_pmap->pm_ttbr = kernel_pmap->pm_l0_paddr;
kernel_pmap->pm_asid_set = &asids;
+ /* 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;
+
/*
* We only use PXN when we know nothing will be executed from it, e.g.
* the DMAP region.
*/
bs_state.table_attrs &= ~TATTR_PXN_TABLE;
+ /* Update the physmap array. */
+ physmap_idx = physmem_avail(physmap, nitems(physmap));
+
+ /*
+ * Find the minimum physical address and largest region.
+ */
+ largest_phys_size = 0;
+ for (int i = 0; i < physmap_idx; i += 2) {
+ if ((physmap[i + 1] - physmap[i]) > largest_phys_size) {
+ largest_phys_size = physmap[i + 1] - physmap[i];
+ bs_state.freemempos = PHYS_TO_DMAP(physmap[i]);
+ }
+ }
+
start_pa = pmap_early_vtophys(bs_state.freemempos);
/*
@@ -1378,19 +1401,9 @@
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);
-
- cpu_tlb_flushID();
}
#if defined(KASAN) || defined(KMSAN)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 14, 9:19 AM (18 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29663216
Default Alt Text
D42734.id153738.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