Index: trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 45552)
+++ trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 45553)
@@ -872,61 +872,91 @@
         }
 
+        if (fOsXGuest)
+            InsertConfigInteger(pCPUM, "EnableHVP", 1);
+
+        /* Synthetic CPU */
+        BOOL fSyntheticCpu = false;
+        hrc = pMachine->GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu);          H();
+        InsertConfigInteger(pCPUM, "SyntheticCpu", fSyntheticCpu);
+
+        /* Physical Address Extension (PAE) */
+        BOOL fEnablePAE = false;
+        hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE);                   H();
+        InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE);
+
+
         /*
          * Hardware virtualization extensions.
          */
+        BOOL fIsGuest64Bit;
+        hrc = guestOSType->COMGETTER(Is64Bit)(&fIsGuest64Bit);                              H();
+        BOOL fSupportsLongMode;
+        hrc = host->GetProcessorFeature(ProcessorFeature_LongMode, &fSupportsLongMode);     H();
+        if (!fSupportsLongMode && fIsGuest64Bit)
+        {
+            LogRel(("WARNING! 64-bit guest type selected but the host CPU does NOT support 64-bit.\n"));
+            fIsGuest64Bit = FALSE;
+        }
+
         BOOL fHWVirtExEnabled;
-        BOOL fHwVirtExtForced = false;
+        hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHWVirtExEnabled); H();
+        if (cCpus > 1 && !fHWVirtExEnabled)
+        {
+            LogRel(("Forced fHWVirtExEnabled to TRUE by SMP guest.\n"));
+            fHWVirtExEnabled = TRUE;
+        }
+        if (!fHWVirtExEnabled && fIsGuest64Bit)
+        {
+            LogRel(("WARNING! 64-bit guest type selected on host without hardware virtualization (VT-x or AMD-V).\n"));
+            fIsGuest64Bit = FALSE;
+        }
+
+        BOOL fHwVirtExtForced;
 #ifdef VBOX_WITH_RAW_MODE
-        hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHWVirtExEnabled); H();
-        if (cCpus > 1) /** @todo SMP: This isn't nice, but things won't work on mac otherwise. */
-            fHWVirtExEnabled = TRUE;
+        /* - With more than 4GB PGM will use different RAMRANGE sizes for raw
+             mode and hv mode to optimize lookup times.
+           - With more than one virtual CPU, raw-mode isn't a fallback option.
+           - With a 64-bit guest, raw-mode isn't a fallback option either. */
+        fHwVirtExtForced = fHWVirtExEnabled
+                        && (   cbRam + cbRamHole > _4G
+                            || cCpus > 1
+                            || fIsGuest64Bit);
 # ifdef RT_OS_DARWIN
         fHwVirtExtForced = fHWVirtExEnabled;
-# else
-        /* - With more than 4GB PGM will use different RAMRANGE sizes for raw
-             mode and hv mode to optimize lookup times.
-           - With more than one virtual CPU, raw-mode isn't a fallback option. */
-        fHwVirtExtForced = fHWVirtExEnabled
-                        && (   cbRam + cbRamHole > _4G
-                            || cCpus > 1);
 # endif
+        if (fHwVirtExtForced)
+        {
+            if (cbRam + cbRamHole > _4G)
+                LogRel(("fHwVirtExtForced=TRUE - Lots of RAM\n"));
+            if (cCpus > 1)
+                LogRel(("fHwVirtExtForced=TRUE - SMP\n"));
+            if (fIsGuest64Bit)
+                LogRel(("fHwVirtExtForced=TRUE - 64-bit guest\n"));
+# ifdef RT_OS_DARWIN
+            LogRel(("fHwVirtExtForced=TRUE - Darwin host\n"));
+# endif
+        }
 #else  /* !VBOX_WITH_RAW_MODE */
-        fHWVirtExEnabled = fHwVirtExtForced = true;
+        fHWVirtExEnabled = fHwVirtExtForced = TRUE;
+        LogRel(("fHwVirtExtForced=TRUE - No raw-mode support in this build!\n"));
 #endif /* !VBOX_WITH_RAW_MODE */
-        /* only honor the property value if there was no other reason to enable it */
-        if (!fHwVirtExtForced)
+        if (!fHwVirtExtForced) /* No need to query if already forced above. */
         {
             hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHwVirtExtForced); H();
-        }
-        InsertConfigInteger(pRoot, "HwVirtExtForced",      fHwVirtExtForced);
-
-
-        /*
-         * MM values.
-         */
-        PCFGMNODE pMM;
-        InsertConfigNode(pRoot, "MM", &pMM);
-        InsertConfigInteger(pMM, "CanUseLargerHeap", chipsetType == ChipsetType_ICH9);
-
-        /*
-         * Hardware virtualization settings.
-         */
-        BOOL        fIsGuest64Bit = false;
-        PCFGMNODE   pHWVirtExt;
+            if (fHwVirtExtForced)
+                LogRel(("fHwVirtExtForced=TRUE - HWVirtExPropertyType_Force\n"));
+        }
+        InsertConfigInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced);
+
+        /* /HWVirtExt/xzy */
+        PCFGMNODE pHWVirtExt;
         InsertConfigNode(pRoot, "HWVirtExt", &pHWVirtExt);
+        InsertConfigInteger(pHWVirtExt, "Enabled", fHWVirtExEnabled);
         if (fHWVirtExEnabled)
         {
-            InsertConfigInteger(pHWVirtExt, "Enabled",     1);
-
             /* Indicate whether 64-bit guests are supported or not. */
             /** @todo This is currently only forced off on 32-bit hosts only because it
-             *        makes a lof of difference there (REM and Solaris performance).
-             */
-            BOOL fSupportsLongMode = false;
-            hrc = host->GetProcessorFeature(ProcessorFeature_LongMode,
-                                            &fSupportsLongMode);                            H();
-            hrc = guestOSType->COMGETTER(Is64Bit)(&fIsGuest64Bit);                          H();
-
-            if (fSupportsLongMode && fIsGuest64Bit)
+             *        makes a lof of difference there (REM and Solaris performance). */
+            if (fIsGuest64Bit)
             {
                 InsertConfigInteger(pHWVirtExt, "64bitEnabled", 1);
@@ -939,7 +969,5 @@
 #if ARCH_BITS == 32 /* 32-bit guests only. */
             else
-            {
                 InsertConfigInteger(pHWVirtExt, "64bitEnabled", 0);
-            }
 #endif
 
@@ -979,19 +1007,10 @@
         InsertConfigInteger(pHWVirtExt, "EnableVPID", fEnableVPID);
 
-        /* Physical Address Extension (PAE) */
-        BOOL fEnablePAE = false;
-        hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE);                   H();
-        InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE);
-
-        /* Synthetic CPU */
-        BOOL fSyntheticCpu = false;
-        hrc = pMachine->GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu);          H();
-        InsertConfigInteger(pCPUM, "SyntheticCpu", fSyntheticCpu);
-
-        if (fOsXGuest)
-            InsertConfigInteger(pCPUM, "EnableHVP", 1);
-
-        BOOL fPXEDebug;
-        hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug);                         H();
+        /*
+         * MM values.
+         */
+        PCFGMNODE pMM;
+        InsertConfigNode(pRoot, "MM", &pMM);
+        InsertConfigInteger(pMM, "CanUseLargerHeap", chipsetType == ChipsetType_ICH9);
 
         /*
@@ -1420,4 +1439,6 @@
             InsertConfigString(pBiosCfg,   "FloppyDevice",         "i82078");
             InsertConfigInteger(pBiosCfg,  "IOAPIC",               fIOAPIC);
+            BOOL fPXEDebug;
+            hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug);                     H();
             InsertConfigInteger(pBiosCfg,  "PXEDebug",             fPXEDebug);
             InsertConfigBytes(pBiosCfg,    "UUID", &HardwareUuid,sizeof(HardwareUuid));
@@ -1427,10 +1448,6 @@
 
             DeviceType_T bootDevice;
-            if (SchemaDefs::MaxBootPosition > 9)
-            {
-                AssertMsgFailed(("Too many boot devices %d\n",
-                                SchemaDefs::MaxBootPosition));
-                return VERR_INVALID_PARAMETER;
-            }
+            AssertMsgReturn(SchemaDefs::MaxBootPosition <= 9, ("Too many boot devices %d\n", SchemaDefs::MaxBootPosition),
+                            VERR_INVALID_PARAMETER);
 
             for (ULONG pos = 1; pos <= SchemaDefs::MaxBootPosition; ++pos)
@@ -1533,5 +1550,4 @@
                 InsertConfigInteger(pCfg, "DmiExposeMemoryTable", 1);
             }
-            PCFGMNODE pDrv;
             InsertConfigNode(pInst,    "LUN#0", &pLunL0);
             InsertConfigString(pLunL0, "Driver", "NvramStorage");
