Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2014 18:11:12 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r348711 - in head/emulators: virtualbox-ose-additions virtualbox-ose-kmod virtualbox-ose-kmod-legacy virtualbox-ose-kmod-legacy/files virtualbox-ose/files
Message-ID:  <201403201811.s2KIBCh4054125@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Mar 20 18:11:11 2014
New Revision: 348711
URL: http://svnweb.freebsd.org/changeset/ports/348711
QAT: https://qat.redports.org/buildarchive/r348711/

Log:
  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

Added:
  head/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_PAGEOUT_GROW_CACHE.c   (contents, props changed)
Modified:
  head/emulators/virtualbox-ose-additions/Makefile
  head/emulators/virtualbox-ose-kmod-legacy/Makefile
  head/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c
  head/emulators/virtualbox-ose-kmod/Makefile
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c

Modified: head/emulators/virtualbox-ose-additions/Makefile
==============================================================================
--- head/emulators/virtualbox-ose-additions/Makefile	Thu Mar 20 18:01:39 2014	(r348710)
+++ head/emulators/virtualbox-ose-additions/Makefile	Thu Mar 20 18:11:11 2014	(r348711)
@@ -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/ \

Modified: head/emulators/virtualbox-ose-kmod-legacy/Makefile
==============================================================================
--- head/emulators/virtualbox-ose-kmod-legacy/Makefile	Thu Mar 20 18:01:39 2014	(r348710)
+++ head/emulators/virtualbox-ose-kmod-legacy/Makefile	Thu Mar 20 18:11:11 2014	(r348711)
@@ -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/ \

Modified: head/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c
==============================================================================
--- head/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c	Thu Mar 20 18:01:39 2014	(r348710)
+++ head/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_OBJECT_RENAME.c	Thu Mar 20 18:11:11 2014	(r348711)
@@ -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;

Added: head/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_PAGEOUT_GROW_CACHE.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd_VM_PAGEOUT_GROW_CACHE.c	Thu Mar 20 18:11:11 2014	(r348711)
@@ -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++;

Modified: head/emulators/virtualbox-ose-kmod/Makefile
==============================================================================
--- head/emulators/virtualbox-ose-kmod/Makefile	Thu Mar 20 18:01:39 2014	(r348710)
+++ head/emulators/virtualbox-ose-kmod/Makefile	Thu Mar 20 18:11:11 2014	(r348711)
@@ -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/ \

Modified: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
==============================================================================
--- head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c	Thu Mar 20 18:01:39 2014	(r348710)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c	Thu Mar 20 18:11:11 2014	(r348711)
@@ -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);



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