Index: /trunk/include/VBox/mm.h
===================================================================
--- /trunk/include/VBox/mm.h	(revision 17250)
+++ /trunk/include/VBox/mm.h	(revision 17251)
@@ -44,4 +44,5 @@
  */
 
+#ifndef VBOX_WITH_NEW_PHYS_CODE
 /** @name RAM Page Flags
  * Since internal ranges have a byte granularity it's possible for a
@@ -53,5 +54,4 @@
  * @{
  */
-#if 1
 /** Reserved - Not RAM, ROM nor MMIO2.
  * If this bit is cleared the memory is assumed to be some kind of RAM.
@@ -82,10 +82,7 @@
  */
 #define MM_RAM_FLAGS_MMIO2              RT_BIT(3)
-#endif
-
-#ifndef VBOX_WITH_NEW_PHYS_CODE
+
 /** Physical backing memory is allocated dynamically. Not set implies a one time static allocation. */
 #define MM_RAM_FLAGS_DYNAMIC_ALLOC      RT_BIT(11)
-#endif /* !VBOX_WITH_NEW_PHYS_CODE */
 
 /** The shift used to get the reference count. */
@@ -107,5 +104,4 @@
 /** @} */
 
-#ifndef VBOX_WITH_NEW_PHYS_CODE
 /** @name MMR3PhysRegisterEx registration type
  * @{
@@ -121,5 +117,5 @@
 } MMPHYSREG;
 /** @} */
-#endif
+#endif /* !VBOX_WITH_NEW_PHYS_CODE */
 
 /**
@@ -353,11 +349,11 @@
  * @ingroup grp_mm_r3
  * @{ */
+#ifndef VBOX_WITH_NEW_PHYS_CODE
 VMMR3DECL(int)      MMR3PhysRegister(PVM pVM, void *pvRam, RTGCPHYS GCPhys, unsigned cb, unsigned fFlags, const char *pszDesc);
-#ifndef VBOX_WITH_NEW_PHYS_CODE
 VMMR3DECL(int)      MMR3PhysRegisterEx(PVM pVM, void *pvRam, RTGCPHYS GCPhys, unsigned cb, unsigned fFlags, MMPHYSREG enmType, const char *pszDesc);
-#endif
 VMMR3DECL(int)      MMR3PhysRomRegister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc);
 VMMR3DECL(int)      MMR3PhysRomProtect(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange);
 VMMR3DECL(int)      MMR3PhysReserve(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc);
+#endif
 VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM);
 /** @} */
Index: /trunk/include/VBox/pdmdev.h
===================================================================
--- /trunk/include/VBox/pdmdev.h	(revision 17250)
+++ /trunk/include/VBox/pdmdev.h	(revision 17251)
@@ -41,5 +41,7 @@
 #include <VBox/cfgm.h>
 #include <VBox/dbgf.h>
-#include <VBox/mm.h>
+#ifndef VBOX_WITH_NEW_PHYS_CODE
+# include <VBox/mm.h>
+#endif
 #include <VBox/err.h>
 #include <VBox/pci.h>
@@ -2660,15 +2662,15 @@
 
     /**
-     * Write protects a shadow ROM mapping.
-     *
-     * This is intented for use by the system BIOS or by the device that
-     * employs a shadow ROM BIOS, so that the shadow ROM mapping can be
-     * write protected once the POST is over.
+     * Changes the protection of shadowed ROM mapping.
+     *
+     * This is intented for use by the system BIOS, chipset or device in question to
+     * change the protection of shadowed ROM code after init and on reset.
      *
      * @param   pDevIns     Device instance.
-     * @param   GCPhysStart Where the shadow ROM mapping starts.
-     * @param   cbRange     The size of the shadow ROM mapping.
-     */
-    DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange));
+     * @param   GCPhysStart Where the mapping starts.
+     * @param   cbRange     The size of the mapping.
+     * @param   enmProt     The new protection type.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt));
 
     /**
@@ -3294,7 +3296,7 @@
  * @copydoc PDMDEVHLPR3::pfnROMProtectShadow
  */
-DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
-{
-    return pDevIns->pDevHlpR3->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange);
+DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
+{
+    return pDevIns->pDevHlpR3->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange, enmProt);
 }
 
@@ -3511,4 +3513,5 @@
 }
 
+#ifndef VBOX_WITH_NEW_PHYS_CODE
 /**
  * @copydoc PDMDEVHLPR3::pfnPhysReserve
@@ -3518,4 +3521,5 @@
     return pDevIns->pDevHlpR3->pfnPhysReserve(pDevIns, GCPhys, cbRange, pszDesc);
 }
+#endif
 
 /**
Index: /trunk/include/VBox/pgm.h
===================================================================
--- /trunk/include/VBox/pgm.h	(revision 17250)
+++ /trunk/include/VBox/pgm.h	(revision 17251)
@@ -273,29 +273,4 @@
  */
 #define PGMMODE_IS_LONG_MODE(enmMode) ((enmMode) == PGMMODE_AMD64_NX || (enmMode) == PGMMODE_AMD64)
-
-/**
- * The current ROM page protection.
- */
-typedef enum PGMROMPROT
-{
-    /** The customary invalid value. */
-    PGMROMPROT_INVALID = 0,
-    /** Read from the virgin ROM page, ignore writes.
-     * Map the virgin page, use write access handler to ignore writes. */
-    PGMROMPROT_READ_ROM_WRITE_IGNORE,
-    /** Read from the virgin ROM page, write to the shadow RAM.
-     * Map the virgin page, use write access handler change the RAM. */
-    PGMROMPROT_READ_ROM_WRITE_RAM,
-    /** Read from the shadow ROM page, ignore writes.
-     * Map the shadow page read-only, use write access handler to ignore writes. */
-    PGMROMPROT_READ_RAM_WRITE_IGNORE,
-    /** Read from the shadow ROM page, ignore writes.
-     * Map the shadow page read-write, disabled write access handler. */
-    PGMROMPROT_READ_RAM_WRITE_RAM,
-    /** The end of valid values. */
-    PGMROMPROT_END,
-    /** The usual 32-bit type size hack. */
-    PGMROMPROT_32BIT_HACK = 0x7fffffff
-} PGMROMPROT;
 
 /**
Index: /trunk/include/VBox/rem.h
===================================================================
--- /trunk/include/VBox/rem.h	(revision 17250)
+++ /trunk/include/VBox/rem.h	(revision 17251)
@@ -82,5 +82,5 @@
 #endif
 REMR3DECL(void) REMR3NotifyPhysRomRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvCopy, bool fShadow);
-REMR3DECL(void) REMR3NotifyPhysReserve(PVM pVM, RTGCPHYS GCPhys, RTUINT cb);
+REMR3DECL(void) REMR3NotifyPhysRamDeregister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb);
 REMR3DECL(void) REMR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler);
 REMR3DECL(void) REMR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
Index: /trunk/include/VBox/types.h
===================================================================
--- /trunk/include/VBox/types.h	(revision 17250)
+++ /trunk/include/VBox/types.h	(revision 17251)
@@ -543,4 +543,31 @@
 typedef PDMDATASEG const *PCPDMDATASEG;
 
+
+/**
+ * The current ROM page protection.
+ */
+typedef enum PGMROMPROT
+{
+    /** The customary invalid value. */
+    PGMROMPROT_INVALID = 0,
+    /** Read from the virgin ROM page, ignore writes.
+     * Map the virgin page, use write access handler to ignore writes. */
+    PGMROMPROT_READ_ROM_WRITE_IGNORE,
+    /** Read from the virgin ROM page, write to the shadow RAM.
+     * Map the virgin page, use write access handler change the RAM. */
+    PGMROMPROT_READ_ROM_WRITE_RAM,
+    /** Read from the shadow ROM page, ignore writes.
+     * Map the shadow page read-only, use write access handler to ignore writes. */
+    PGMROMPROT_READ_RAM_WRITE_IGNORE,
+    /** Read from the shadow ROM page, ignore writes.
+     * Map the shadow page read-write, disabled write access handler. */
+    PGMROMPROT_READ_RAM_WRITE_RAM,
+    /** The end of valid values. */
+    PGMROMPROT_END,
+    /** The usual 32-bit type size hack. */
+    PGMROMPROT_32BIT_HACK = 0x7fffffff
+} PGMROMPROT;
+
+
 /** @} */
 
Index: /trunk/src/VBox/Devices/PC/DevPcArch.c
===================================================================
--- /trunk/src/VBox/Devices/PC/DevPcArch.c	(revision 17250)
+++ /trunk/src/VBox/Devices/PC/DevPcArch.c	(revision 17251)
@@ -252,4 +252,5 @@
         return rc;
 
+#ifndef VBOX_WITH_NEW_PHYS_CODE
     /*
      * Reserve ROM/MMIO areas:
@@ -264,4 +265,5 @@
     if (RT_FAILURE(rc))
         return rc;
+#endif
 
     return VINF_SUCCESS;
Index: /trunk/src/VBox/VMM/MM.cpp
===================================================================
--- /trunk/src/VBox/VMM/MM.cpp	(revision 17250)
+++ /trunk/src/VBox/VMM/MM.cpp	(revision 17251)
@@ -500,5 +500,7 @@
 VMMR3DECL(void) MMR3Reset(PVM pVM)
 {
+#ifndef VBOX_WITH_NEW_PHYS_CODE
     mmR3PhysRomReset(pVM);
+#endif
 }
 
Index: /trunk/src/VBox/VMM/MMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/MMInternal.h	(revision 17250)
+++ /trunk/src/VBox/VMM/MMInternal.h	(revision 17251)
@@ -565,4 +565,5 @@
 
 
+#ifndef VBOX_WITH_NEW_PHYS_CODE
 /**
  * A registered Rom range.
@@ -594,4 +595,5 @@
 /** Pointer to a ROM range. */
 typedef MMROMRANGE *PMMROMRANGE;
+#endif /* !VBOX_WITH_NEW_PHYS_CODE */
 
 
@@ -765,6 +767,8 @@
     uint32_t                    cFixedPages;
 
+#ifndef VBOX_WITH_NEW_PHYS_CODE
     /** The head of the ROM ranges. */
     R3PTRTYPE(PMMROMRANGE)      pRomHead;
+#endif
 } MM;
 /** Pointer to MM Data (part of VM). */
@@ -803,5 +807,7 @@
 const char *mmR3GetTagName(MMTAG enmTag);
 
+#ifndef VBOX_WITH_NEW_PHYS_CODE
 void mmR3PhysRomReset(PVM pVM);
+#endif
 
 /**
Index: /trunk/src/VBox/VMM/MMPhys.cpp
===================================================================
--- /trunk/src/VBox/VMM/MMPhys.cpp	(revision 17250)
+++ /trunk/src/VBox/VMM/MMPhys.cpp	(revision 17251)
@@ -41,4 +41,19 @@
 #include <iprt/string.h>
 
+
+/**
+ * Get the size of the base RAM.
+ * This usually means the size of the first contigous block of physical memory.
+ *
+ * @returns The guest base RAM size.
+ * @param   pVM         The VM handle.
+ * @thread  Any.
+ */
+VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM)
+{
+    return pVM->mm.s.cbRamBase;
+}
+
+#ifndef VBOX_WITH_NEW_PHYS_CODE
 
 /**
@@ -221,5 +236,5 @@
  */
 VMMR3DECL(int) MMR3PhysRomRegister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const void *pvBinary,
-                                  bool fShadow, const char *pszDesc)
+                                   bool fShadow, const char *pszDesc)
 {
     /*
@@ -401,20 +416,6 @@
     AssertRC(rc);
 
-    REMR3NotifyPhysReserve(pVM, GCPhys, cbRange);
+    REMR3NotifyPhysRamDeregister(pVM, GCPhys, cbRange);
     return rc;
-}
-
-
-/**
- * Get the size of the base RAM.
- * This usually means the size of the first contigous block of physical memory.
- *
- * @returns The guest base RAM size.
- * @param   pVM         The VM handle.
- * @thread  Any.
- */
-VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM)
-{
-    return pVM->mm.s.cbRamBase;
 }
 
@@ -490,2 +491,3 @@
 }
 
+#endif /* !VBOX_WITH_NEW_PHYS_CODE */
Index: /trunk/src/VBox/VMM/PDMDevHlp.cpp
===================================================================
--- /trunk/src/VBox/VMM/PDMDevHlp.cpp	(revision 17250)
+++ /trunk/src/VBox/VMM/PDMDevHlp.cpp	(revision 17251)
@@ -349,5 +349,13 @@
              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc, pszDesc));
 
+#ifdef VBOX_WITH_NEW_PHYS_CODE
+    uint32_t fFlags = 0;
+    if (fShadow)
+        fFlags |= PGMPHYS_ROM_FLAG_SHADOWED;
+    /** @todo PGMPHYS_ROM_FLAG_PERMANENT_BINARY */
+    int rc = PGMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fFlags, pszDesc);
+#else
     int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc);
+#endif
 
     LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc));
@@ -2130,4 +2138,5 @@
 static DECLCALLBACK(int) pdmR3DevHlp_PhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc)
 {
+#ifndef VBOX_WITH_NEW_PHYS_CODE
     PDMDEV_ASSERT_DEVINS(pDevIns);
     VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
@@ -2140,4 +2149,8 @@
 
     return rc;
+#else
+    AssertFailed();
+    return VERR_ACCESS_DENIED;
+#endif
 }
 
@@ -2505,11 +2518,15 @@
 
 /** @copydoc PDMDEVHLPR3::pfnROMProtectShadow */
-static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
-{
-    PDMDEV_ASSERT_DEVINS(pDevIns);
-    LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x\n",
-             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange));
-
+static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
+{
+    PDMDEV_ASSERT_DEVINS(pDevIns);
+    LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x enmProt=%d\n",
+             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, enmProt));
+
+#ifdef VBOX_WITH_NEW_PHYS_CODE
+    int rc = PGMR3PhysRomProtect(pDevIns->Internal.s.pVMR3, GCPhysStart, cbRange, enmProt);
+#else
     int rc = MMR3PhysRomProtect(pDevIns->Internal.s.pVMR3, GCPhysStart, cbRange);
+#endif
 
     LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc));
@@ -3050,5 +3067,5 @@
 
 /** @copydoc PDMDEVHLPR3::pfnROMProtectShadow */
-static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
+static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
Index: /trunk/src/VBox/VMM/PGMPhys.cpp
===================================================================
--- /trunk/src/VBox/VMM/PGMPhys.cpp	(revision 17250)
+++ /trunk/src/VBox/VMM/PGMPhys.cpp	(revision 17251)
@@ -171,5 +171,4 @@
 
 
-
 /**
  * Sets up a range RAM.
@@ -245,7 +244,7 @@
 
     pNew->pvR3          = NULL;
+#ifndef VBOX_WITH_NEW_PHYS_CODE
     pNew->paChunkR3Ptrs = NULL;
 
-#ifndef VBOX_WITH_NEW_PHYS_CODE
     /* Allocate memory for chunk to HC ptr lookup array. */
     rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->paChunkR3Ptrs);
@@ -303,5 +302,5 @@
                     case PGMPAGETYPE_RAM:
                         if (!PGM_PAGE_IS_ZERO(pPage))
-                            pgmPhysFreePage(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)i << PAGE_SHIFT));
+                            pgmPhysFreePage(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT));
                         break;
 
@@ -351,5 +350,5 @@
                             case PGM_PAGE_STATE_SHARED:
                             case PGM_PAGE_STATE_WRITE_MONITORED:
-                                rc = pgmPhysPageMakeWritable(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)i << PAGE_SHIFT));
+                                rc = pgmPhysPageMakeWritable(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT));
                                 AssertLogRelRCReturn(rc, rc);
                             case PGM_PAGE_STATE_ALLOCATED:
@@ -357,5 +356,5 @@
                                 void *pvPage;
                                 PPGMPAGEMAP pMapIgnored;
-                                rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)i << PAGE_SHIFT), &pMapIgnored, &pvPage);
+                                rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT), &pMapIgnored, &pvPage);
                                 AssertLogRelRCReturn(rc, rc);
                                 ASMMemZeroPage(pvPage);
@@ -488,5 +487,7 @@
 
         pNew->pvR3          = NULL;
+#ifndef VBOX_WITH_NEW_PHYS_CODE
         pNew->paChunkR3Ptrs = NULL;
+#endif
 
         uint32_t iPage = cPages;
@@ -701,5 +702,7 @@
 
             pNew->RamRange.pvR3 = pvPages;       ///@todo remove this [new phys code]
+#ifndef VBOX_WITH_NEW_PHYS_CODE
             pNew->RamRange.paChunkR3Ptrs = NULL; ///@todo remove this [new phys code]
+#endif
 
             uint32_t iPage = cPages;
@@ -995,5 +998,5 @@
     else
     {
-        REMR3NotifyPhysReserve(pVM, pCur->RamRange.GCPhys, pCur->RamRange.cb);
+        REMR3NotifyPhysRamDeregister(pVM, pCur->RamRange.GCPhys, pCur->RamRange.cb);
         pgmR3PhysUnlinkRamRange(pVM, &pCur->RamRange);
     }
@@ -1504,5 +1507,4 @@
 
 
-
 /**
  * Called by PGMR3Reset to reset the shadow, switch to the virgin,
@@ -1699,4 +1701,5 @@
 }
 
+#ifndef VBOX_WITH_NEW_PHYS_CODE
 
 /**
@@ -1851,5 +1854,4 @@
 }
 
-#ifndef VBOX_WITH_NEW_PHYS_CODE
 
 /**
@@ -2050,5 +2052,4 @@
 
 #endif /* !VBOX_WITH_NEW_PHYS_CODE */
-
 
 /**
Index: /trunk/src/recompiler/VBoxREM.def
===================================================================
--- /trunk/src/recompiler/VBoxREM.def	(revision 17250)
+++ /trunk/src/recompiler/VBoxREM.def	(revision 17251)
@@ -1,6 +1,7 @@
 ; $Id$
 ;; @file
+; VBoxREM Definition File.
 ;
-; VBoxREM Definition File.
+
 ;
 ; Copyright (C) 2006-2007 Sun Microsystems, Inc.
@@ -39,5 +40,5 @@
     REMR3NotifyPhysRamRegister
     REMR3NotifyPhysRamChunkRegister
-    REMR3NotifyPhysReserve
+    REMR3NotifyPhysRamDeregister
     REMR3NotifyPhysRomRegister
     REMR3NotifyHandlerPhysicalModify
Index: /trunk/src/recompiler/VBoxREMWrapper.cpp
===================================================================
--- /trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 17250)
+++ /trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 17251)
@@ -348,5 +348,5 @@
 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTUINT, unsigned);
 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamChunkRegister)(PVM, RTGCPHYS, RTUINT, RTHCUINTPTR, unsigned);
-static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysReserve)(PVM, RTGCPHYS, RTUINT);
+static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamDeregister)(PVM, RTGCPHYS, RTUINT);
 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRomRegister)(PVM, RTGCPHYS, RTUINT, void *, bool);
 static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalModify)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, RTGCPHYS, bool, bool);
@@ -1030,5 +1030,5 @@
     { "REMR3NotifyPhysRamRegister",             (void *)&pfnREMR3NotifyPhysRamRegister,             &g_aArgsNotifyPhysRamRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRamRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3NotifyPhysRamChunkRegister",        (void *)&pfnREMR3NotifyPhysRamChunkRegister,        &g_aArgsNotifyPhysRamChunkRegister[0],      RT_ELEMENTS(g_aArgsNotifyPhysRamChunkRegister),        REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
-    { "REMR3NotifyPhysReserve",                 (void *)&pfnREMR3NotifyPhysReserve,                 &g_aArgsNotifyPhysReserve[0],               RT_ELEMENTS(g_aArgsNotifyPhysReserve),                 REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
+    { "REMR3NotifyPhysRamDeregister",           (void *)&pfnREMR3NotifyPhysRamDeregister,           &g_aArgsNotifyPhysRamDeregister[0],         RT_ELEMENTS(g_aArgsNotifyPhysRamDeregister),           REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3NotifyPhysRomRegister",             (void *)&pfnREMR3NotifyPhysRomRegister,             &g_aArgsNotifyPhysRomRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRomRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3NotifyHandlerPhysicalModify",       (void *)&pfnREMR3NotifyHandlerPhysicalModify,       &g_aArgsNotifyHandlerPhysicalModify[0],     RT_ELEMENTS(g_aArgsNotifyHandlerPhysicalModify),       REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
@@ -2172,9 +2172,9 @@
 }
 
-REMR3DECL(void) REMR3NotifyPhysReserve(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
+REMR3DECL(void) REMR3NotifyPhysRamDeregister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
 {
 #ifndef USE_REM_STUBS
-    Assert(VALID_PTR(pfnREMR3NotifyPhysReserve));
-    pfnREMR3NotifyPhysReserve(pVM, GCPhys, cb);
+    Assert(VALID_PTR(pfnREMR3NotifyPhysRamDeregister));
+    pfnREMR3NotifyPhysRamDeregister(pVM, GCPhys, cb);
 #endif
 }
Index: /trunk/src/recompiler/VBoxRecompiler.c
===================================================================
--- /trunk/src/recompiler/VBoxRecompiler.c	(revision 17250)
+++ /trunk/src/recompiler/VBoxRecompiler.c	(revision 17251)
@@ -2861,10 +2861,8 @@
  * @param   GCPhys      Start physical address.
  * @param   cb          The size of the range.
- * @todo    Rename to REMR3NotifyPhysRamDeregister (for MMIO2) as we won't
- *          reserve any memory soon.
- */
-REMR3DECL(void) REMR3NotifyPhysReserve(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
-{
-    Log(("REMR3NotifyPhysReserve: GCPhys=%RGp cb=%d\n", GCPhys, cb));
+ */
+REMR3DECL(void) REMR3NotifyPhysRamDeregister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
+{
+    Log(("REMR3NotifyPhysRamDeregister: GCPhys=%RGp cb=%d\n", GCPhys, cb));
     VM_ASSERT_EMT(pVM);
 
Index: /trunk/src/recompiler_new/VBoxREM.def
===================================================================
--- /trunk/src/recompiler_new/VBoxREM.def	(revision 17250)
+++ /trunk/src/recompiler_new/VBoxREM.def	(revision 17251)
@@ -1,6 +1,7 @@
 ; $Id$
 ;; @file
+; VBoxREM Definition File.
 ;
-; VBoxREM Definition File.
+
 ;
 ; Copyright (C) 2006-2007 Sun Microsystems, Inc.
@@ -39,5 +40,5 @@
     REMR3NotifyPhysRamRegister
     REMR3NotifyPhysRamChunkRegister
-    REMR3NotifyPhysReserve
+    REMR3NotifyPhysRamDeregister
     REMR3NotifyPhysRomRegister
     REMR3NotifyHandlerPhysicalModify
Index: /trunk/src/recompiler_new/VBoxREMWrapper.cpp
===================================================================
--- /trunk/src/recompiler_new/VBoxREMWrapper.cpp	(revision 17250)
+++ /trunk/src/recompiler_new/VBoxREMWrapper.cpp	(revision 17251)
@@ -348,5 +348,5 @@
 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTUINT, unsigned);
 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamChunkRegister)(PVM, RTGCPHYS, RTUINT, RTHCUINTPTR, unsigned);
-static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysReserve)(PVM, RTGCPHYS, RTUINT);
+static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamDeregister)(PVM, RTGCPHYS, RTUINT);
 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRomRegister)(PVM, RTGCPHYS, RTUINT, void *, bool);
 static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalModify)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, RTGCPHYS, bool, bool);
@@ -410,5 +410,5 @@
     { REMPARMDESC_FLAGS_INT,        sizeof(unsigned), NULL }
 };
-static const REMPARMDESC g_aArgsNotifyPhysReserve[] =
+static const REMPARMDESC g_aArgsNotifyPhysRamDeregister[] =
 {
     { REMPARMDESC_FLAGS_INT,        sizeof(PVM), NULL },
@@ -1048,5 +1048,5 @@
     { "REMR3NotifyPhysRamRegister",             (void *)&pfnREMR3NotifyPhysRamRegister,             &g_aArgsNotifyPhysRamRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRamRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3NotifyPhysRamChunkRegister",        (void *)&pfnREMR3NotifyPhysRamChunkRegister,        &g_aArgsNotifyPhysRamChunkRegister[0],      RT_ELEMENTS(g_aArgsNotifyPhysRamChunkRegister),        REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
-    { "REMR3NotifyPhysReserve",                 (void *)&pfnREMR3NotifyPhysReserve,                 &g_aArgsNotifyPhysReserve[0],               RT_ELEMENTS(g_aArgsNotifyPhysReserve),                 REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
+    { "REMR3NotifyPhysRamDeregister",           (void *)&pfnREMR3NotifyPhysRamDeregister,           &g_aArgsNotifyPhysRamDeregister[0],         RT_ELEMENTS(g_aArgsNotifyPhysRamDeregister),           REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3NotifyPhysRomRegister",             (void *)&pfnREMR3NotifyPhysRomRegister,             &g_aArgsNotifyPhysRomRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRomRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     { "REMR3NotifyHandlerPhysicalModify",       (void *)&pfnREMR3NotifyHandlerPhysicalModify,       &g_aArgsNotifyHandlerPhysicalModify[0],     RT_ELEMENTS(g_aArgsNotifyHandlerPhysicalModify),       REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
@@ -2198,9 +2198,9 @@
 }
 
-REMR3DECL(void) REMR3NotifyPhysReserve(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
+REMR3DECL(void) REMR3NotifyPhysRamDeregister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
 {
 #ifndef USE_REM_STUBS
-    Assert(VALID_PTR(pfnREMR3NotifyPhysReserve));
-    pfnREMR3NotifyPhysReserve(pVM, GCPhys, cb);
+    Assert(VALID_PTR(pfnREMR3NotifyPhysRamDeregister));
+    pfnREMR3NotifyPhysRamDeregister(pVM, GCPhys, cb);
 #endif
 }
Index: /trunk/src/recompiler_new/VBoxRecompiler.c
===================================================================
--- /trunk/src/recompiler_new/VBoxRecompiler.c	(revision 17250)
+++ /trunk/src/recompiler_new/VBoxRecompiler.c	(revision 17251)
@@ -2689,8 +2689,5 @@
 
 #ifdef VBOX_WITH_NEW_PHYS_CODE
-    if (fFlags & MM_RAM_FLAGS_RESERVED)
-        cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED);
-    else
-        cpu_register_physical_memory(GCPhys, cb, GCPhys);
+    cpu_register_physical_memory(GCPhys, cb, GCPhys);
 #else
     if (!GCPhys)
@@ -2810,10 +2807,8 @@
  * @param   GCPhys      Start physical address.
  * @param   cb          The size of the range.
- * @todo    Rename to REMR3NotifyPhysRamDeregister (for MMIO2) as we won't
- *          reserve any memory soon.
- */
-REMR3DECL(void) REMR3NotifyPhysReserve(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
-{
-    Log(("REMR3NotifyPhysReserve: GCPhys=%RGp cb=%d\n", GCPhys, cb));
+ */
+REMR3DECL(void) REMR3NotifyPhysRamDeregister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
+{
+    Log(("REMR3NotifyPhysRamDeregister: GCPhys=%RGp cb=%d\n", GCPhys, cb));
     VM_ASSERT_EMT(pVM);
 
