Index: trunk/include/VBox/vmm/hm.h
===================================================================
--- trunk/include/VBox/vmm/hm.h	(revision 45684)
+++ trunk/include/VBox/vmm/hm.h	(revision 45701)
@@ -40,8 +40,10 @@
 
 /**
- * Query HM state (enabled/disabled)
+ * Checks whether HM (VT-x/AMD-V) is being used by this VM.
  *
- * @returns 0 - disabled, 1 - enabled
- * @param   a_pVM       Pointer to the shared VM structure.
+ * @retval  @c true if used.
+ * @retval  @c false if software virtualization (raw-mode) is used.
+ *
+ * @param   a_pVM       The cross context VM structure.
  * @sa      HMIsEnabledNotMacro, HMR3IsEnabled
  * @internal
@@ -51,4 +53,20 @@
 #else
 # define HMIsEnabled(a_pVM)   ((a_pVM)->fHMEnabled)
+#endif
+
+/**
+ * Checks whether raw-mode context is required for any purpose.
+ *
+ * @retval  @c true if required either by raw-mode itself or by HM for doing
+ *          switching the cpu to 64-bit mode.
+ * @retval  @c false if not required.
+ *
+ * @param   a_pVM       The cross context VM structure.
+ * @internal
+ */
+#if HC_ARCH_BITS == 64
+# define HMIsRawModeCtxNeeded(a_pVM)   (!HMIsEnabled(a_pVM))
+#else
+# define HMIsRawModeCtxNeeded(a_pVM)   (!HMIsEnabled(a_pVM) || (a_pVM)->fHMNeedRawModeCtx)
 #endif
 
Index: trunk/include/VBox/vmm/selm.h
===================================================================
--- trunk/include/VBox/vmm/selm.h	(revision 45684)
+++ trunk/include/VBox/vmm/selm.h	(revision 45701)
@@ -42,5 +42,4 @@
 VMMDECL(void)           SELMSetTrap8EIP(PVM pVM, uint32_t u32EIP);
 VMMDECL(int)            SELMGetRing1Stack(PVM pVM, uint32_t *pSS, PRTGCPTR32 pEsp);
-VMMDECL(RTGCPTR)        SELMGetGuestTSS(PVM pVM);
 VMMDECL(RTSEL)          SELMGetHyperCS(PVM pVM);
 VMMDECL(RTSEL)          SELMGetHyperCS64(PVM pVM);
Index: trunk/include/VBox/vmm/vm.h
===================================================================
--- trunk/include/VBox/vmm/vm.h	(revision 45684)
+++ trunk/include/VBox/vmm/vm.h	(revision 45701)
@@ -882,4 +882,7 @@
     /** For asserting on fHMEnable usage. */
     bool                        fHMEnabledFixed;
+    /** Hardware VM support requires a minimal raw-mode context.
+     * This is never set on 64-bit hosts, only 32-bit hosts requires it. */
+    bool                        fHMNeedRawModeCtx;
     /** Set when this VM is the master FT node.
      * @todo This doesn't need to be here, FTM should store it in it's own
@@ -893,5 +896,5 @@
 
     /** Alignment padding.. */
-    uint8_t                     uPadding1[3];
+    uint8_t                     uPadding1[2];
 
     /** @name Debugging
Index: trunk/include/VBox/vmm/vm.mac
===================================================================
--- trunk/include/VBox/vmm/vm.mac	(revision 45684)
+++ trunk/include/VBox/vmm/vm.mac	(revision 45701)
@@ -64,8 +64,9 @@
     .fHMEnabled             resb 1
     .fHMEnabledFixed        resb 1
+    .fHMNeedRawModeCtx      resb 1
     .fFaultTolerantMaster   resb 1
     .fUseLargePages         resb 1
 
-    .uPadding1              resb 3
+    .uPadding1              resb 2
 
     .hTraceBufRC            RTRCPTR_RES 1
Index: trunk/include/VBox/vmm/vmm.h
===================================================================
--- trunk/include/VBox/vmm/vmm.h	(revision 45684)
+++ trunk/include/VBox/vmm/vmm.h	(revision 45701)
@@ -64,4 +64,8 @@
     /** Switcher for AMD64 host paging to AMD64 shadow paging. */
     VMMSWITCHER_AMD64_TO_AMD64,
+    /** Stub switcher for 32-bit and PAE. */
+    VMMSWITCHER_X86_STUB,
+    /** Stub switcher for AMD64. */
+    VMMSWITCHER_AMD64_STUB,
     /** Used to make a count for array declarations and suchlike. */
     VMMSWITCHER_MAX,
@@ -254,5 +258,4 @@
 VMMR3DECL(const char *) VMMR3GetRZAssertMsg2(PVM pVM);
 VMMR3_INT_DECL(int)     VMMR3SelectSwitcher(PVM pVM, VMMSWITCHER enmSwitcher);
-VMMR3_INT_DECL(int)     VMMR3DisableSwitcher(PVM pVM);
 VMMR3_INT_DECL(RTR0PTR) VMMR3GetHostToGuestSwitcher(PVM pVM, VMMSWITCHER enmSwitcher);
 VMMR3_INT_DECL(int)     VMMR3HmRunGC(PVM pVM, PVMCPU pVCpu);
