aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2014-03-21 02:11:11 +0800
committerjkim <jkim@FreeBSD.org>2014-03-21 02:11:11 +0800
commitd7a56e468fe1b38f1847a22239158b8fe008fd94 (patch)
treef67d57ae8d7bc1c1cc7efc2baf38a008883f98a6
parent97ab8714043dc889cf1c4872826ed25827b1b98c (diff)
downloadfreebsd-ports-gnome-d7a56e468fe1b38f1847a22239158b8fe008fd94.tar.gz
freebsd-ports-gnome-d7a56e468fe1b38f1847a22239158b8fe008fd94.tar.zst
freebsd-ports-gnome-d7a56e468fe1b38f1847a22239158b8fe008fd94.zip
Fix panic for stable/9. Use vm_page_alloc_contig() as it is now available.
Tested by: Douglas Berry (doug at bitnix dot ca) PR: ports/187580
-rw-r--r--emulators/virtualbox-ose-additions/Makefile1
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/Makefile1
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c49
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_PAGEOUT_GROW_CACHE.c37
-rw-r--r--emulators/virtualbox-ose-kmod/Makefile1
-rw-r--r--emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c74
6 files changed, 127 insertions, 36 deletions
diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile
index 797c6c075714..9ce4efda6913 100644
--- a/emulators/virtualbox-ose-additions/Makefile
+++ b/emulators/virtualbox-ose-additions/Makefile
@@ -3,6 +3,7 @@
PORTNAME= virtualbox-ose
DISTVERSION= 4.3.8
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
http://tmp.chruetertee.ch/ \
diff --git a/emulators/virtualbox-ose-kmod-legacy/Makefile b/emulators/virtualbox-ose-kmod-legacy/Makefile
index 01bf9ae0220c..3a5b11a0ceee 100644
--- a/emulators/virtualbox-ose-kmod-legacy/Makefile
+++ b/emulators/virtualbox-ose-kmod-legacy/Makefile
@@ -3,6 +3,7 @@
PORTNAME= virtualbox-ose
DISTVERSION= 4.2.22
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
http://tmp.chruetertee.ch/ \
diff --git a/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c b/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c
index 82d7d1c297d6..103f0f45cb19 100644
--- a/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c
+++ b/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c
@@ -1,7 +1,7 @@
$FreeBSD$
---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2013-03-20 19:19:36.795745576 -0700
-+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2013-03-20 19:15:35.164791970 -0700
+--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2014-03-14 17:25:46.000000000 -0400
++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2014-03-14 17:34:35.000000000 -0400
@@ -162,7 +162,11 @@
case RTR0MEMOBJTYPE_PHYS:
case RTR0MEMOBJTYPE_PHYS_NC:
@@ -14,7 +14,7 @@ $FreeBSD$
vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0);
#if __FreeBSD_version < 900000
/* See http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html */
-@@ -177,7 +181,12 @@
+@@ -177,7 +181,11 @@
#if __FreeBSD_version < 900000
vm_page_unlock_queues();
#endif
@@ -23,11 +23,18 @@ $FreeBSD$
+#else
VM_OBJECT_UNLOCK(pMemFreeBSD->pObject);
+#endif
-+
vm_object_deallocate(pMemFreeBSD->pObject);
break;
}
-@@ -205,10 +214,18 @@
+@@ -198,17 +206,25 @@
+ vm_page_t pPages;
+ int cTries = 0;
+
+-#if __FreeBSD_version > 1000000
++#if __FreeBSD_version >= 902508
+ int fFlags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY;
+ if (fWire)
+ fFlags |= VM_ALLOC_WIRED;
while (cTries <= 1)
{
@@ -46,31 +53,7 @@ $FreeBSD$
if (pPages)
break;
vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh);
-@@ -228,7 +245,11 @@
-
- if (!pPages)
- return pPages;
-+#if __FreeBSD_version >= 1000030
-+ VM_OBJECT_WLOCK(pObject);
-+#else
- VM_OBJECT_LOCK(pObject);
-+#endif
- for (vm_pindex_t iPage = 0; iPage < cPages; iPage++)
- {
- vm_page_t pPage = pPages + iPage;
-@@ -240,7 +261,11 @@
- atomic_add_int(&cnt.v_wire_count, 1);
- }
- }
-+#if __FreeBSD_version >= 1000030
-+ VM_OBJECT_WUNLOCK(pObject);
-+#else
- VM_OBJECT_UNLOCK(pObject);
-+#endif
- return pPages;
- #endif
- }
-@@ -264,7 +289,11 @@
+@@ -264,7 +280,11 @@
if (!pPage)
{
/* Free all allocated pages */
@@ -82,7 +65,7 @@ $FreeBSD$
while (iPage-- > 0)
{
pPage = vm_page_lookup(pObject, iPage);
-@@ -278,7 +307,11 @@
+@@ -278,7 +298,11 @@
vm_page_unlock_queues();
#endif
}
@@ -94,7 +77,7 @@ $FreeBSD$
return rcNoMem;
}
}
-@@ -411,9 +444,17 @@
+@@ -417,9 +441,17 @@
if (fContiguous)
{
Assert(enmType == RTR0MEMOBJTYPE_PHYS);
@@ -112,7 +95,7 @@ $FreeBSD$
pMemFreeBSD->Core.u.Phys.fAllocated = true;
}
-@@ -823,9 +864,17 @@
+@@ -838,9 +870,17 @@
case RTR0MEMOBJTYPE_PHYS_NC:
{
RTHCPHYS addr;
diff --git a/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_PAGEOUT_GROW_CACHE.c b/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_PAGEOUT_GROW_CACHE.c
new file mode 100644
index 000000000000..95dc2fcc27d5
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_PAGEOUT_GROW_CACHE.c
@@ -0,0 +1,37 @@
+--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2014-03-17 14:08:04.000000000 -0400
++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2014-03-17 14:09:34.000000000 -0400
+@@ -211,7 +211,7 @@
+ if (fWire)
+ fFlags |= VM_ALLOC_WIRED;
+
+- while (cTries <= 1)
++ while (1)
+ {
+ #if __FreeBSD_version >= 1000030
+ VM_OBJECT_WLOCK(pObject);
+@@ -225,18 +225,22 @@
+ #else
+ VM_OBJECT_UNLOCK(pObject);
+ #endif
+- if (pPages)
++ if (pPages || cTries >= 1)
+ break;
++#if __FreeBSD_version >= 1000015
+ vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh);
++#else
++ vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
++#endif
+ cTries++;
+ }
+
+ return pPages;
+ #else
+- while (cTries <= 1)
++ while (1)
+ {
+ pPages = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0);
+- if (pPages)
++ if (pPages || cTries >= 1)
+ break;
+ vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
+ cTries++;
diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile
index c81abb758e9a..11e0bf82b570 100644
--- a/emulators/virtualbox-ose-kmod/Makefile
+++ b/emulators/virtualbox-ose-kmod/Makefile
@@ -3,6 +3,7 @@
PORTNAME= virtualbox-ose
DISTVERSION= 4.3.8
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
http://tmp.chruetertee.ch/ \
diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
index b760cfe7f940..059a2298ea2a 100644
--- a/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
+++ b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
@@ -7,8 +7,8 @@ From Alan L. Cox on FreeBSD-current:
answer that question.
[1] http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html
---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2013-11-29 12:04:53.000000000 +0100
-+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2013-11-29 12:37:29.000000000 +0100
+--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2014-02-25 12:09:32.000000000 -0500
++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2014-03-17 13:57:00.000000000 -0400
@@ -168,14 +168,19 @@
VM_OBJECT_LOCK(pMemFreeBSD->pObject);
#endif
@@ -29,7 +29,75 @@ From Alan L. Cox on FreeBSD-current:
#if __FreeBSD_version >= 1000030
VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject);
#else
-@@ -291,11 +296,15 @@
+@@ -201,12 +206,12 @@
+ vm_page_t pPages;
+ int cTries = 0;
+
+-#if __FreeBSD_version > 1000000
++#if __FreeBSD_version >= 902508
+ int fFlags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY;
+ if (fWire)
+ fFlags |= VM_ALLOC_WIRED;
+
+- while (cTries <= 1)
++ while (1)
+ {
+ #if __FreeBSD_version >= 1000030
+ VM_OBJECT_WLOCK(pObject);
+@@ -220,18 +225,20 @@
+ #else
+ VM_OBJECT_UNLOCK(pObject);
+ #endif
+- if (pPages)
++ if (pPages || cTries >= 1)
+ break;
++#if __FreeBSD_version >= 1000015
+ vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh);
++#else
++ vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
++#endif
+ cTries++;
+ }
+-
+- return pPages;
+ #else
+- while (cTries <= 1)
++ while (1)
+ {
+ pPages = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0);
+- if (pPages)
++ if (pPages || cTries >= 1)
+ break;
+ vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
+ cTries++;
+@@ -239,11 +246,8 @@
+
+ if (!pPages)
+ return pPages;
+-#if __FreeBSD_version >= 1000030
+- VM_OBJECT_WLOCK(pObject);
+-#else
++
+ VM_OBJECT_LOCK(pObject);
+-#endif
+ for (vm_pindex_t iPage = 0; iPage < cPages; iPage++)
+ {
+ vm_page_t pPage = pPages + iPage;
+@@ -255,13 +259,9 @@
+ atomic_add_int(&cnt.v_wire_count, 1);
+ }
+ }
+-#if __FreeBSD_version >= 1000030
+- VM_OBJECT_WUNLOCK(pObject);
+-#else
+ VM_OBJECT_UNLOCK(pObject);
+ #endif
+ return pPages;
+-#endif
+ }
+
+ static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages,
+@@ -291,11 +291,15 @@
while (iPage-- > 0)
{
pPage = vm_page_lookup(pObject, iPage);