--- emulators/virtualbox-ose/Makefile (revision 549723) +++ emulators/virtualbox-ose/Makefile (working copy) @@ -3,7 +3,7 @@ PORTNAME= virtualbox-ose PORTVERSION= 5.2.44 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c (revision 549723) +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c (working copy) @@ -114,6 +114,16 @@ vm_page_unlock_queues(); #endif } +@@ -323,7 +323,8 @@ + size_t cPages = atop(pMemFreeBSD->Core.cb); + int rc; + +- pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages); ++ pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, ++ pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); + + /* No additional object reference for auto-deallocation upon unmapping. */ + #if __FreeBSD_version >= 1000055 @@ -364,58 +364,77 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE } DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) @@ -200,7 +210,7 @@ uint32_t cPages = atop(cb); vm_paddr_t VmPhysAddrHigh; -@@ -432,7 +452,10 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB +@@ -432,10 +452,14 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb); if (!pMemFreeBSD) @@ -209,8 +219,13 @@ return VERR_NO_MEMORY; + } - pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb)); +- pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb)); ++ pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, cb, VM_PROT_ALL, ++ 0, curthread->td_ucred); + if (PhysHighest != NIL_RTHCPHYS) + VmPhysAddrHigh = PhysHighest; + @@ -470,6 +493,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB rtR0MemObjDelete(&pMemFreeBSD->Core); } --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h (revision 549723) +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h (working copy) @@ -1,4 +1,4 @@ ---- src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig 2020-07-09 16:57:38 UTC +++ src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h @@ -60,6 +60,7 @@ #include @@ -8,7 +8,11 @@ #include #include /* for vtophys */ #include -@@ -70,7 +71,6 @@ +@@ -67,10 +68,10 @@ + #include + #include /* KERN_SUCCESS ++ */ + #include ++#include #include /* vm_phys_alloc_* */ #include /* kmem_alloc_attr */ #include /* vm_contig_grow_cache */ @@ -16,7 +20,7 @@ #include #include -@@ -114,6 +114,24 @@ +@@ -114,6 +115,24 @@ */ #if 0 /** @todo Not available yet. */ # define USE_KMEM_ALLOC_PROT --- emulators/virtualbox-ose-kmod/Makefile (revision 549723) +++ emulators/virtualbox-ose-kmod/Makefile (working copy) @@ -3,7 +3,7 @@ PORTNAME= virtualbox-ose PORTVERSION= 5.2.44 -PORTREVISION= 1 +PORTREVISION= 3 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX= -kmod