Provide a legitimate pindex to vm_page_alloc() in pmap_growkernel()

instead of writing apologetic comments.  As it turns out, I need every
kernel page table page to have a legitimate pindex to support superpage
promotion on kernel memory.

Correct a nearby style error: Pointers should be compared to NULL.
This commit is contained in:
Alan Cox 2008-01-02 08:54:39 +00:00
parent 273bf93c8d
commit 86f1449310
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175056
2 changed files with 5 additions and 11 deletions

View file

@ -1554,7 +1554,7 @@ pmap_growkernel(vm_offset_t addr)
/* We need a new PDP entry */
nkpg = vm_page_alloc(NULL, nkpt,
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (!nkpg)
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
pmap_zero_page(nkpg);
paddr = VM_PAGE_TO_PHYS(nkpg);
@ -1572,12 +1572,9 @@ pmap_growkernel(vm_offset_t addr)
continue;
}
/*
* This index is bogus, but out of the way
*/
nkpg = vm_page_alloc(NULL, nkpt,
nkpg = vm_page_alloc(NULL, pmap_pde_pindex(kernel_vm_end),
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (!nkpg)
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
nkpt++;

View file

@ -1619,12 +1619,9 @@ pmap_growkernel(vm_offset_t addr)
continue;
}
/*
* This index is bogus, but out of the way
*/
nkpg = vm_page_alloc(NULL, nkpt,
nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDRSHIFT,
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (!nkpg)
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
nkpt++;