Index: trunk/include/VBox/vm.h
===================================================================
--- trunk/include/VBox/vm.h	(revision 22884)
+++ trunk/include/VBox/vm.h	(revision 22885)
@@ -134,5 +134,5 @@
         struct PGMCPU       s;
 #endif
-        char                padding[32*1024];   /* multiple of 64 */
+        char                padding[28*1024];   /* multiple of 64 */
     } pgm;
 
@@ -143,5 +143,5 @@
         struct HWACCMCPU    s;
 #endif
-        char                padding[6144];      /* multiple of 64 */
+        char                padding[5248];      /* multiple of 64 */
     } hwaccm;
 
@@ -152,5 +152,5 @@
         struct EMCPU        s;
 #endif
-        char                padding[2048];      /* multiple of 64 */
+        char                padding[1280];      /* multiple of 64 */
     } em;
 
@@ -179,5 +179,5 @@
         struct VMMCPU       s;
 #endif
-        char                padding[384];       /* multiple of 64 */
+        char                padding[256];       /* multiple of 64 */
     } vmm;
 
@@ -210,4 +210,6 @@
     } dbgf;
 
+    /** Align at page boundrary. */
+    uint8_t                 abReserved[HC_ARCH_BITS == 32 ? 448 : 64];
 } VMCPU;
 
@@ -716,5 +718,5 @@
      * @remark  Assume interrupts disabled.
      */
-    RTRCPTR             pfnVMMGCGuestToHostAsmGuestCtx/*(int32_t eax, CPUMCTXCORE Ctx)*/;
+    RTRCPTR                     pfnVMMGCGuestToHostAsmGuestCtx/*(int32_t eax, CPUMCTXCORE Ctx)*/;
 
     /**
@@ -731,5 +733,5 @@
      * @remark  Assume interrupts disabled.
      */
-    RTRCPTR             pfnVMMGCGuestToHostAsmHyperCtx/*(int32_t eax, PCPUMCTXCORE ecx)*/;
+    RTRCPTR                     pfnVMMGCGuestToHostAsmHyperCtx/*(int32_t eax, PCPUMCTXCORE ecx)*/;
 
     /**
@@ -743,5 +745,5 @@
      * @remark  Assume interrupts disabled.
      */
-    RTRCPTR             pfnVMMGCGuestToHostAsm/*(int32_t eax)*/;
+    RTRCPTR                     pfnVMMGCGuestToHostAsm/*(int32_t eax)*/;
     /** @} */
 
@@ -749,8 +751,8 @@
     /** @name Various VM data owned by VM.
      * @{ */
-    RTTHREAD            uPadding1;
+    RTTHREAD                    uPadding1;
     /** The native handle of ThreadEMT. Getting the native handle
      * is generally faster than getting the IPRT one (except on OS/2 :-). */
-    RTNATIVETHREAD      uPadding2;
+    RTNATIVETHREAD              uPadding2;
     /** @} */
 
@@ -759,21 +761,21 @@
      * @{ */
     /** Raw ring-3 indicator.  */
-    bool                fRawR3Enabled;
+    bool                        fRawR3Enabled;
     /** Raw ring-0 indicator. */
-    bool                fRawR0Enabled;
+    bool                        fRawR0Enabled;
     /** PATM enabled flag.
      * This is placed here for performance reasons. */
-    bool                fPATMEnabled;
+    bool                        fPATMEnabled;
     /** CSAM enabled flag.
      * This is placed here for performance reasons. */
-    bool                fCSAMEnabled;
+    bool                        fCSAMEnabled;
     /** Hardware VM support is available and enabled.
      * This is placed here for performance reasons. */
-    bool                fHWACCMEnabled;
+    bool                        fHWACCMEnabled;
     /** Hardware VM support is required and non-optional.
      * This is initialized together with the rest of the VM structure. */
-    bool                fHwVirtExtForced;
+    bool                        fHwVirtExtForced;
     /** PARAV enabled flag. */
-    bool                fPARAVEnabled;
+    bool                        fPARAVEnabled;
     /** @} */
 
@@ -781,35 +783,35 @@
     /* padding to make gnuc put the StatQemuToGC where msc does. */
 #if HC_ARCH_BITS == 32
-    uint32_t            padding0;
+    uint32_t                    padding0;
 #endif
 
     /** Profiling the total time from Qemu to GC. */
-    STAMPROFILEADV      StatTotalQemuToGC;
+    STAMPROFILEADV              StatTotalQemuToGC;
     /** Profiling the total time from GC to Qemu. */
-    STAMPROFILEADV      StatTotalGCToQemu;
+    STAMPROFILEADV              StatTotalGCToQemu;
     /** Profiling the total time spent in GC. */
-    STAMPROFILEADV      StatTotalInGC;
+    STAMPROFILEADV              StatTotalInGC;
     /** Profiling the total time spent not in Qemu. */
-    STAMPROFILEADV      StatTotalInQemu;
+    STAMPROFILEADV              StatTotalInQemu;
     /** Profiling the VMMSwitcher code for going to GC. */
-    STAMPROFILEADV      StatSwitcherToGC;
+    STAMPROFILEADV              StatSwitcherToGC;
     /** Profiling the VMMSwitcher code for going to HC. */
-    STAMPROFILEADV      StatSwitcherToHC;
-    STAMPROFILEADV      StatSwitcherSaveRegs;
-    STAMPROFILEADV      StatSwitcherSysEnter;
-    STAMPROFILEADV      StatSwitcherDebug;
-    STAMPROFILEADV      StatSwitcherCR0;
-    STAMPROFILEADV      StatSwitcherCR4;
-    STAMPROFILEADV      StatSwitcherJmpCR3;
-    STAMPROFILEADV      StatSwitcherRstrRegs;
-    STAMPROFILEADV      StatSwitcherLgdt;
-    STAMPROFILEADV      StatSwitcherLidt;
-    STAMPROFILEADV      StatSwitcherLldt;
-    STAMPROFILEADV      StatSwitcherTSS;
+    STAMPROFILEADV              StatSwitcherToHC;
+    STAMPROFILEADV              StatSwitcherSaveRegs;
+    STAMPROFILEADV              StatSwitcherSysEnter;
+    STAMPROFILEADV              StatSwitcherDebug;
+    STAMPROFILEADV              StatSwitcherCR0;
+    STAMPROFILEADV              StatSwitcherCR4;
+    STAMPROFILEADV              StatSwitcherJmpCR3;
+    STAMPROFILEADV              StatSwitcherRstrRegs;
+    STAMPROFILEADV              StatSwitcherLgdt;
+    STAMPROFILEADV              StatSwitcherLidt;
+    STAMPROFILEADV              StatSwitcherLldt;
+    STAMPROFILEADV              StatSwitcherTSS;
 
 /** @todo Realign everything on 64 byte boundaries to better match the
  *        cache-line size. */
     /* padding - the unions must be aligned on 32 bytes boundraries. */
-    uint32_t            padding[HC_ARCH_BITS == 32 ? 4+8 : 6];
+    uint32_t                padding[HC_ARCH_BITS == 32 ? 4+8 : 6];
 
     /** CPUM part. */
@@ -819,5 +821,5 @@
         struct CPUM s;
 #endif
-        char        padding[2048];        /* multiple of 32 */
+        uint8_t     padding[1472];      /* multiple of 64 */
     } cpum;
 
@@ -828,5 +830,5 @@
         struct VMM  s;
 #endif
-        char        padding[1600];       /* multiple of 32 */
+        uint8_t     padding[1536];      /* multiple of 64 */
     } vmm;
 
@@ -837,5 +839,5 @@
         struct PGM  s;
 #endif
-        char        padding[16*1024];   /* multiple of 32 */
+        uint8_t     padding[5184];      /* multiple of 64 */
     } pgm;
 
@@ -846,5 +848,5 @@
         struct HWACCM s;
 #endif
-        char        padding[8192];       /* multiple of 32 */
+        uint8_t     padding[5376];      /* multiple of 64 */
     } hwaccm;
 
@@ -855,5 +857,5 @@
         struct TRPM s;
 #endif
-        char        padding[5344];      /* multiple of 32 */
+        uint8_t     padding[5184];      /* multiple of 64 */
     } trpm;
 
@@ -864,5 +866,5 @@
         struct SELM s;
 #endif
-        char        padding[544];      /* multiple of 32 */
+        uint8_t     padding[576];       /* multiple of 64 */
     } selm;
 
@@ -873,15 +875,6 @@
         struct MM   s;
 #endif
-        char        padding[192];       /* multiple of 32 */
+        uint8_t     padding[192];       /* multiple of 64 */
     } mm;
-
-    /** CFGM part. */
-    union
-    {
-#ifdef ___CFGMInternal_h
-        struct CFGM s;
-#endif
-        char        padding[32];        /* multiple of 32 */
-    } cfgm;
 
     /** PDM part. */
@@ -891,5 +884,5 @@
         struct PDM s;
 #endif
-        char        padding[1824];      /* multiple of 32 */
+        uint8_t     padding[1024];      /* multiple of 64 */
     } pdm;
 
@@ -900,5 +893,5 @@
         struct IOM s;
 #endif
-        char        padding[4544];      /* multiple of 32 */
+        uint8_t     padding[768];       /* multiple of 64 */
     } iom;
 
@@ -909,5 +902,5 @@
         struct PATM s;
 #endif
-        char        padding[768];       /* multiple of 32 */
+        uint8_t     padding[768];       /* multiple of 64 */
     } patm;
 
@@ -918,15 +911,6 @@
         struct CSAM s;
 #endif
-        char        padding[3328];    /* multiple of 32 */
+        uint8_t     padding[1024];      /* multiple of 64 */
     } csam;
-
-    /** PARAV part. */
-    union
-    {
-#ifdef ___PARAVInternal_h
-        struct PARAV s;
-#endif
-        char        padding[128];
-    } parav;
 
     /** EM part. */
@@ -936,5 +920,5 @@
         struct EM   s;
 #endif
-        char        padding[256];         /* multiple of 32 */
+        uint8_t     padding[256];       /* multiple of 64 */
     } em;
 
@@ -945,5 +929,5 @@
         struct TM   s;
 #endif
-        char        padding[2112];      /* multiple of 32 */
+        uint8_t     padding[2112];      /* multiple of 64 */
     } tm;
 
@@ -954,5 +938,5 @@
         struct DBGF s;
 #endif
-        char        padding[2368];      /* multiple of 32 */
+        uint8_t     padding[2368];      /* multiple of 64 */
     } dbgf;
 
@@ -963,15 +947,6 @@
         struct SSM  s;
 #endif
-        char        padding[32];        /* multiple of 32 */
+        uint8_t     padding[64];        /* multiple of 64 */
     } ssm;
-
-    /** VM part. */
-    union
-    {
-#ifdef ___VMInternal_h
-        struct VMINT    s;
-#endif
-        char        padding[768];       /* multiple of 32 */
-    } vm;
 
     /** REM part. */
@@ -985,13 +960,45 @@
  * Must be multiple of 32 and coherent with REM_ENV_SIZE from REMInternal.h. */
 # define VM_REM_SIZE        0x11100
-        char        padding[VM_REM_SIZE];   /* multiple of 32 */
+        uint8_t     padding[VM_REM_SIZE];   /* multiple of 32 */
     } rem;
 
+    /* ---- begin small stuff ---- */
+
+    /** VM part. */
+    union
+    {
+#ifdef ___VMInternal_h
+        struct VMINT    s;
+#endif
+        uint8_t     padding[24];        /* multiple of 8 */
+    } vm;
+
+    /** PARAV part. */
+    union
+    {
+#ifdef ___PARAVInternal_h
+        struct PARAV s;
+#endif
+        uint8_t     padding[24];        /* multiple of 8 */
+    } parav;
+
+    /** CFGM part. */
+    union
+    {
+#ifdef ___CFGMInternal_h
+        struct CFGM s;
+#endif
+        uint8_t     padding[8];         /* multiple of 8 */
+    } cfgm;
+
     /** Padding for aligning the cpu array on a 64 byte boundrary. */
-    uint32_t    u32Reserved2[8];
+    uint8_t         abReserved2[8 + (HC_ARCH_BITS == 32 ? 3712 : 0)];
+
+    /* ---- end small stuff ---- */
 
     /** VMCPU array for the configured number of virtual CPUs.
-     * Must be aligned on a 64-byte boundrary.  */
-    VMCPU       aCpus[1];
+     * Must be aligned on a page boundrary for TLB hit reasons as well as
+     * alignment of VMCPU members. */
+    VMCPU           aCpus[1];
 } VM;
 
Index: trunk/include/VBox/vm.mac
===================================================================
--- trunk/include/VBox/vm.mac	(revision 22884)
+++ trunk/include/VBox/vm.mac	(revision 22885)
@@ -97,6 +97,6 @@
 
     alignb 64
-    .cpum                   resb 2048
-    .vmm                    resb 1024
+    .cpum                   resb 1472
+    .vmm                    resb 1536
 
 endstruc
