Index: trunk/src/VBox/Runtime/r0drv/alloc-r0drv.cpp
===================================================================
--- trunk/src/VBox/Runtime/r0drv/alloc-r0drv.cpp	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/alloc-r0drv.cpp	(revision 97910)
@@ -275,5 +275,4 @@
     {
         Assert(!(pHdr->fFlags & RTMEMHDR_FLAG_ALLOC_EX));
-        Assert(!(pHdr->fFlags & RTMEMHDR_FLAG_EXEC));
 #ifdef RTR0MEM_STRICT
         AssertReleaseMsg(!memcmp((uint8_t *)(pHdr + 1) + pHdr->cbReq, &g_abFence[0], RTR0MEM_FENCE_EXTRA),
@@ -304,5 +303,4 @@
     {
         Assert(!(pHdr->fFlags & RTMEMHDR_FLAG_ALLOC_EX));
-        Assert(!(pHdr->fFlags & RTMEMHDR_FLAG_EXEC));
 #ifdef RTR0MEM_STRICT
         AssertReleaseMsg(!memcmp((uint8_t *)(pHdr + 1) + pHdr->cbReq, &g_abFence[0], RTR0MEM_FENCE_EXTRA),
Index: trunk/src/VBox/Runtime/r0drv/alloc-r0drv.h
===================================================================
--- trunk/src/VBox/Runtime/r0drv/alloc-r0drv.h	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/alloc-r0drv.h	(revision 97910)
@@ -68,19 +68,13 @@
 /** Clear the allocated memory. */
 #define RTMEMHDR_FLAG_ZEROED        RT_BIT(0)
-/** Executable flag. */
-#define RTMEMHDR_FLAG_EXEC          RT_BIT(1)
 /** Use allocation method suitable for any context. */
-#define RTMEMHDR_FLAG_ANY_CTX_ALLOC RT_BIT(2)
+#define RTMEMHDR_FLAG_ANY_CTX_ALLOC RT_BIT(1)
 /** Use allocation method which allow for freeing in any context. */
-#define RTMEMHDR_FLAG_ANY_CTX_FREE  RT_BIT(3)
+#define RTMEMHDR_FLAG_ANY_CTX_FREE  RT_BIT(2)
 /** Both alloc and free in any context (or we're just darn lazy). */
 #define RTMEMHDR_FLAG_ANY_CTX       (RTMEMHDR_FLAG_ANY_CTX_ALLOC | RTMEMHDR_FLAG_ANY_CTX_FREE)
 /** Indicate that it was allocated by rtR0MemAllocExTag. */
-#define RTMEMHDR_FLAG_ALLOC_EX      RT_BIT(4)
+#define RTMEMHDR_FLAG_ALLOC_EX      RT_BIT(3)
 #ifdef RT_OS_LINUX
-/** Linux: Allocated using vm_area hacks. */
-# define RTMEMHDR_FLAG_EXEC_VM_AREA RT_BIT(29)
-/** Linux: Allocated from the special heap for executable memory. */
-# define RTMEMHDR_FLAG_EXEC_HEAP    RT_BIT(30)
 /** Linux: Allocated by kmalloc() instead of vmalloc(). */
 # define RTMEMHDR_FLAG_KMALLOC      RT_BIT(31)
Index: trunk/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp
===================================================================
--- trunk/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp	(revision 97910)
@@ -51,26 +51,4 @@
 
 
-/*********************************************************************************************************************************
-*   Structures and Typedefs                                                                                                      *
-*********************************************************************************************************************************/
-/**
- * Extended header used for headers marked with RTMEMHDR_FLAG_EXEC.
- *
- * This is used with allocating executable memory, for things like generated
- * code and loaded modules.
- */
-typedef struct RTMEMDARWINHDREX
-{
-    /** The associated memory object. */
-    RTR0MEMOBJ          hMemObj;
-    /** Alignment padding. */
-    uint8_t             abPadding[ARCH_BITS == 32 ? 12 : 8];
-    /** The header we present to the generic API. */
-    RTMEMHDR            Hdr;
-} RTMEMDARWINHDREX;
-AssertCompileSize(RTMEMDARWINHDREX, 32);
-/** Pointer to an extended memory header. */
-typedef RTMEMDARWINHDREX *PRTMEMDARWINHDREX;
-
 
 /**
@@ -80,45 +58,25 @@
 {
     IPRT_DARWIN_SAVE_EFL_AC();
+    if (RT_LIKELY(!(fFlags & RTMEMHDR_FLAG_ANY_CTX)))
+    {
+        PRTMEMHDR pHdr = (PRTMEMHDR)IOMalloc(cb + sizeof(*pHdr));
+        if (RT_LIKELY(pHdr))
+        {
+            pHdr->u32Magic  = RTMEMHDR_MAGIC;
+            pHdr->fFlags    = fFlags;
+            pHdr->cb        = cb;
+            pHdr->cbReq     = cb;
+            *ppHdr = pHdr;
 
-    if (RT_UNLIKELY(fFlags & RTMEMHDR_FLAG_ANY_CTX))
-        return VERR_NOT_SUPPORTED;
+            IPRT_DARWIN_RESTORE_EFL_AC();
+            return VINF_SUCCESS;
+        }
 
-    PRTMEMHDR pHdr;
-    if (fFlags & RTMEMHDR_FLAG_EXEC)
-    {
-        RTR0MEMOBJ hMemObj;
-        int rc = RTR0MemObjAllocPage(&hMemObj, cb + sizeof(RTMEMDARWINHDREX), true /*fExecutable*/);
-        if (RT_FAILURE(rc))
-        {
-            IPRT_DARWIN_RESTORE_EFL_AC();
-            return rc;
-        }
-        PRTMEMDARWINHDREX pExHdr = (PRTMEMDARWINHDREX)RTR0MemObjAddress(hMemObj);
-        pExHdr->hMemObj = hMemObj;
-        pHdr = &pExHdr->Hdr;
-#if 1 /*fExecutable isn't currently honored above. */
-        rc = RTR0MemObjProtect(hMemObj, 0, RTR0MemObjSize(hMemObj), RTMEM_PROT_READ | RTMEM_PROT_WRITE | RTMEM_PROT_EXEC);
-        AssertRC(rc);
-#endif
+        printf("rtR0MemAllocEx(%#zx, %#x) failed\n", cb + sizeof(*pHdr), fFlags);
+        IPRT_DARWIN_RESTORE_EFL_AC();
+        return VERR_NO_MEMORY;
     }
-    else
-    {
-        pHdr = (PRTMEMHDR)IOMalloc(cb + sizeof(*pHdr));
-        if (RT_UNLIKELY(!pHdr))
-        {
-            printf("rtR0MemAllocEx(%#zx, %#x) failed\n", cb + sizeof(*pHdr), fFlags);
-            IPRT_DARWIN_RESTORE_EFL_AC();
-            return VERR_NO_MEMORY;
-        }
-    }
-
-    pHdr->u32Magic  = RTMEMHDR_MAGIC;
-    pHdr->fFlags    = fFlags;
-    pHdr->cb        = cb;
-    pHdr->cbReq     = cb;
-    *ppHdr = pHdr;
-
     IPRT_DARWIN_RESTORE_EFL_AC();
-    return VINF_SUCCESS;
+    return VERR_NOT_SUPPORTED;
 }
 
@@ -132,12 +90,5 @@
 
     pHdr->u32Magic += 1;
-    if (pHdr->fFlags & RTMEMHDR_FLAG_EXEC)
-    {
-        PRTMEMDARWINHDREX pExHdr = RT_FROM_MEMBER(pHdr, RTMEMDARWINHDREX, Hdr);
-        int rc = RTR0MemObjFree(pExHdr->hMemObj, false /*fFreeMappings*/);
-        AssertRC(rc);
-    }
-    else
-        IOFree(pHdr, pHdr->cb + sizeof(*pHdr));
+    IOFree(pHdr, pHdr->cb + sizeof(*pHdr));
 
     IPRT_DARWIN_RESTORE_EFL_AC();
Index: trunk/src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c	(revision 97910)
@@ -90,73 +90,17 @@
 {
     size_t      cbAllocated = cb;
-    PRTMEMHDR   pHdr        = NULL;
+    PRTMEMHDR   pHdr        = (PRTMEMHDR)malloc(cb + sizeof(RTMEMHDR), M_IPRTHEAP,
+                                                fFlags & RTMEMHDR_FLAG_ZEROED ? M_NOWAIT | M_ZERO : M_NOWAIT);
+    if (RT_LIKELY(pHdr))
+    {
+        pHdr->u32Magic   = RTMEMHDR_MAGIC;
+        pHdr->fFlags     = fFlags;
+        pHdr->cb         = cbAllocated;
+        pHdr->cbReq      = cb;
 
-#ifdef RT_ARCH_AMD64
-    /*
-     * Things are a bit more complicated on AMD64 for executable memory
-     * because we need to be in the ~2GB..~0 range for code.
-     */
-    if (fFlags & RTMEMHDR_FLAG_EXEC)
-    {
-        if (fFlags & RTMEMHDR_FLAG_ANY_CTX)
-            return VERR_NOT_SUPPORTED;
-
-# ifdef USE_KMEM_ALLOC_PROT
-        pHdr = (PRTMEMHDR)kmem_alloc_prot(kernel_map, cb + sizeof(*pHdr),
-                                          VM_PROT_ALL, VM_PROT_ALL, KERNBASE);
-# else
-        vm_object_t pVmObject = NULL;
-        vm_offset_t Addr = KERNBASE;
-        cbAllocated = RT_ALIGN_Z(cb + sizeof(*pHdr), PAGE_SIZE);
-
-        pVmObject = vm_object_allocate(OBJT_DEFAULT, cbAllocated >> PAGE_SHIFT);
-        if (!pVmObject)
-            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,
-                             VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES);
-            if (rc == KERN_SUCCESS)
-            {
-                pHdr = (PRTMEMHDR)Addr;
-
-                if (fFlags & RTMEMHDR_FLAG_ZEROED)
-                    bzero(pHdr, cbAllocated);
-            }
-            else
-                vm_map_remove(kernel_map,
-                              Addr,
-                              Addr + cbAllocated);
-        }
-        else
-            vm_object_deallocate(pVmObject);
-# endif
+        *ppHdr = pHdr;
+        return VINF_SUCCESS;
     }
-    else
-#endif
-    {
-        pHdr = (PRTMEMHDR)malloc(cb + sizeof(RTMEMHDR), M_IPRTHEAP,
-                                 fFlags & RTMEMHDR_FLAG_ZEROED ? M_NOWAIT | M_ZERO : M_NOWAIT);
-    }
-
-    if (RT_UNLIKELY(!pHdr))
-        return VERR_NO_MEMORY;
-
-    pHdr->u32Magic   = RTMEMHDR_MAGIC;
-    pHdr->fFlags     = fFlags;
-    pHdr->cb         = cbAllocated;
-    pHdr->cbReq      = cb;
-
-    *ppHdr = pHdr;
-    return VINF_SUCCESS;
+    return VERR_NO_MEMORY;
 }
 
Index: trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c	(revision 97910)
@@ -47,158 +47,6 @@
 #include "r0drv/alloc-r0drv.h"
 
-
-#if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP)
-# if RTLNX_VER_MIN(2,6,23) && RTLNX_VER_MAX(5,8,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5)
-/**
- * Starting with 2.6.23 we can use __get_vm_area and map_vm_area to allocate
- * memory in the moduel range.  This is preferrable to the exec heap below.
- */
-#  define RTMEMALLOC_EXEC_VM_AREA
-# else
-/**
- * We need memory in the module range (~2GB to ~0) this can only be obtained
- * thru APIs that are not exported (see module_alloc()).
- *
- * So, we'll have to create a quick and dirty heap here using BSS memory.
- * Very annoying and it's going to restrict us!
- */
-#  define RTMEMALLOC_EXEC_HEAP
-# endif
-#endif
-
-#ifdef RTMEMALLOC_EXEC_HEAP
-# include <iprt/heap.h>
-# include <iprt/spinlock.h>
-# include <iprt/errcore.h>
-#endif
-
 #include "internal/initterm.h"
 
-
-/*********************************************************************************************************************************
-*   Structures and Typedefs                                                                                                      *
-*********************************************************************************************************************************/
-#ifdef RTMEMALLOC_EXEC_VM_AREA
-/**
- * Extended header used for headers marked with RTMEMHDR_FLAG_EXEC_VM_AREA.
- *
- * This is used with allocating executable memory, for things like generated
- * code and loaded modules.
- */
-typedef struct RTMEMLNXHDREX
-{
-    /** The VM area for this allocation. */
-    struct vm_struct   *pVmArea;
-    void               *pvDummy;
-    /** The header we present to the generic API. */
-    RTMEMHDR            Hdr;
-} RTMEMLNXHDREX;
-AssertCompileSize(RTMEMLNXHDREX, 32);
-/** Pointer to an extended memory header. */
-typedef RTMEMLNXHDREX *PRTMEMLNXHDREX;
-#endif
-
-
-/*********************************************************************************************************************************
-*   Global Variables                                                                                                             *
-*********************************************************************************************************************************/
-#ifdef RTMEMALLOC_EXEC_HEAP
-/** The heap. */
-static RTHEAPSIMPLE g_HeapExec = NIL_RTHEAPSIMPLE;
-/** Spinlock protecting the heap. */
-static RTSPINLOCK   g_HeapExecSpinlock = NIL_RTSPINLOCK;
-#endif
-
-
-/**
- * API for cleaning up the heap spinlock on IPRT termination.
- * This is as RTMemExecDonate specific to AMD64 Linux/GNU.
- */
-DECLHIDDEN(void) rtR0MemExecCleanup(void)
-{
-#ifdef RTMEMALLOC_EXEC_HEAP
-    RTSpinlockDestroy(g_HeapExecSpinlock);
-    g_HeapExecSpinlock = NIL_RTSPINLOCK;
-#endif
-}
-
-
-#ifdef RTMEMALLOC_EXEC_VM_AREA
-/**
- * Allocate executable kernel memory in the module range.
- *
- * @returns Pointer to a allocation header success.  NULL on failure.
- *
- * @param   cb          The size the user requested.
- */
-static PRTMEMHDR rtR0MemAllocExecVmArea(size_t cb)
-{
-    size_t const        cbAlloc = RT_ALIGN_Z(sizeof(RTMEMLNXHDREX) + cb, PAGE_SIZE);
-    size_t const        cPages  = cbAlloc >> PAGE_SHIFT;
-    struct page       **papPages;
-    struct vm_struct   *pVmArea;
-    size_t              iPage;
-
-    pVmArea = __get_vm_area(cbAlloc, VM_ALLOC, MODULES_VADDR, MODULES_END);
-    if (!pVmArea)
-        return NULL;
-    pVmArea->nr_pages = 0;    /* paranoia? */
-    pVmArea->pages    = NULL; /* paranoia? */
-
-    papPages = (struct page **)kmalloc(cPages * sizeof(papPages[0]), GFP_KERNEL | __GFP_NOWARN);
-    if (!papPages)
-    {
-        vunmap(pVmArea->addr);
-        return NULL;
-    }
-
-    for (iPage = 0; iPage < cPages; iPage++)
-    {
-        papPages[iPage] = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN);
-        if (!papPages[iPage])
-            break;
-    }
-    if (iPage == cPages)
-    {
-        /*
-         * Map the pages.
-         *
-         * Not entirely sure we really need to set nr_pages and pages here, but
-         * they provide a very convenient place for storing something we need
-         * in the free function, if nothing else...
-         */
-# if RTLNX_VER_MAX(3,17,0)
-        struct page **papPagesIterator = papPages;
-# endif
-        pVmArea->nr_pages = cPages;
-        pVmArea->pages    = papPages;
-        if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC,
-# if RTLNX_VER_MAX(3,17,0)
-                         &papPagesIterator
-# else
-                         papPages
-# endif
-                         ))
-        {
-            PRTMEMLNXHDREX pHdrEx = (PRTMEMLNXHDREX)pVmArea->addr;
-            pHdrEx->pVmArea     = pVmArea;
-            pHdrEx->pvDummy     = NULL;
-            return &pHdrEx->Hdr;
-        }
-        /* bail out */
-# if RTLNX_VER_MAX(3,17,0)
-        pVmArea->nr_pages = papPagesIterator - papPages;
-# endif
-    }
-
-    vunmap(pVmArea->addr);
-
-    while (iPage-- > 0)
-        __free_page(papPages[iPage]);
-    kfree(papPages);
-
-    return NULL;
-}
-#endif /* RTMEMALLOC_EXEC_VM_AREA */
 
 
@@ -214,83 +62,43 @@
      * Allocate.
      */
-    if (fFlags & RTMEMHDR_FLAG_EXEC)
-    {
-        if (fFlags & RTMEMHDR_FLAG_ANY_CTX)
-            return VERR_NOT_SUPPORTED;
-
-#if defined(RT_ARCH_AMD64)
-# ifdef RTMEMALLOC_EXEC_HEAP
-        if (g_HeapExec != NIL_RTHEAPSIMPLE)
+    if (
+#if 1 /* vmalloc has serious performance issues, avoid it. */
+           cb <= PAGE_SIZE*16 - sizeof(*pHdr)
+#else
+           cb <= PAGE_SIZE
+#endif
+        || (fFlags & RTMEMHDR_FLAG_ANY_CTX)
+       )
+    {
+        fFlags |= RTMEMHDR_FLAG_KMALLOC;
+        pHdr = kmalloc(cb + sizeof(*pHdr),
+                       fFlags & RTMEMHDR_FLAG_ANY_CTX_ALLOC ? GFP_ATOMIC | __GFP_NOWARN : GFP_KERNEL | __GFP_NOWARN);
+        if (RT_UNLIKELY(   !pHdr
+                        && cb > PAGE_SIZE
+                        && !(fFlags & RTMEMHDR_FLAG_ANY_CTX) ))
         {
-            RTSpinlockAcquire(g_HeapExecSpinlock);
-            pHdr = (PRTMEMHDR)RTHeapSimpleAlloc(g_HeapExec, cb + sizeof(*pHdr), 0);
-            RTSpinlockRelease(g_HeapExecSpinlock);
-            fFlags |= RTMEMHDR_FLAG_EXEC_HEAP;
+            fFlags &= ~RTMEMHDR_FLAG_KMALLOC;
+            pHdr = vmalloc(cb + sizeof(*pHdr));
         }
-        else
-            pHdr = NULL;
-
-# elif defined(RTMEMALLOC_EXEC_VM_AREA)
-        pHdr = rtR0MemAllocExecVmArea(cb);
-        fFlags |= RTMEMHDR_FLAG_EXEC_VM_AREA;
-
-# else  /* !RTMEMALLOC_EXEC_HEAP && !RTMEMALLOC_EXEC_VM_AREA */
-#  error "you do not want to go here..."
-        pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(*pHdr), GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN, MY_PAGE_KERNEL_EXEC);
-# endif /* !RTMEMALLOC_EXEC_HEAP && !RTMEMALLOC_EXEC_VM_AREA */
-
-#elif defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE)
-# if RTLNX_VER_MIN(5,8,0)
-        AssertMsgFailed(("This point should not be reached, please file a bug\n"));
-        pHdr = NULL;
-# else
-        pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(*pHdr), GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN, MY_PAGE_KERNEL_EXEC);
-# endif
-#else
-        pHdr = (PRTMEMHDR)vmalloc(cb + sizeof(*pHdr));
-#endif
     }
     else
-    {
-        if (
-#if 1 /* vmalloc has serious performance issues, avoid it. */
-               cb <= PAGE_SIZE*16 - sizeof(*pHdr)
-#else
-               cb <= PAGE_SIZE
-#endif
-            || (fFlags & RTMEMHDR_FLAG_ANY_CTX)
-           )
-        {
-            fFlags |= RTMEMHDR_FLAG_KMALLOC;
-            pHdr = kmalloc(cb + sizeof(*pHdr),
-                           fFlags & RTMEMHDR_FLAG_ANY_CTX_ALLOC ? GFP_ATOMIC | __GFP_NOWARN : GFP_KERNEL | __GFP_NOWARN);
-            if (RT_UNLIKELY(   !pHdr
-                            && cb > PAGE_SIZE
-                            && !(fFlags & RTMEMHDR_FLAG_ANY_CTX) ))
-            {
-                fFlags &= ~RTMEMHDR_FLAG_KMALLOC;
-                pHdr = vmalloc(cb + sizeof(*pHdr));
-            }
-        }
-        else
-            pHdr = vmalloc(cb + sizeof(*pHdr));
-    }
-    if (RT_UNLIKELY(!pHdr))
-    {
+        pHdr = vmalloc(cb + sizeof(*pHdr));
+    if (RT_LIKELY(pHdr))
+    {
+        /*
+         * Initialize.
+         */
+        pHdr->u32Magic  = RTMEMHDR_MAGIC;
+        pHdr->fFlags    = fFlags;
+        pHdr->cb        = cb;
+        pHdr->cbReq     = cb;
+
+        *ppHdr = pHdr;
         IPRT_LINUX_RESTORE_EFL_AC();
-        return VERR_NO_MEMORY;
-    }
-
-    /*
-     * Initialize.
-     */
-    pHdr->u32Magic  = RTMEMHDR_MAGIC;
-    pHdr->fFlags    = fFlags;
-    pHdr->cb        = cb;
-    pHdr->cbReq     = cb;
-
-    *ppHdr = pHdr;
+        return VINF_SUCCESS;
+    }
+
     IPRT_LINUX_RESTORE_EFL_AC();
-    return VINF_SUCCESS;
+    return VERR_NO_MEMORY;
 }
 
@@ -306,27 +114,4 @@
     if (pHdr->fFlags & RTMEMHDR_FLAG_KMALLOC)
         kfree(pHdr);
-#ifdef RTMEMALLOC_EXEC_HEAP
-    else if (pHdr->fFlags & RTMEMHDR_FLAG_EXEC_HEAP)
-    {
-        RTSpinlockAcquire(g_HeapExecSpinlock);
-        RTHeapSimpleFree(g_HeapExec, pHdr);
-        RTSpinlockRelease(g_HeapExecSpinlock);
-    }
-#endif
-#ifdef RTMEMALLOC_EXEC_VM_AREA
-    else if (pHdr->fFlags & RTMEMHDR_FLAG_EXEC_VM_AREA)
-    {
-        PRTMEMLNXHDREX pHdrEx    = RT_FROM_MEMBER(pHdr, RTMEMLNXHDREX, Hdr);
-        size_t         iPage     = pHdrEx->pVmArea->nr_pages;
-        struct page  **papPages  = pHdrEx->pVmArea->pages;
-        void          *pvMapping = pHdrEx->pVmArea->addr;
-
-        vunmap(pvMapping);
-
-        while (iPage-- > 0)
-            __free_page(papPages[iPage]);
-        kfree(papPages);
-    }
-#endif
     else
         vfree(pHdr);
Index: trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c	(revision 97910)
@@ -134,6 +134,4 @@
 #endif
 
-    rtR0MemExecCleanup();
-
     IPRT_LINUX_RESTORE_EFL_AC();
 }
Index: trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp
===================================================================
--- trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp	(revision 97910)
@@ -57,6 +57,5 @@
     {
         PRTMEMHDR       pHdr;
-        POOL_TYPE const enmPoolType = !(fFlags & RTMEMHDR_FLAG_EXEC) && g_uRtNtVersion >= RTNT_MAKE_VERSION(8,0)
-                                    ? NonPagedPoolNx : NonPagedPool;
+        POOL_TYPE const enmPoolType = g_uRtNtVersion >= RTNT_MAKE_VERSION(8,0) ? NonPagedPoolNx : NonPagedPool;
         if (g_pfnrtExAllocatePoolWithTag)
             pHdr = (PRTMEMHDR)g_pfnrtExAllocatePoolWithTag(enmPoolType, cb + sizeof(*pHdr), IPRT_NT_POOL_TAG);
@@ -66,5 +65,5 @@
             pHdr = (PRTMEMHDR)ExAllocatePool(enmPoolType, cb + sizeof(*pHdr));
         }
-        if (pHdr)
+        if (RT_LIKELY(pHdr))
         {
             pHdr->u32Magic  = RTMEMHDR_MAGIC;
Index: trunk/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c	(revision 97909)
+++ trunk/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c	(revision 97910)
@@ -80,21 +80,9 @@
     size_t      cbAllocated = cb;
     PRTMEMHDR   pHdr;
-
-#ifdef RT_ARCH_AMD64
-    if (fFlags & RTMEMHDR_FLAG_EXEC)
-    {
-        AssertReturn(!(fFlags & RTMEMHDR_FLAG_ANY_CTX), VERR_NOT_SUPPORTED);
-        cbAllocated = RT_ALIGN_Z(cb + sizeof(*pHdr), PAGE_SIZE) - sizeof(*pHdr);
-        pHdr = (PRTMEMHDR)segkmem_alloc(heaptext_arena, cbAllocated + sizeof(*pHdr), KM_SLEEP);
-    }
+    unsigned fKmFlags = fFlags & RTMEMHDR_FLAG_ANY_CTX_ALLOC ? KM_NOSLEEP : KM_SLEEP;
+    if (fFlags & RTMEMHDR_FLAG_ZEROED)
+        pHdr = (PRTMEMHDR)kmem_zalloc(cb + sizeof(*pHdr), fKmFlags);
     else
-#endif
-    {
-        unsigned fKmFlags = fFlags & RTMEMHDR_FLAG_ANY_CTX_ALLOC ? KM_NOSLEEP : KM_SLEEP;
-        if (fFlags & RTMEMHDR_FLAG_ZEROED)
-            pHdr = (PRTMEMHDR)kmem_zalloc(cb + sizeof(*pHdr), fKmFlags);
-        else
-            pHdr = (PRTMEMHDR)kmem_alloc(cb + sizeof(*pHdr), fKmFlags);
-    }
+        pHdr = (PRTMEMHDR)kmem_alloc(cb + sizeof(*pHdr), fKmFlags);
     if (RT_UNLIKELY(!pHdr))
     {
@@ -119,10 +107,5 @@
 {
     pHdr->u32Magic += 1;
-#ifdef RT_ARCH_AMD64
-    if (pHdr->fFlags & RTMEMHDR_FLAG_EXEC)
-        segkmem_free(heaptext_arena, pHdr, pHdr->cb + sizeof(*pHdr));
-    else
-#endif
-        kmem_free(pHdr, pHdr->cb + sizeof(*pHdr));
+    kmem_free(pHdr, pHdr->cb + sizeof(*pHdr));
 }
 
