Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 2013 18:41:54 +0000 (UTC)
From:      Bernhard Froehlich <decke@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r327838 - in head/emulators: virtualbox-ose-additions/files virtualbox-ose-kmod/files virtualbox-ose/files
Message-ID:  <201309211841.r8LIfs3b093580@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: decke
Date: Sat Sep 21 18:41:53 2013
New Revision: 327838
URL: http://svnweb.freebsd.org/changeset/ports/327838

Log:
  - Fix calls of vm_map_find() after r255426 broke it and added
  a mmap flag.
  
  PR:		ports/181971,
  		ports/182121
  Submitted by:	Lawrence Stewart <lstewart@FreeBSD.org>,
  		Dan McGregor <dan.mcgregor@usask.ca>

Added:
  head/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c   (contents, props changed)
  head/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c   (contents, props changed)
  head/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c   (contents, props changed)
  head/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c   (contents, props changed)

Added: head/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c	Sat Sep 21 18:41:53 2013	(r327838)
@@ -0,0 +1,16 @@
+--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	2013-09-06 06:30:30.000000000 -0600
++++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	2013-09-18 12:01:45.000000000 -0600
+@@ -79,8 +79,13 @@
+             return VERR_NO_EXEC_MEMORY;
+ 
+         /* Addr contains a start address vm_map_find will start searching for suitable space at. */
++#if __FreeBSD_version >= 1000055
++        int rc = vm_map_find(kernel_map, pVmObject, 0, &Addr,
++                             cbAllocated, 0, VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
++#else
+         int rc = vm_map_find(kernel_map, pVmObject, 0, &Addr,
+                              cbAllocated, TRUE, VM_PROT_ALL, VM_PROT_ALL, 0);
++#endif
+         if (rc == KERN_SUCCESS)
+         {
+             rc = vm_map_wire(kernel_map, Addr, Addr + cbAllocated,

Added: head/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c	Sat Sep 21 18:41:53 2013	(r327838)
@@ -0,0 +1,48 @@
+--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2013-09-06 12:30:30.000000000 +0000
++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c	2013-09-21 18:12:53.000000000 +0000
+@@ -286,9 +286,15 @@
+     pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages);
+ 
+     /* No additional object reference for auto-deallocation upon unmapping. */
++#if __FreeBSD_version >= 1000055
++    rc = vm_map_find(kernel_map, pMemFreeBSD->pObject, 0,
++                     &MapAddress, pMemFreeBSD->Core.cb, 0, VMFS_ANY_SPACE,
++                     fExecutable ? VM_PROT_ALL : VM_PROT_RW, VM_PROT_ALL, 0);
++#else
+     rc = vm_map_find(kernel_map, pMemFreeBSD->pObject, 0,
+                      &MapAddress, pMemFreeBSD->Core.cb, VMFS_ANY_SPACE,
+                      fExecutable ? VM_PROT_ALL : VM_PROT_RW, VM_PROT_ALL, 0);
++#endif
+ 
+     if (rc == KERN_SUCCESS)
+     {
+@@ -551,6 +557,9 @@
+                      0,                             /* offset */
+                      &MapAddress,                   /* addr (IN/OUT) */
+                      cb,                            /* length */
++#if __FreeBSD_version >= 1000055
++                     0,                             /* max addr */
++#endif
+                      pvFixed == (void *)-1 ? VMFS_ANY_SPACE : VMFS_NO_SPACE,
+                                                     /* find_space */
+                      VM_PROT_NONE,                  /* protection */
+@@ -628,6 +637,9 @@
+                      offSub,                /* Start offset in the object */
+                      &Addr,                 /* Start address IN/OUT */
+                      cbSub,                 /* Size of the mapping */
++#if __FreeBSD_version >= 1000055
++                     0,                     /* Upper bound of mapping */
++#endif
+                      VMFS_ANY_SPACE,        /* Whether a suitable address should be searched for first */
+                      ProtectionFlags,       /* protection flags */
+                      VM_PROT_ALL,           /* Maximum protection flags */
+@@ -704,6 +716,9 @@
+                      0,                     /* Start offset in the object */
+                      &AddrR3,               /* Start address IN/OUT */
+                      pMemToMap->cb,         /* Size of the mapping */
++#if __FreeBSD_version >= 1000055
++                     0,                     /* Upper bound of the mapping */
++#endif
+                      R3PtrFixed == (RTR3PTR)-1 ? VMFS_ANY_SPACE : VMFS_NO_SPACE,
+                                             /* Whether a suitable address should be searched for first */
+                      ProtectionFlags,       /* protection flags */

Added: head/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c	Sat Sep 21 18:41:53 2013	(r327838)
@@ -0,0 +1,16 @@
+--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	2013-09-06 06:30:30.000000000 -0600
++++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	2013-09-18 12:01:45.000000000 -0600
+@@ -79,8 +79,13 @@
+             return VERR_NO_EXEC_MEMORY;
+ 
+         /* Addr contains a start address vm_map_find will start searching for suitable space at. */
++#if __FreeBSD_version >= 1000055
++        int rc = vm_map_find(kernel_map, pVmObject, 0, &Addr,
++                             cbAllocated, 0, VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
++#else
+         int rc = vm_map_find(kernel_map, pVmObject, 0, &Addr,
+                              cbAllocated, TRUE, VM_PROT_ALL, VM_PROT_ALL, 0);
++#endif
+         if (rc == KERN_SUCCESS)
+         {
+             rc = vm_map_wire(kernel_map, Addr, Addr + cbAllocated,

Added: head/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c	Sat Sep 21 18:41:53 2013	(r327838)
@@ -0,0 +1,48 @@
+--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2013-09-06 12:30:30.000000000 +0000
++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c	2013-09-21 18:12:53.000000000 +0000
+@@ -286,9 +286,15 @@
+     pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages);
+ 
+     /* No additional object reference for auto-deallocation upon unmapping. */
++#if __FreeBSD_version >= 1000055
++    rc = vm_map_find(kernel_map, pMemFreeBSD->pObject, 0,
++                     &MapAddress, pMemFreeBSD->Core.cb, 0, VMFS_ANY_SPACE,
++                     fExecutable ? VM_PROT_ALL : VM_PROT_RW, VM_PROT_ALL, 0);
++#else
+     rc = vm_map_find(kernel_map, pMemFreeBSD->pObject, 0,
+                      &MapAddress, pMemFreeBSD->Core.cb, VMFS_ANY_SPACE,
+                      fExecutable ? VM_PROT_ALL : VM_PROT_RW, VM_PROT_ALL, 0);
++#endif
+ 
+     if (rc == KERN_SUCCESS)
+     {
+@@ -551,6 +557,9 @@
+                      0,                             /* offset */
+                      &MapAddress,                   /* addr (IN/OUT) */
+                      cb,                            /* length */
++#if __FreeBSD_version >= 1000055
++                     0,                             /* max addr */
++#endif
+                      pvFixed == (void *)-1 ? VMFS_ANY_SPACE : VMFS_NO_SPACE,
+                                                     /* find_space */
+                      VM_PROT_NONE,                  /* protection */
+@@ -628,6 +637,9 @@
+                      offSub,                /* Start offset in the object */
+                      &Addr,                 /* Start address IN/OUT */
+                      cbSub,                 /* Size of the mapping */
++#if __FreeBSD_version >= 1000055
++                     0,                     /* Upper bound of mapping */
++#endif
+                      VMFS_ANY_SPACE,        /* Whether a suitable address should be searched for first */
+                      ProtectionFlags,       /* protection flags */
+                      VM_PROT_ALL,           /* Maximum protection flags */
+@@ -704,6 +716,9 @@
+                      0,                     /* Start offset in the object */
+                      &AddrR3,               /* Start address IN/OUT */
+                      pMemToMap->cb,         /* Size of the mapping */
++#if __FreeBSD_version >= 1000055
++                     0,                     /* Upper bound of the mapping */
++#endif
+                      R3PtrFixed == (RTR3PTR)-1 ? VMFS_ANY_SPACE : VMFS_NO_SPACE,
+                                             /* Whether a suitable address should be searched for first */
+                      ProtectionFlags,       /* protection flags */

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-alloc-r0drv-freebsd.c	Sat Sep 21 18:41:53 2013	(r327838)
@@ -0,0 +1,16 @@
+--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	2013-09-06 06:30:30.000000000 -0600
++++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	2013-09-18 12:01:45.000000000 -0600
+@@ -79,8 +79,13 @@
+             return VERR_NO_EXEC_MEMORY;
+ 
+         /* Addr contains a start address vm_map_find will start searching for suitable space at. */
++#if __FreeBSD_version >= 1000055
++        int rc = vm_map_find(kernel_map, pVmObject, 0, &Addr,
++                             cbAllocated, 0, VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
++#else
+         int rc = vm_map_find(kernel_map, pVmObject, 0, &Addr,
+                              cbAllocated, TRUE, VM_PROT_ALL, VM_PROT_ALL, 0);
++#endif
+         if (rc == KERN_SUCCESS)
+         {
+             rc = vm_map_wire(kernel_map, Addr, Addr + cbAllocated,

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_MAP_FIND.c	Sat Sep 21 18:41:53 2013	(r327838)
@@ -0,0 +1,48 @@
+--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2013-09-06 12:30:30.000000000 +0000
++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c	2013-09-21 18:12:53.000000000 +0000
+@@ -286,9 +286,15 @@
+     pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages);
+ 
+     /* No additional object reference for auto-deallocation upon unmapping. */
++#if __FreeBSD_version >= 1000055
++    rc = vm_map_find(kernel_map, pMemFreeBSD->pObject, 0,
++                     &MapAddress, pMemFreeBSD->Core.cb, 0, VMFS_ANY_SPACE,
++                     fExecutable ? VM_PROT_ALL : VM_PROT_RW, VM_PROT_ALL, 0);
++#else
+     rc = vm_map_find(kernel_map, pMemFreeBSD->pObject, 0,
+                      &MapAddress, pMemFreeBSD->Core.cb, VMFS_ANY_SPACE,
+                      fExecutable ? VM_PROT_ALL : VM_PROT_RW, VM_PROT_ALL, 0);
++#endif
+ 
+     if (rc == KERN_SUCCESS)
+     {
+@@ -551,6 +557,9 @@
+                      0,                             /* offset */
+                      &MapAddress,                   /* addr (IN/OUT) */
+                      cb,                            /* length */
++#if __FreeBSD_version >= 1000055
++                     0,                             /* max addr */
++#endif
+                      pvFixed == (void *)-1 ? VMFS_ANY_SPACE : VMFS_NO_SPACE,
+                                                     /* find_space */
+                      VM_PROT_NONE,                  /* protection */
+@@ -628,6 +637,9 @@
+                      offSub,                /* Start offset in the object */
+                      &Addr,                 /* Start address IN/OUT */
+                      cbSub,                 /* Size of the mapping */
++#if __FreeBSD_version >= 1000055
++                     0,                     /* Upper bound of mapping */
++#endif
+                      VMFS_ANY_SPACE,        /* Whether a suitable address should be searched for first */
+                      ProtectionFlags,       /* protection flags */
+                      VM_PROT_ALL,           /* Maximum protection flags */
+@@ -704,6 +716,9 @@
+                      0,                     /* Start offset in the object */
+                      &AddrR3,               /* Start address IN/OUT */
+                      pMemToMap->cb,         /* Size of the mapping */
++#if __FreeBSD_version >= 1000055
++                     0,                     /* Upper bound of the mapping */
++#endif
+                      R3PtrFixed == (RTR3PTR)-1 ? VMFS_ANY_SPACE : VMFS_NO_SPACE,
+                                             /* Whether a suitable address should be searched for first */
+                      ProtectionFlags,       /* protection flags */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309211841.r8LIfs3b093580>