Index: /trunk/include/VBox/vmm/pgm.h
===================================================================
--- /trunk/include/VBox/vmm/pgm.h	(revision 92408)
+++ /trunk/include/VBox/vmm/pgm.h	(revision 92409)
@@ -695,4 +695,5 @@
  */
 VMMR3_INT_DECL(void)    PGMR3EnableNemMode(PVM pVM);
+VMMR3_INT_DECL(bool)    PGMR3IsNemModeEnabled(PVM pVM);
 VMMR3DECL(int)      PGMR3Init(PVM pVM);
 VMMR3DECL(int)      PGMR3InitFinalize(PVM pVM);
Index: /trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp	(revision 92408)
+++ /trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp	(revision 92409)
@@ -278,5 +278,6 @@
         bool fR0Enabled = false;
         bool fRCEnabled = false;
-        if (pReg->fFlags & (PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_RC))
+        if (   (pReg->fFlags & (PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_RC))
+            && !PGMR3IsNemModeEnabled(pVM) /* No ring-0 in simplified memory mode. */ )
         {
             if (pReg->fFlags & PDM_DEVREG_FLAGS_R0)
@@ -414,7 +415,13 @@
                                   VERR_ALLOCATION_TOO_BIG);
 
+#if 0  /* Several devices demands cacheline aligned data, if not page aligned. Real problem in NEM mode. */
             rc = MMR3HeapAllocZEx(pVM, MM_TAG_PDM_DEVICE, cb, (void **)&pDevIns);
             AssertLogRelMsgRCReturn(rc, ("Failed to allocate %zu bytes of instance data for device '%s'. rc=%Rrc\n",
                                          cb, pReg->szName, rc), rc);
+#else
+            pDevIns = (PPDMDEVINS)RTMemPageAllocZ(cb);
+            AssertLogRelMsgReturn(pDevIns, ("Failed to allocate %zu bytes of instance data for device '%s'\n", cb, pReg->szName),
+                                  VERR_NO_PAGE_MEMORY);
+#endif
 
             /* Initialize it: */
Index: /trunk/src/VBox/VMM/VMMR3/PGM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 92408)
+++ /trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 92409)
@@ -712,6 +712,6 @@
 #endif
 
-
 #ifdef VBOX_WITH_PGM_NEM_MODE
+
 /**
  * Interface that NEM uses to switch PGM into simplified memory managment mode.
@@ -726,6 +726,18 @@
     pVM->pgm.s.fNemMode = true;
 }
-#endif
-
+
+
+/**
+ * Checks whether the simplificed memory management mode for NEM is enabled.
+ *
+ * @returns true if enabled, false if not.
+ * @param   pVM     The cross context VM structure.
+ */
+VMMR3_INT_DECL(bool)    PGMR3IsNemModeEnabled(PVM pVM)
+{
+    return pVM->pgm.s.fNemMode;
+}
+
+#endif /* VBOX_WITH_PGM_NEM_MODE */
 
 /**
