Index: trunk/src/VBox/VMM/VMMInternal.h
===================================================================
--- trunk/src/VBox/VMM/VMMInternal.h	(revision 20991)
+++ trunk/src/VBox/VMM/VMMInternal.h	(revision 20992)
@@ -154,4 +154,16 @@
     uint64_t                    rsp;
     uint64_t                    rip;
+# ifdef RT_OS_WINDOWS
+    uint128_t                   xmm6;
+    uint128_t                   xmm7;
+    uint128_t                   xmm8;
+    uint128_t                   xmm9;
+    uint128_t                   xmm10;
+    uint128_t                   xmm11;
+    uint128_t                   xmm12;
+    uint128_t                   xmm13;
+    uint128_t                   xmm14;
+    uint128_t                   xmm15;
+# endif
 #endif
     /** @} */
Index: trunk/src/VBox/VMM/VMMInternal.mac
===================================================================
--- trunk/src/VBox/VMM/VMMInternal.mac	(revision 20991)
+++ trunk/src/VBox/VMM/VMMInternal.mac	(revision 20992)
@@ -68,4 +68,16 @@
     .rsp            resq 1
     .rip            resq 1
+ %ifdef RT_OS_WINDOWS
+    .xmm6           resq 2
+    .xmm7           resq 2
+    .xmm8           resq 2
+    .xmm9           resq 2
+    .xmm10          resq 2
+    .xmm11          resq 2
+    .xmm12          resq 2
+    .xmm13          resq 2
+    .xmm14          resq 2
+    .xmm15          resq 2
+ %endif
 
     ; additional state and stack info.
Index: trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm
===================================================================
--- trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm	(revision 20991)
+++ trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm	(revision 20992)
@@ -89,4 +89,16 @@
     lea     r10, [rbp + 10h]            ; (used in resume)
     mov     [xDX + VMMR0JMPBUF.rsp], r10
+ %ifdef RT_OS_WINDOWS
+    movdqa  [xDX + VMMR0JMPBUF.xmm6], xmm6
+    movdqa  [xDX + VMMR0JMPBUF.xmm7], xmm7
+    movdqa  [xDX + VMMR0JMPBUF.xmm8], xmm8
+    movdqa  [xDX + VMMR0JMPBUF.xmm9], xmm9
+    movdqa  [xDX + VMMR0JMPBUF.xmm10], xmm10
+    movdqa  [xDX + VMMR0JMPBUF.xmm11], xmm11
+    movdqa  [xDX + VMMR0JMPBUF.xmm12], xmm12
+    movdqa  [xDX + VMMR0JMPBUF.xmm13], xmm13
+    movdqa  [xDX + VMMR0JMPBUF.xmm14], xmm14
+    movdqa  [xDX + VMMR0JMPBUF.xmm15], xmm15
+ %endif
 
     ;
@@ -135,9 +147,21 @@
     ;
 .proper_return:
+%ifdef RT_OS_WINDOWS
+    movdqa  xmm6,  [xDX + VMMR0JMPBUF.xmm6 ]
+    movdqa  xmm7,  [xDX + VMMR0JMPBUF.xmm7 ]
+    movdqa  xmm8,  [xDX + VMMR0JMPBUF.xmm8 ]
+    movdqa  xmm9,  [xDX + VMMR0JMPBUF.xmm9 ]
+    movdqa  xmm10, [xDX + VMMR0JMPBUF.xmm10]
+    movdqa  xmm11, [xDX + VMMR0JMPBUF.xmm11]
+    movdqa  xmm12, [xDX + VMMR0JMPBUF.xmm12]
+    movdqa  xmm13, [xDX + VMMR0JMPBUF.xmm13]
+    movdqa  xmm14, [xDX + VMMR0JMPBUF.xmm14]
+    movdqa  xmm15, [xDX + VMMR0JMPBUF.xmm15]
+%endif
     mov     rbx, [xDX + VMMR0JMPBUF.rbx]
- %ifdef ASM_CALL64_MSC
+%ifdef ASM_CALL64_MSC
     mov     rsi, [xDX + VMMR0JMPBUF.rsi]
     mov     rdi, [xDX + VMMR0JMPBUF.rdi]
- %endif
+%endif
     mov     r12, [xDX + VMMR0JMPBUF.r12]
     mov     r13, [xDX + VMMR0JMPBUF.r13]
@@ -160,4 +184,5 @@
     ;
     ; Aborting resume.
+    ; Note! No need to restore XMM registers here since we haven't touched them yet.
     ;
 .bad:
@@ -223,10 +248,23 @@
 .magic_ok:
 %endif
+%ifdef RT_OS_WINDOWS
+    movdqa  xmm6,  [rsp + 000h]
+    movdqa  xmm7,  [rsp + 010h]
+    movdqa  xmm8,  [rsp + 020h]
+    movdqa  xmm9,  [rsp + 030h]
+    movdqa  xmm10, [rsp + 040h]
+    movdqa  xmm11, [rsp + 050h]
+    movdqa  xmm12, [rsp + 060h]
+    movdqa  xmm13, [rsp + 070h]
+    movdqa  xmm14, [rsp + 080h]
+    movdqa  xmm15, [rsp + 090h]
+    add     rsp, 0a0h
+%endif
     popf
     pop     rbx
- %ifdef ASM_CALL64_MSC
+%ifdef ASM_CALL64_MSC
     pop     rsi
     pop     rdi
- %endif
+%endif
     pop     r12
     pop     r13
@@ -256,10 +294,23 @@
     push    r13
     push    r12
- %ifdef ASM_CALL64_MSC
+%ifdef ASM_CALL64_MSC
     push    rdi
     push    rsi
- %endif
+%endif
     push    rbx
     pushf
+%ifdef RT_OS_WINDOWS
+    sub     rsp, 0a0h
+    movdqa  [rsp + 000h], xmm6
+    movdqa  [rsp + 010h], xmm7
+    movdqa  [rsp + 020h], xmm8
+    movdqa  [rsp + 030h], xmm9
+    movdqa  [rsp + 040h], xmm10
+    movdqa  [rsp + 050h], xmm11
+    movdqa  [rsp + 060h], xmm12
+    movdqa  [rsp + 070h], xmm13
+    movdqa  [rsp + 080h], xmm14
+    movdqa  [rsp + 090h], xmm15
+%endif
 %ifdef VBOX_STRICT
     push    RESUME_MAGIC
@@ -269,11 +320,11 @@
     ; Normalize the parameters.
     ;
- %ifdef ASM_CALL64_MSC
+%ifdef ASM_CALL64_MSC
     mov     eax, edx                    ; rc
     mov     rdx, rcx                    ; pJmpBuf
- %else
+%else
     mov     rdx, rdi                    ; pJmpBuf
     mov     eax, esi                    ; rc
- %endif
+%endif
 
     ;
@@ -324,9 +375,21 @@
     ; Do the long jump.
     ;
+%ifdef RT_OS_WINDOWS
+    movdqa  xmm6,  [xDX + VMMR0JMPBUF.xmm6 ]
+    movdqa  xmm7,  [xDX + VMMR0JMPBUF.xmm7 ]
+    movdqa  xmm8,  [xDX + VMMR0JMPBUF.xmm8 ]
+    movdqa  xmm9,  [xDX + VMMR0JMPBUF.xmm9 ]
+    movdqa  xmm10, [xDX + VMMR0JMPBUF.xmm10]
+    movdqa  xmm11, [xDX + VMMR0JMPBUF.xmm11]
+    movdqa  xmm12, [xDX + VMMR0JMPBUF.xmm12]
+    movdqa  xmm13, [xDX + VMMR0JMPBUF.xmm13]
+    movdqa  xmm14, [xDX + VMMR0JMPBUF.xmm14]
+    movdqa  xmm15, [xDX + VMMR0JMPBUF.xmm15]
+%endif
     mov     rbx, [xDX + VMMR0JMPBUF.rbx]
- %ifdef ASM_CALL64_MSC
+%ifdef ASM_CALL64_MSC
     mov     rsi, [xDX + VMMR0JMPBUF.rsi]
     mov     rdi, [xDX + VMMR0JMPBUF.rdi]
- %endif
+%endif
     mov     r12, [xDX + VMMR0JMPBUF.r12]
     mov     r13, [xDX + VMMR0JMPBUF.r13]
@@ -336,4 +399,5 @@
     mov     rcx, [xDX + VMMR0JMPBUF.rip]
     mov     rsp, [xDX + VMMR0JMPBUF.rsp]
+    ;; @todo flags????
     jmp     rcx
 
@@ -351,10 +415,13 @@
 %endif
     mov     eax, VERR_INTERNAL_ERROR_4
+%ifdef RT_OS_WINDOWS
+    add     rsp, 0a0h                   ; skip XMM registers since they are unmodified.
+%endif
     popf
     pop     rbx
- %ifdef ASM_CALL64_MSC
+%ifdef ASM_CALL64_MSC
     pop     rsi
     pop     rdi
- %endif
+%endif
     pop     r12
     pop     r13
Index: trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
===================================================================
--- trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp	(revision 20991)
+++ trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp	(revision 20992)
@@ -197,5 +197,8 @@
 
     CHECK_MEMBER_ALIGNMENT(VMCPU, vmm.s.u64CallRing3Arg, 8);
-    CHECK_MEMBER_ALIGNMENT(VMCPU, vmm.s.CallRing3JmpBufR0, 8);
+    CHECK_MEMBER_ALIGNMENT(VMCPU, vmm.s.CallRing3JmpBufR0, 16);
+#ifdef RT_OS_WINDOWS
+    CHECK_MEMBER_ALIGNMENT(VMCPU, vmm.s.CallRing3JmpBufR0.xmm6, 16);
+#endif
     CHECK_MEMBER_ALIGNMENT(VM, vmm.s.u64LastYield, 8);
     CHECK_MEMBER_ALIGNMENT(VM, vmm.s.StatRunRC, 8);
