From owner-svn-ports-all@freebsd.org Fri Aug 31 18:13:57 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2544DFD3F6A; Fri, 31 Aug 2018 18:13:57 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C085C7F0FF; Fri, 31 Aug 2018 18:13:56 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B2371ECA7; Fri, 31 Aug 2018 18:13:56 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7VIDuqD049967; Fri, 31 Aug 2018 18:13:56 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7VIDuQN049966; Fri, 31 Aug 2018 18:13:56 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201808311813.w7VIDuQN049966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 31 Aug 2018 18:13:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r478602 - in head/emulators/open-vm-tools: . files X-SVN-Group: ports-head X-SVN-Commit-Author: jpaetzel X-SVN-Commit-Paths: in head/emulators/open-vm-tools: . files X-SVN-Commit-Revision: 478602 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2018 18:13:57 -0000 Author: jpaetzel Date: Fri Aug 31 18:13:56 2018 New Revision: 478602 URL: https://svnweb.freebsd.org/changeset/ports/478602 Log: Chase FreeBSD HEAD changes r338318, r338143 The patches have been upstreamed to VMware. Submitted by: dim Modified: head/emulators/open-vm-tools/Makefile head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c Modified: head/emulators/open-vm-tools/Makefile ============================================================================== --- head/emulators/open-vm-tools/Makefile Fri Aug 31 17:42:18 2018 (r478601) +++ head/emulators/open-vm-tools/Makefile Fri Aug 31 18:13:56 2018 (r478602) @@ -4,7 +4,7 @@ PORTNAME= open-vm-tools PORTVERSION= ${RELEASE_VER} DISTVERSIONPREFIX= stable- -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 2 CATEGORIES= emulators Modified: head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c ============================================================================== --- head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c Fri Aug 31 17:42:18 2018 (r478601) +++ head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c Fri Aug 31 18:13:56 2018 (r478602) @@ -12,7 +12,7 @@ #include #include -@@ -83,6 +85,30 @@ typedef struct { +@@ -83,6 +85,55 @@ typedef struct { MALLOC_DEFINE(M_VMMEMCTL, BALLOON_NAME, "vmmemctl metadata"); /* @@ -39,11 +39,36 @@ +#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 +249,7 @@ static __inline__ unsigned long os_ffz(unsigned long w +@@ -223,7 +274,7 @@ static __inline__ unsigned long os_ffz(unsigned long w unsigned long OS_ReservedPageGetLimit(void) { @@ -52,7 +77,33 @@ } -@@ -369,7 +395,7 @@ static void +@@ -295,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 + 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) */ @@ -61,7 +112,32 @@ /* * expand to nearest word boundary -@@ -466,12 +492,14 @@ os_kmem_free(vm_page_t page) // IN +@@ -378,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); + } + + + 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; @@ -81,7 +157,7 @@ } -@@ -483,8 +511,11 @@ os_kmem_alloc(int alloc_normal_failed) // IN +@@ -483,8 +520,11 @@ os_kmem_alloc(int alloc_normal_failed) // IN os_state *state = &global_state; os_pmap *pmap = &state->pmap; @@ -93,7 +169,7 @@ return NULL; } -@@ -505,6 +536,7 @@ os_kmem_alloc(int alloc_normal_failed) // IN +@@ -505,6 +545,7 @@ os_kmem_alloc(int alloc_normal_failed) // IN if (!page) { os_pmap_putindex(pmap, pindex); } @@ -101,7 +177,7 @@ return page; } -@@ -847,7 +879,7 @@ vmmemctl_sysctl(SYSCTL_HANDLER_ARGS) +@@ -847,7 +888,7 @@ vmmemctl_sysctl(SYSCTL_HANDLER_ARGS) static void vmmemctl_init_sysctl(void) {