Index: head/emulators/open-vm-tools/Makefile =================================================================== --- head/emulators/open-vm-tools/Makefile (revision 480888) +++ head/emulators/open-vm-tools/Makefile (revision 480889) @@ -1,96 +1,99 @@ # Created by: mbr@FreeBSD.org # $FreeBSD$ PORTNAME= open-vm-tools PORTVERSION= ${RELEASE_VER} DISTVERSIONPREFIX= stable- -PORTREVISION= 4 PORTEPOCH= 2 CATEGORIES= emulators MAINTAINER= jpaetzel@FreeBSD.org COMMENT?= Open VMware tools for FreeBSD VMware guests LICENSE= LGPL21 LICENSE_FILE= ${WRKSRC}/COPYING ONLY_FOR_ARCHS= amd64 i386 LIB_DEPENDS= libmspack.so:archivers/libmspack -RELEASE_VER= 10.2.5 -BUILD_VER= 8068406 +RELEASE_VER= 10.3.0 +BUILD_VER= 8931395 OPTIONS_DEFINE= DNET LIBNOTIFY OPENSSL X11 OPTIONS_DEFAULT= DNET LIBNOTIFY OPENSSL X11 OPTIONS_SUB= DNET_DESC= libdnet support LIBNOTIFY_DESC= Desktop notification support X11_CONFIGURE_WITH= x gtk2 gtkmm X11_USE= xorg=ice,sm,x11,xext,xi,xinerama,xorgproto,xrandr,xrender,xtst \ gnome=gdkpixbuf2,gtk20,gtkmm24 X11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 LIBNOTIFY_LIB_DEPENDS= libnotify.so:devel/libnotify DNET_CONFIGURE_WITH= dnet DNET_LIB_DEPENDS= libdnet.so:net/libdnet OPENSSL_CONFIGURE_WITH= ssl WRKSRC_SUBDIR= open-vm-tools GNU_CONFIGURE= yes -USES= autoreconf fuse gettext-runtime kmod libtool localbase pathfix pkgconfig +USES= autoreconf fuse gettext-runtime kmod libtool localbase pathfix pkgconfig gnome USE_GNOME= glib20 USE_GITHUB= yes GH_ACCOUNT= vmware USE_LDCONFIG= yes CPPFLAGS+= -Wno-deprecated-declarations SSP_UNSAFE= kernel module does not support ssp CONFIGURE_ARGS+= --without-icu \ --disable-vgauth \ --sysconfdir=${PREFIX}/etc CONFLICTS+= vmware-guestd[0-9]* vmware-tools[0-9]* USE_RC_SUBR= vmware-guestd vmware-kmod INSTALL_TARGET= install-strip .include + +.if ${OSVERSION} < 1100000 +CFLAGS+= -Wno-unknown-warning-option +.endif .if ${PORT_OPTIONS:MX11} CONFLICTS= open-vm-tools-nox11-[0-9]* .else CONFLICTS= open-vm-tools-[0-9]* .endif CONFIGURE_ENV+= SYSDIR=${SRC_BASE}/sys .include post-patch: @${REINPLACE_CMD} -e "s@%%PREFIX%%@${PREFIX}@"\ ${WRKSRC}/lib/guestApp/guestApp.c post-build: cd ${WRKSRC}/modules && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/input ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmblock.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmblock.ko ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmmemctl.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmmemctl.ko ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmxnet.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmxnet.ko ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/scripts/vmware/ ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/scripts/ ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/tests/ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.conf.d .include Index: head/emulators/open-vm-tools/distinfo =================================================================== --- head/emulators/open-vm-tools/distinfo (revision 480888) +++ head/emulators/open-vm-tools/distinfo (revision 480889) @@ -1,3 +1,3 @@ -TIMESTAMP = 1524018090 -SHA256 (vmware-open-vm-tools-stable-10.2.5_GH0.tar.gz) = c0f182c0c422fca8f8b3e5c21802f724256dfe5907383db28ec7e4d5b6d52b0f -SIZE (vmware-open-vm-tools-stable-10.2.5_GH0.tar.gz) = 3207633 +TIMESTAMP = 1533858593 +SHA256 (vmware-open-vm-tools-stable-10.3.0_GH0.tar.gz) = b3d0b5fd272a8dc35cab1ddd732f9d436f72682925212a6cdeccdab283e2f5ec +SIZE (vmware-open-vm-tools-stable-10.3.0_GH0.tar.gz) = 3498624 Index: head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c (revision 480888) +++ head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c (nonexistent) @@ -1,21 +0,0 @@ ---- lib/file/fileTempPosix.c.orig 2017-12-15 21:11:49 UTC -+++ lib/file/fileTempPosix.c -@@ -203,12 +203,17 @@ FileGetUserName(uid_t uid) // IN: - #if defined(__APPLE__) - memPoolSize = _PASSWORD_LEN; - #else -+ errno = 0; - memPoolSize = sysconf(_SC_GETPW_R_SIZE_MAX); - -- if (memPoolSize <= 0) { -+ if ((errno != 0) || (memPoolSize == 0)) { - Warning("%s: sysconf(_SC_GETPW_R_SIZE_MAX) failed.\n", __FUNCTION__); - - return NULL; -+ } -+ -+ if (memPoolSize == -1) { // Unlimited; pick something reasonable -+ memPoolSize = 16 * 1024; - } - #endif - Property changes on: head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-lib_include_vm__basic__types.h =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_include_vm__basic__types.h (revision 480888) +++ head/emulators/open-vm-tools/files/patch-lib_include_vm__basic__types.h (nonexistent) @@ -1,10 +0,0 @@ ---- lib/include/vm_basic_types.h.orig 2018-03-30 18:44:35 UTC -+++ lib/include/vm_basic_types.h -@@ -418,6 +418,7 @@ typedef int64 VmTimeVirtualClock; /* Virtual Clock ke - #endif - #elif defined(__linux__) || \ - (defined(__FreeBSD__) && (__FreeBSD__ + 0))\ -+ || (defined(__clang__)) \ - || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \ - || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \ - || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) Property changes on: head/emulators/open-vm-tools/files/patch-lib_include_vm__basic__types.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-configure.ac =================================================================== --- head/emulators/open-vm-tools/files/patch-configure.ac (revision 480888) +++ head/emulators/open-vm-tools/files/patch-configure.ac (nonexistent) @@ -1,20 +0,0 @@ ---- configure.ac.orig 2018-03-30 18:44:35 UTC -+++ configure.ac -@@ -1095,7 +1095,7 @@ AC_CHECK_HEADERS([sys/user.h], - ]) - AC_CHECK_HEADERS([sys/vfs.h]) - AC_CHECK_HEADERS([syslimits.h]) --AC_CHECK_HEADERS([unwind.h]) -+#AC_CHECK_HEADERS([unwind.h]) - - AC_CHECK_HEADER( - [wchar.h], -@@ -1142,7 +1142,7 @@ AC_C_VOLATILE - - ### General flags / actions - CFLAGS="$CFLAGS -Wall" --CFLAGS="$CFLAGS -Werror" -+CFLAGS="$CFLAGS -Werror -Wno-unused-function -Wno-address-of-packed-member -Wno-unknown-warning-option" - - # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' - # in Xlib.h on OpenSolaris. Property changes on: head/emulators/open-vm-tools/files/patch-configure.ac ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c =================================================================== --- head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c (revision 480888) +++ head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c (nonexistent) @@ -1,37 +0,0 @@ ---- services/plugins/vix/vixTools.c.orig 2018-03-30 18:44:35 UTC -+++ services/plugins/vix/vixTools.c -@@ -52,6 +52,7 @@ - #include - #include - #include -+#include - - #ifdef _WIN32 - #include -@@ -10133,7 +10134,7 @@ abort: - struct passwd pwd; - struct passwd *ppwd = &pwd; - char *buffer = NULL; // a pool of memory for Posix_Getpwnam_r() to use. -- size_t bufferSize; -+ long bufferSize; - - /* - * For POSIX systems, look up the uid of 'username', and compare -@@ -10146,9 +10147,15 @@ abort: - * Multiply by 4 to compensate for the conversion to UTF-8 by - * the Posix_Getpwnam_r() wrapper. - */ -- bufferSize = (size_t) sysconf(_SC_GETPW_R_SIZE_MAX) * 4; -+ errno = 0; -+ bufferSize = sysconf(_SC_GETPW_R_SIZE_MAX); -+ if ((errno != 0) || (bufferSize <= 0)) { -+ bufferSize = 16 * 1024; // Unlimited; pick something reasonable -+ } - -- buffer = Util_SafeMalloc(bufferSize); -+ bufferSize *= 4; -+ -+ buffer = Util_SafeMalloc((size_t)bufferSize); - - if (Posix_Getpwnam_r(username, &pwd, buffer, bufferSize, &ppwd) != 0 || - NULL == ppwd) { Property changes on: head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c (revision 480888) +++ head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c (nonexistent) @@ -1,45 +0,0 @@ ---- lib/auth/authPosix.c.orig 2017-12-15 21:11:49 UTC -+++ lib/auth/authPosix.c -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2003-2017 VMware, Inc. All rights reserved. -+ * Copyright (C) 2003-2018 VMware, Inc. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include // for access, crypt, etc. - #if !defined USE_PAM && !defined __APPLE__ - #include -@@ -262,8 +263,8 @@ static struct pam_conv PAM_conversation = { - static AuthTokenInternal * - AuthAllocateToken(void) - { -+ long bufSize; - AuthTokenInternal *ati; -- size_t bufSize; - - /* - * We need to get the maximum size buffer needed by getpwuid_r from -@@ -271,9 +272,15 @@ AuthAllocateToken(void) - * by the Posix_Get*_r() wrappers. - */ - -- bufSize = (size_t) sysconf(_SC_GETPW_R_SIZE_MAX) * 4; -+ errno = 0; -+ bufSize = sysconf(_SC_GETPW_R_SIZE_MAX); -+ if ((errno != 0) || (bufSize <= 0)) { -+ bufSize = 16 * 1024; // Unlimited; pick something reasonable -+ } - -- ati = Util_SafeMalloc(sizeof *ati + bufSize); -+ bufSize *= 4; -+ -+ ati = Util_SafeMalloc(sizeof *ati + (size_t) bufSize); - ati->bufSize = bufSize; - - return ati; Property changes on: head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-lib_guestApp_guestApp.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_guestApp_guestApp.c (revision 480888) +++ head/emulators/open-vm-tools/files/patch-lib_guestApp_guestApp.c (revision 480889) @@ -1,11 +1,11 @@ ---- lib/guestApp/guestApp.c.orig 2018-03-30 18:44:35 UTC +--- lib/guestApp/guestApp.c.orig 2018-07-13 18:54:23 UTC +++ lib/guestApp/guestApp.c @@ -63,7 +63,7 @@ #elif defined __APPLE__ # define GUESTAPP_TOOLS_INSTALL_PATH "/Library/Application Support/VMware Tools" #else -# define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools" -+# define GUESTAPP_TOOLS_INSTALL_PATH "%%PREFIX%%/share/vmware-tools" ++# define GUESTAPP_TOOLS_INSTALL_PATH "/usr/local/share/vmware-tools" #endif #if defined _WIN32 Index: head/emulators/open-vm-tools/files/patch-lib_vmCheck_vmcheck.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_vmCheck_vmcheck.c (revision 480888) +++ head/emulators/open-vm-tools/files/patch-lib_vmCheck_vmcheck.c (revision 480889) @@ -1,10 +1,10 @@ ---- lib/vmCheck/vmcheck.c.orig 2018-03-30 18:44:35 UTC +--- lib/vmCheck/vmcheck.c.orig 2018-07-13 18:54:23 UTC +++ lib/vmCheck/vmcheck.c -@@ -135,6 +135,7 @@ VmCheckSafe(SafeCheckFn checkFn) +@@ -153,6 +153,7 @@ VmCheckSafe(SafeCheckFn checkFn) #else do { int signals[] = { + SIGBUS, SIGILL, SIGSEGV, }; Index: head/emulators/open-vm-tools/files/patch-modules_Makefile.am =================================================================== --- head/emulators/open-vm-tools/files/patch-modules_Makefile.am (revision 480888) +++ head/emulators/open-vm-tools/files/patch-modules_Makefile.am (revision 480889) @@ -1,19 +1,19 @@ ---- modules/Makefile.am.orig 2018-04-18 02:28:12 UTC +--- modules/Makefile.am.orig 2018-09-29 03:57:04 UTC +++ modules/Makefile.am -@@ -48,11 +48,11 @@ if SOLARIS +@@ -65,11 +65,11 @@ if SOLARIS done endif if FREEBSD - for MOD in $(MODULES); do \ - $(INSTALL) -d $(DESTDIR)$(MODULES_DIR); \ - $(INSTALL) -m644 $(modulesrc)/$(MODULES_OS)/$$MOD.ko \ - $(DESTDIR)$(MODULES_DIR); \ - done +# for MOD in $(MODULES); do \ +# $(INSTALL) -d $(DESTDIR)$(MODULES_DIR); \ +# $(INSTALL) -m644 $(modulesrc)/$(MODULES_OS)/$$MOD.ko \ +# $(DESTDIR)$(MODULES_DIR); \ +# done endif uninstall-hook: Index: head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c =================================================================== --- head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c (revision 480888) +++ head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c (revision 480889) @@ -1,188 +1,84 @@ ---- modules/freebsd/vmmemctl/os.c.orig 2017-07-28 21:59:15 UTC +--- modules/freebsd/vmmemctl/os.c.orig 2018-09-29 03:58:10 UTC +++ modules/freebsd/vmmemctl/os.c -@@ -37,9 +37,11 @@ - #include - #include - #include -+#include - #include - #include - #include -+#include - #include +@@ -109,6 +109,30 @@ MALLOC_DEFINE(M_VMMEMCTL, BALLOON_NAME, "vmmemctl meta + #define VM_SYS_PAGES vm_cnt.v_page_count + #endif - #include -@@ -83,6 +85,55 @@ typedef struct { - MALLOC_DEFINE(M_VMMEMCTL, BALLOON_NAME, "vmmemctl metadata"); - - /* -+ * FreeBSD version specific MACROS -+ */ -+#if __FreeBSD_version >= 900000 -+ #define VM_PAGE_LOCK(page) vm_page_lock(page); -+ #define VM_PAGE_UNLOCK(page) vm_page_unlock(page) -+#else -+ #define VM_PAGE_LOCK(page) vm_page_lock_queues() -+ #define VM_PAGE_UNLOCK(page) vm_page_unlock_queues() -+#endif -+ -+#if __FreeBSD_version > 1000029 -+ #define VM_OBJ_LOCK(object) VM_OBJECT_WLOCK(object) -+ #define VM_OBJ_UNLOCK(object) VM_OBJECT_WUNLOCK(object); -+#else -+ #define VM_OBJ_LOCK(object) VM_OBJECT_LOCK(object); -+ #define VM_OBJ_UNLOCK(object) VM_OBJECT_UNLOCK(object); -+#endif -+ -+#if __FreeBSD_version < 1100015 -+ #define VM_SYS_PAGES cnt.v_page_count -+#else -+ #define VM_SYS_PAGES vm_cnt.v_page_count -+#endif -+ +#if __FreeBSD_version < 1000000 + #define KVA_ALLOC(size) kmem_alloc_nofault(kernel_map, size) + #define KVA_FREE(offset, size) kmem_free(kernel_map, offset, size) +#else + #define KVA_ALLOC(size) kva_alloc(size); + #define KVA_FREE(offset, size) kva_free(offset, size) +#endif + +#if __FreeBSD_version < 1000000 + #define KMEM_ALLOC(size) kmem_alloc(kernel_map, size) +#elif __FreeBSD_version < 1200080 + #define KMEM_ALLOC(size) kmem_malloc(kernel_arena, size, M_WAITOK | M_ZERO) +#else + #define KMEM_ALLOC(size) kmem_malloc(size, M_WAITOK | M_ZERO) +#endif + +#if __FreeBSD_version < 1000000 + #define KMEM_FREE(offset, size) kmem_free(kernel_map, offset, size) +#elif __FreeBSD_version < 1200083 + #define KMEM_FREE(offset, size) kmem_free(kernel_arena, offset, size) +#else + #define KMEM_FREE(offset, size) kmem_free(offset, size) +#endif + -+/* + /* * Globals */ - -@@ -223,7 +274,7 @@ static __inline__ unsigned long os_ffz(unsigned long w - unsigned long - OS_ReservedPageGetLimit(void) - { -- return cnt.v_page_count; -+ return VM_SYS_PAGES; - } - - -@@ -295,11 +346,7 @@ OS_ReservedPageGetHandle(PA64 pa) // IN +@@ -322,11 +346,7 @@ OS_ReservedPageGetHandle(PA64 pa) // IN Mapping OS_MapPageHandle(PageHandle handle) // IN { -#if __FreeBSD_version < 1000000 - vm_offset_t res = kmem_alloc_nofault(kernel_map, PAGE_SIZE); -#else - vm_offset_t res = kva_alloc(PAGE_SIZE); -#endif + vm_offset_t res = KVA_ALLOC(PAGE_SIZE); vm_page_t page = (vm_page_t)handle; -@@ -357,11 +404,7 @@ void +@@ -384,11 +404,7 @@ void OS_UnmapPage(Mapping mapping) // IN { pmap_qremove((vm_offset_t)mapping, 1); -#if __FreeBSD_version < 1000000 - kmem_free(kernel_map, (vm_offset_t)mapping, PAGE_SIZE); -#else - kva_free((vm_offset_t)mapping, PAGE_SIZE); -#endif + KVA_FREE((vm_offset_t)mapping, PAGE_SIZE); } -@@ -369,7 +412,7 @@ static void - os_pmap_alloc(os_pmap *p) // IN - { - /* number of pages (div. 8) */ -- p->size = (cnt.v_page_count + 7) / 8; -+ p->size = (VM_SYS_PAGES + 7) / 8; - - /* - * expand to nearest word boundary -@@ -378,22 +421,14 @@ os_pmap_alloc(os_pmap *p) // IN +@@ -405,22 +421,14 @@ os_pmap_alloc(os_pmap *p) // IN p->size = (p->size + sizeof(unsigned long) - 1) & ~(sizeof(unsigned long) - 1); -#if __FreeBSD_version < 1000000 - p->bitmap = (unsigned long *)kmem_alloc(kernel_map, p->size); -#else - p->bitmap = (unsigned long *)kmem_malloc(kernel_arena, p->size, M_WAITOK | M_ZERO); -#endif -+ p->bitmap = (unsigned long *)KMEM_ALLOC(p->size); ++ p->bitmap = (unsigned long *)KMEM_ALLOC(p->size); } static void os_pmap_free(os_pmap *p) // IN { -#if __FreeBSD_version < 1000000 - kmem_free(kernel_map, (vm_offset_t)p->bitmap, p->size); -#else - kmem_free(kernel_arena, (vm_offset_t)p->bitmap, p->size); -#endif + KMEM_FREE((vm_offset_t)p->bitmap, p->size); p->size = 0; p->bitmap = NULL; } -@@ -466,12 +501,14 @@ os_kmem_free(vm_page_t page) // IN - os_state *state = &global_state; - os_pmap *pmap = &state->pmap; - -- if ( !vm_page_lookup(state->vmobject, page->pindex) ) { -- return; -+ VM_OBJ_LOCK(state->vmobject); -+ if ( vm_page_lookup(state->vmobject, page->pindex) ) { -+ os_pmap_putindex(pmap, page->pindex); -+ VM_PAGE_LOCK(page); -+ vm_page_free(page); -+ VM_PAGE_UNLOCK(page); - } -- -- os_pmap_putindex(pmap, page->pindex); -- vm_page_free(page); -+ VM_OBJ_UNLOCK(state->vmobject); - } - - -@@ -483,8 +520,11 @@ os_kmem_alloc(int alloc_normal_failed) // IN - os_state *state = &global_state; - os_pmap *pmap = &state->pmap; - -+ VM_OBJ_LOCK(state->vmobject); -+ - pindex = os_pmap_getindex(pmap); - if (pindex == (vm_pindex_t)-1) { -+ VM_OBJ_UNLOCK(state->vmobject); - return NULL; - } - -@@ -505,6 +545,7 @@ os_kmem_alloc(int alloc_normal_failed) // IN - if (!page) { - os_pmap_putindex(pmap, pindex); - } -+ VM_OBJ_UNLOCK(state->vmobject); - - return page; - } -@@ -847,7 +888,7 @@ vmmemctl_sysctl(SYSCTL_HANDLER_ARGS) - static void - vmmemctl_init_sysctl(void) - { -- oid = sysctl_add_oid(NULL, SYSCTL_STATIC_CHILDREN(_vm), OID_AUTO, -+ oid = SYSCTL_ADD_OID(NULL, SYSCTL_STATIC_CHILDREN(_vm), OID_AUTO, - BALLOON_NAME, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, vmmemctl_sysctl, "A", - BALLOON_NAME_VERBOSE);