Index: trunk/include/VBox/cpum.h
===================================================================
--- trunk/include/VBox/cpum.h	(revision 7093)
+++ trunk/include/VBox/cpum.h	(revision 7095)
@@ -82,15 +82,55 @@
 typedef struct CPUMCTXCORE
 {
-    uint32_t        edi;
-    uint32_t        esi;
-    uint32_t        ebp;
-    uint32_t        eax;
-    uint32_t        ebx;
-    uint32_t        edx;
-    uint32_t        ecx;
-
-    uint32_t        esp;
-    RTSEL           ss;
-    RTSEL           ssPadding;
+    union
+    {
+        uint32_t        edi;
+        uint64_t        rdi;
+    };
+    union
+    {
+        uint32_t        esi;
+        uint64_t        rsi;
+    };
+    union
+    {
+        uint32_t        ebp;
+        uint64_t        rbp;
+    };
+    union
+    {
+        uint32_t        eax;
+        uint64_t        rax;
+    };
+    union
+    {
+        uint32_t        ebx;
+        uint64_t        rbx;
+    };
+    union
+    {
+        uint32_t        edx;
+        uint64_t        rdx;
+    };
+    union
+    {
+        uint32_t        ecx;
+        uint64_t        rcx;
+    };
+    union
+    {
+        /* Note: we rely on the exact layout, because we use lss esp, [] in the switcher */
+        struct
+        {
+            uint32_t        esp;
+            RTSEL           ss;
+            RTSEL           ssPadding;
+        };
+        struct
+        {
+            uint64_t        rsp;
+            RTSEL           ss64;
+            RTSEL           ss64Padding;
+        };
+    };
 
     RTSEL           gs;
@@ -105,6 +145,23 @@
     RTSEL           csPadding;
 
-    X86EFLAGS       eflags;
-    uint32_t        eip;
+    union
+    {
+        X86EFLAGS       eflags;
+        X86RFLAGS       rflags;
+    };
+    union
+    {
+        uint32_t        eip;
+        uint64_t        rip;
+    };
+
+    uint64_t            r8;
+    uint64_t            r9;
+    uint64_t            r10;
+    uint64_t            r11;
+    uint64_t            r12;
+    uint64_t            r13;
+    uint64_t            r14;
+    uint64_t            r15;
 
     /** Hidden selector registers.
@@ -138,15 +195,55 @@
     /** CPUMCTXCORE Part.
      * @{ */
-    uint32_t        edi;
-    uint32_t        esi;
-    uint32_t        ebp;
-    uint32_t        eax;
-    uint32_t        ebx;
-    uint32_t        edx;
-    uint32_t        ecx;
-
-    uint32_t        esp;
-    RTSEL           ss;
-    RTSEL           ssPadding;
+    union
+    {
+        uint32_t        edi;
+        uint64_t        rdi;
+    };
+    union
+    {
+        uint32_t        esi;
+        uint64_t        rsi;
+    };
+    union
+    {
+        uint32_t        ebp;
+        uint64_t        rbp;
+    };
+    union
+    {
+        uint32_t        eax;
+        uint64_t        rax;
+    };
+    union
+    {
+        uint32_t        ebx;
+        uint64_t        rbx;
+    };
+    union
+    {
+        uint32_t        edx;
+        uint64_t        rdx;
+    };
+    union
+    {
+        uint32_t        ecx;
+        uint64_t        rcx;
+    };
+    union
+    {
+        /* Note: we rely on the exact layout, because we use lss esp, [] in the switcher */
+        struct
+        {
+            uint32_t        esp;
+            RTSEL           ss;
+            RTSEL           ssPadding;
+        };
+        struct
+        {
+            uint64_t        rsp;
+            RTSEL           ss64;
+            RTSEL           ss64Padding;
+        };
+    };
 
     RTSEL           gs;
@@ -161,6 +258,23 @@
     RTSEL           csPadding;
 
-    X86EFLAGS       eflags;
-    uint32_t        eip;
+    union
+    {
+        X86EFLAGS       eflags;
+        X86RFLAGS       rflags;
+    };
+    union
+    {
+        uint32_t        eip;
+        uint64_t        rip;
+    };
+
+    uint64_t            r8;
+    uint64_t            r9;
+    uint64_t            r10;
+    uint64_t            r11;
+    uint64_t            r12;
+    uint64_t            r13;
+    uint64_t            r14;
+    uint64_t            r15;
 
     /** Hidden selector registers.
@@ -178,20 +292,22 @@
     /** Control registers.
      * @{ */
-    uint32_t        cr0;
-    uint32_t        cr2;
-    uint32_t        cr3;
-    uint32_t        cr4;
+    uint64_t        cr0;
+    uint64_t        cr2;
+    uint64_t        cr3;
+    uint64_t        cr4;
+    uint64_t        cr8;
     /** @} */
 
     /** Debug registers.
      * @{ */
-    uint32_t        dr0;
-    uint32_t        dr1;
-    uint32_t        dr2;
-    uint32_t        dr3;
-    uint32_t        dr4; /**< @todo remove dr4 and dr5. */
-    uint32_t        dr5;
-    uint32_t        dr6;
-    uint32_t        dr7;
+    uint64_t        dr0;
+    uint64_t        dr1;
+    uint64_t        dr2;
+    uint64_t        dr3;
+    uint64_t        dr4; /**< @todo remove dr4 and dr5. */
+    uint64_t        dr5;
+    uint64_t        dr6;
+    uint64_t        dr7;
+    /* DR8-15 are currently not supported */
     /** @} */
 
Index: trunk/include/VBox/cpum.mac
===================================================================
--- trunk/include/VBox/cpum.mac	(revision 7093)
+++ trunk/include/VBox/cpum.mac	(revision 7095)
@@ -34,14 +34,14 @@
 ; and other places.
 struc CPUMCTXCORE
-    .edi            resd    1
-    .esi            resd    1
-    .ebp            resd    1
-    .eax            resd    1
-    .ebx            resd    1
-    .edx            resd    1
-    .ecx            resd    1
+    .edi            resq    1
+    .esi            resq    1
+    .ebp            resq    1
+    .eax            resq    1
+    .ebx            resq    1
+    .edx            resq    1
+    .ecx            resq    1
     .esp            resd    1
     .ss             resw    1
-    .ssPadding      resw    1
+    .ssPadding      resw    3
     .gs             resw    1
     .gsPadding      resw    1
@@ -54,6 +54,15 @@
     .cs             resw    1
     .csPadding      resw    1
-    .eflags         resd    1
-    .eip            resd    1
+    .eflags         resq    1
+    .eip            resq    1
+
+    .r8             resq    1
+    .r9             resq    1
+    .r10            resq    1
+    .r11            resq    1
+    .r12            resq    1
+    .r13            resq    1
+    .r14            resq    1
+    .r15            resq    1
 
     .esHid.u32Base      resd    1
@@ -87,14 +96,14 @@
     .fpu            resb    512
 
-    .edi            resd    1
-    .esi            resd    1
-    .ebp            resd    1
-    .eax            resd    1
-    .ebx            resd    1
-    .edx            resd    1
-    .ecx            resd    1
+    .edi            resq    1
+    .esi            resq    1
+    .ebp            resq    1
+    .eax            resq    1
+    .ebx            resq    1
+    .edx            resq    1
+    .ecx            resq    1
     .esp            resd    1
     .ss             resw    1
-    .ssPadding      resw    1
+    .ssPadding      resw    3
     .gs             resw    1
     .gsPadding      resw    1
@@ -107,6 +116,16 @@
     .cs             resw    1
     .csPadding      resw    1
-    .eflags         resd    1
-    .eip            resd    1
+    .eflags         resq    1
+    .eip            resq    1
+
+    .r8             resq    1
+    .r9             resq    1
+    .r10            resq    1
+    .r11            resq    1
+    .r12            resq    1
+    .r13            resq    1
+    .r14            resq    1
+    .r15            resq    1
+
     .esHid.u32Base      resd    1
     .esHid.u32Limit     resd    1
@@ -134,17 +153,18 @@
 
 
-    .cr0            resd    1
-    .cr2            resd    1
-    .cr3            resd    1
-    .cr4            resd    1
+    .cr0            resq    1
+    .cr2            resq    1
+    .cr3            resq    1
+    .cr4            resq    1
+    .cr8            resq    1
 
-    .dr0            resd    1
-    .dr1            resd    1
-    .dr2            resd    1
-    .dr3            resd    1
-    .dr4            resd    1
-    .dr5            resd    1
-    .dr6            resd    1
-    .dr7            resd    1
+    .dr0            resq    1
+    .dr1            resq    1
+    .dr2            resq    1
+    .dr3            resq    1
+    .dr4            resq    1
+    .dr5            resq    1
+    .dr6            resq    1
+    .dr7            resq    1
 
     .gdtr           resb    6           ; GDT limit + linear address
Index: trunk/include/VBox/vm.h
===================================================================
--- trunk/include/VBox/vm.h	(revision 7093)
+++ trunk/include/VBox/vm.h	(revision 7095)
@@ -392,9 +392,5 @@
         struct CPUM s;
 #endif
-#ifdef VBOX_WITH_HYBIRD_32BIT_KERNEL
-        char        padding[3648];                                  /* multiple of 32 */
-#else
-        char        padding[HC_ARCH_BITS == 32 ? 3488 : 3616];      /* multiple of 32 */
-#endif
+        char        padding[4096];                                  /* multiple of 32 */
     } cpum;
 
Index: trunk/include/VBox/vm.mac
===================================================================
--- trunk/include/VBox/vm.mac	(revision 7093)
+++ trunk/include/VBox/vm.mac	(revision 7095)
@@ -88,11 +88,5 @@
 
     alignb 32
-%ifdef VBOX_WITH_HYBIRD_32BIT_KERNEL
-    .cpum                 resb 3648
-%elif HC_ARCH_BITS == 32
-    .cpum                 resb 3488
-%else
-    .cpum                 resb 3616
-%endif
+    .cpum                 resb 4096
     .vmm                  resb 1024
 
Index: trunk/include/VBox/x86.h
===================================================================
--- trunk/include/VBox/x86.h	(revision 7093)
+++ trunk/include/VBox/x86.h	(revision 7095)
@@ -119,4 +119,27 @@
 /** Pointer to const EFLAGS. */
 typedef const X86EFLAGS *PCX86EFLAGS;
+
+/**
+ * RFLAGS (32 upper bits are reserved)
+ */
+typedef union X86RFLAGS
+{
+    /** The bitfield view. */
+    X86EFLAGSBITS   Bits;
+    /** The 8-bit view. */
+    uint8_t         au8[8];
+    /** The 16-bit view. */
+    uint16_t        au16[4];
+    /** The 32-bit view. */
+    uint32_t        au32[2];
+    /** The 64-bit view. */
+    uint64_t        au64[1];
+    /** The 64-bit view. */
+    uint32_t        u64;
+} X86RFLAGS;
+/** Pointer to RFLAGS. */
+typedef X86RFLAGS *PX86RFLAGS;
+/** Pointer to const RFLAGS. */
+typedef const X86RFLAGS *PCX86RFLAGS;
 
 
@@ -1687,7 +1710,7 @@
         /** 128-bit view. (yeah, very helpful) */
         uint128_t   au128[1];
-    } aXMM[8];
-    /* - offset 288 - */
-    uint32_t    au32RsrvdRest[(512 - 288) / sizeof(uint32_t)];
+    } aXMM[16]; /* 8 registers in 32 bits mode; 16 in long mode */
+    /* - offset 416 - */
+    uint32_t    au32RsrvdRest[(512 - 416) / sizeof(uint32_t)];
 } X86FXSTATE;
 #pragma pack()
