Date: Mon, 2 Dec 2019 22:38:25 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355313 - in head/sys: compat/cloudabi compat/linux kern Message-ID: <201912022238.xB2McPue039706@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jeff Date: Mon Dec 2 22:38:25 2019 New Revision: 355313 URL: https://svnweb.freebsd.org/changeset/base/355313 Log: 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 Modified: head/sys/compat/cloudabi/cloudabi_vdso.c head/sys/compat/linux/linux_vdso.c head/sys/kern/kern_sharedpage.c Modified: head/sys/compat/cloudabi/cloudabi_vdso.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_vdso.c Mon Dec 2 22:35:45 2019 (r355312) +++ head/sys/compat/cloudabi/cloudabi_vdso.c Mon Dec 2 22:38:25 2019 (r355313) @@ -59,9 +59,10 @@ cloudabi_vdso_init(struct sysentvec *sv, char *begin, 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, Modified: head/sys/compat/linux/linux_vdso.c ============================================================================== --- head/sys/compat/linux/linux_vdso.c Mon Dec 2 22:35:45 2019 (r355312) +++ head/sys/compat/linux/linux_vdso.c Mon Dec 2 22:38:25 2019 (r355313) @@ -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; Modified: head/sys/kern/kern_sharedpage.c ============================================================================== --- head/sys/kern/kern_sharedpage.c Mon Dec 2 22:35:45 2019 (r355312) +++ head/sys/kern/kern_sharedpage.c Mon Dec 2 22:38:25 2019 (r355313) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912022238.xB2McPue039706>