Fix the last few cases that grab without busy or valid. The grab functions must

return the page in some held state for consistency elsewhere.

Reviewed by:	alc, kib, markj
Differential Revision:	https://reviews.freebsd.org/D22610
This commit is contained in:
Jeff Roberson 2019-12-02 22:38:25 +00:00
parent e15046952d
commit 4504268a1b
3 changed files with 9 additions and 6 deletions

View File

@ -59,9 +59,10 @@ cloudabi_vdso_init(struct sysentvec *sv, char *begin, char *end)
addr = kva_alloc(PAGE_SIZE);
for (i = 0; i < pages; ++i) {
VM_OBJECT_WLOCK(obj);
m = vm_page_grab(obj, i, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO);
m->valid = VM_PAGE_BITS_ALL;
m = vm_page_grab(obj, i, VM_ALLOC_ZERO);
VM_OBJECT_WUNLOCK(obj);
vm_page_valid(m);
vm_page_xunbusy(m);
pmap_qenter(addr, &m, 1);
memcpy((void *)addr, begin + i * PAGE_SIZE,

View File

@ -83,9 +83,10 @@ __elfN(linux_shared_page_init)(char **mapping)
obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE,
VM_PROT_DEFAULT, 0, NULL);
VM_OBJECT_WLOCK(obj);
m = vm_page_grab(obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO);
m->valid = VM_PAGE_BITS_ALL;
m = vm_page_grab(obj, 0, VM_ALLOC_ZERO);
VM_OBJECT_WUNLOCK(obj);
vm_page_valid(m);
vm_page_xunbusy(m);
addr = kva_alloc(PAGE_SIZE);
pmap_qenter(addr, &m, 1);
*mapping = (char *)addr;

View File

@ -114,9 +114,10 @@ shared_page_init(void *dummy __unused)
shared_page_obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE,
VM_PROT_DEFAULT, 0, NULL);
VM_OBJECT_WLOCK(shared_page_obj);
m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO);
m->valid = VM_PAGE_BITS_ALL;
m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_ZERO);
VM_OBJECT_WUNLOCK(shared_page_obj);
vm_page_valid(m);
vm_page_xunbusy(m);
addr = kva_alloc(PAGE_SIZE);
pmap_qenter(addr, &m, 1);
shared_page_mapping = (char *)addr;