Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 214207) +++ sys/vm/vm_page.c (working copy) @@ -467,6 +467,10 @@ vm_page_blacklist_lookup(list, pa)) printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); +#ifdef __amd64__ + else if (pa >= bootstrap_start && pa < bootstrap_end) + ; +#endif else vm_phys_add_page(pa); pa += PAGE_SIZE; Index: sys/amd64/include/pmap.h =================================================================== --- sys/amd64/include/pmap.h (revision 214207) +++ sys/amd64/include/pmap.h (working copy) @@ -297,6 +297,7 @@ extern caddr_t CADDR1; extern pt_entry_t *CMAP1; +extern vm_paddr_t bootstrap_start, bootstrap_end; extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; extern vm_offset_t virtual_avail; Index: sys/amd64/amd64/machdep.c =================================================================== --- sys/amd64/amd64/machdep.c (revision 214207) +++ sys/amd64/amd64/machdep.c (working copy) @@ -180,6 +180,7 @@ */ #define PHYSMAP_SIZE (2 * (VM_PHYSSEG_MAX - 1)) +vm_paddr_t bootstrap_start, bootstrap_end; vm_paddr_t phys_avail[PHYSMAP_SIZE + 2]; vm_paddr_t dump_avail[PHYSMAP_SIZE + 2]; @@ -1379,6 +1380,13 @@ dcons_addr = 0; /* + * Do not include pages in the bootstrap region (where the kernel + * is situated) in the free list. + */ + bootstrap_start = 0x100000; + bootstrap_end = first; + + /* * physmap is in bytes, so when converting to page boundaries, * round up the start address and round down the end address. */ @@ -1394,10 +1402,10 @@ full = FALSE; /* - * block out kernel memory as not available. + * Don't scribble over kernel memory. */ - if (pa >= 0x100000 && pa < first) - goto do_dump_avail; + if (pa >= bootstrap_start && pa < bootstrap_end) + goto do_phys_avail; /* * block out dcons buffer @@ -1450,6 +1458,7 @@ */ if (page_bad == TRUE) continue; +do_phys_avail: /* * If this good page is a continuation of the * previous set of good pages, then just increase