Prior to r329071, pmap_bootstrap() used pmap_kmem_choose() to round the

first available virtual address to a 2MB boundary. After r329071,
create_pagetables() rounds firstaddr up to a 2MB boundary. This ensures
the kernel is mapped in super-pages, which is the point of the logic
in pmap_kmem_choose(). Therefore, it is no longer necessary for
pmap_bootstrap() to round up to the 2MB boundary again.

As pmap_bootstrap() was the only user of pmap_kmem_choose(), we can
delete pmap_kmem_choose().

Reviewed by:	kib
MFC after:	2 weeks
X-MFC-with:	r329071
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D14355
This commit is contained in:
jtl 2018-03-05 15:10:17 +00:00
parent 5f8973a373
commit 886958fbdb

View File

@ -687,22 +687,6 @@ static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va,
static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m,
struct spglist *free); struct spglist *free);
static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, struct spglist *);
static vm_offset_t pmap_kmem_choose(vm_offset_t addr);
/*
* Move the kernel virtual free pointer to the next
* 2MB. This is used to help improve performance
* by using a large (2MB) page for much of the kernel
* (.text, .data, .bss)
*/
static vm_offset_t
pmap_kmem_choose(vm_offset_t addr)
{
vm_offset_t newaddr = addr;
newaddr = roundup2(addr, NBPDR);
return (newaddr);
}
/********************/ /********************/
/* Inline functions */ /* Inline functions */
@ -1049,7 +1033,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt));
virtual_avail = (vm_offset_t) KERNBASE + *firstaddr; virtual_avail = (vm_offset_t) KERNBASE + *firstaddr;
virtual_avail = pmap_kmem_choose(virtual_avail);
virtual_end = VM_MAX_KERNEL_ADDRESS; virtual_end = VM_MAX_KERNEL_ADDRESS;