Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 95374)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 95376)
@@ -149,4 +149,6 @@
        bs3-cmn-ExtCtxGetMxCsr.c \
        bs3-cmn-ExtCtxSetMxCsr.c \
+       bs3-cmn-ExtCtxGetMm.c \
+       bs3-cmn-ExtCtxSetMm.c \
        bs3-cmn-ExtCtxGetYmm.c \
        bs3-cmn-ExtCtxSetYmm.c \
@@ -201,4 +203,5 @@
 	bs3-cmn-TestIsVmmDevTestingPresent.asm \
 	bs3-cmn-TestCheckRegCtxEx.c \
+	bs3-cmn-TestCheckExtCtx.c \
 	bs3-cmn-TestQueryCfgU8.asm \
 	bs3-cmn-TestQueryCfgU32.asm \
Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxGetMm.c
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxGetMm.c	(revision 95376)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxGetMm.c	(revision 95376)
@@ -0,0 +1,50 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3ExtCtxGetMm
+ */
+
+/*
+ * Copyright (C) 2007-2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#include "bs3kit-template-header.h"
+
+
+#undef Bs3ExtCtxGetMm
+BS3_CMN_DEF(uint64_t, Bs3ExtCtxGetMm,(PCBS3EXTCTX pExtCtx, uint8_t iReg))
+{
+    AssertCompileMembersAtSameOffset(BS3EXTCTX, Ctx.x87.aRegs, BS3EXTCTX, Ctx.x.x87.aRegs);
+    if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aRegs))
+        switch (pExtCtx->enmMethod)
+        {
+            case BS3EXTCTXMETHOD_FXSAVE:
+            case BS3EXTCTXMETHOD_XSAVE:
+                return pExtCtx->Ctx.x87.aRegs[iReg].mmx;
+
+            case BS3EXTCTXMETHOD_ANCIENT:
+                return pExtCtx->Ctx.Ancient.regs[iReg].mmx;
+        }
+    return 0;
+}
+
Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetMm.c
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetMm.c	(revision 95376)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetMm.c	(revision 95376)
@@ -0,0 +1,52 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3ExtCtxSetMm
+ */
+
+/*
+ * Copyright (C) 2007-2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#include "bs3kit-template-header.h"
+
+
+#undef Bs3ExtCtxSetMm
+BS3_CMN_DEF(bool, Bs3ExtCtxSetMm,(PBS3EXTCTX pExtCtx, uint8_t iReg, uint64_t uValue))
+{
+    AssertCompileMembersAtSameOffset(BS3EXTCTX, Ctx.x87.aRegs, BS3EXTCTX, Ctx.x.x87.aRegs);
+    if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aRegs))
+        switch (pExtCtx->enmMethod)
+        {
+            case BS3EXTCTXMETHOD_FXSAVE:
+            case BS3EXTCTXMETHOD_XSAVE:
+                pExtCtx->Ctx.x87.aRegs[iReg].mmx = uValue;
+                return true;
+
+            case BS3EXTCTXMETHOD_ANCIENT:
+                pExtCtx->Ctx.Ancient.regs[iReg].mmx = uValue;
+                return true;
+        }
+    return false;
+}
+
Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestCheckExtCtx.c
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestCheckExtCtx.c	(revision 95376)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestCheckExtCtx.c	(revision 95376)
@@ -0,0 +1,260 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3TestCheckExtCtx
+ */
+
+/*
+ * Copyright (C) 2007-2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#include "bs3kit-template-header.h"
+
+
+/*********************************************************************************************************************************
+*   Global Variables                                                                                                             *
+*********************************************************************************************************************************/
+/** Field descriptors. */
+static struct
+{
+    uint8_t             enmMethod;
+    uint8_t             cb;
+    uint16_t            off;
+    const char BS3_FAR *pszName;
+} const g_aFields[] =
+{
+#define BS3EXTCTX_FIELD_ENTRY(a_enmMethod, a_Member) \
+        { a_enmMethod, RT_SIZEOFMEMB(BS3EXTCTX, a_Member), RT_OFFSETOF(BS3EXTCTX, a_Member), #a_Member }
+    BS3EXTCTX_FIELD_ENTRY(BS3EXTCTXMETHOD_END,      fXcr0Saved),
+
+#define BS3EXTCTX_FIELD_ENTRY_CTX(a_enmMethod, a_Member) \
+        { a_enmMethod, RT_SIZEOFMEMB(BS3EXTCTX, Ctx.a_Member), RT_OFFSETOF(BS3EXTCTX, Ctx.a_Member), #a_Member }
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.FCW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.Dummy1),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.FSW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.Dummy2),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.FTW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.Dummy3),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.FPUIP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.CS),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.FOP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.FPUOO),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.FPUOS),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[0]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[1]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[2]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[3]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[4]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[5]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[6]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_ANCIENT,  Ancient.regs[7]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.FCW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.FSW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.FTW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.FOP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.FPUIP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.CS),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.Rsrvd1),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.FPUDP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.DS),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.Rsrvd2),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.MXCSR),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.MXCSR_MASK),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[0]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[1]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[2]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[3]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[4]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[5]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[6]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aRegs[7]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[0]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[1]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[2]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[3]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[4]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[5]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[6]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[7]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[8]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[9]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[10]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[11]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[12]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[13]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[14]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_FXSAVE,   x87.aXMM[15]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.FCW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.FSW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.FTW),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.FOP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.FPUIP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.CS),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.Rsrvd1),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.FPUDP),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.DS),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.Rsrvd2),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.MXCSR),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.MXCSR_MASK),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[0]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[1]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[2]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[3]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[4]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[5]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[6]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aRegs[7]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[0]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[1]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[2]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[3]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[4]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[5]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[6]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[7]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[8]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[9]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[10]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[11]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[12]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[13]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[14]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.x87.aXMM[15]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.Hdr.bmXState),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.Hdr.bmXComp),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[0]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[1]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[2]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[3]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[4]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[5]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[6]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[7]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[8]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[9]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[10]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[11]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[12]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[13]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[14]),
+    BS3EXTCTX_FIELD_ENTRY_CTX(BS3EXTCTXMETHOD_XSAVE,    x.u.YmmHi.aYmmHi[15]),
+};
+
+
+#undef Bs3TestCheckExtCtx
+BS3_CMN_DEF(bool, Bs3TestCheckExtCtx,(PCBS3EXTCTX pActualExtCtx, PCBS3EXTCTX pExpectedExtCtx, uint16_t fFlags,
+                                      const char BS3_FAR *pszMode, uint16_t idTestStep))
+{
+    /*
+     * Make sure the context of a similar and valid before starting.
+     */
+    if (!pActualExtCtx || pActualExtCtx->u16Magic != BS3EXTCTX_MAGIC)
+        return Bs3TestFailedF("%u - %s: invalid actual context pointer: %p", idTestStep, pszMode, pActualExtCtx);
+    if (!pExpectedExtCtx || pExpectedExtCtx->u16Magic != BS3EXTCTX_MAGIC)
+        return Bs3TestFailedF("%u - %s: invalid expected context pointer: %p", idTestStep, pszMode, pExpectedExtCtx);
+    if (   pActualExtCtx->enmMethod != pExpectedExtCtx->enmMethod
+        || pActualExtCtx->enmMethod == BS3EXTCTXMETHOD_INVALID
+        || pActualExtCtx->enmMethod >= BS3EXTCTXMETHOD_END)
+        return Bs3TestFailedF("%u - %s: mismatching or/and invalid context methods: %d vs %d",
+                              idTestStep, pszMode, pActualExtCtx->enmMethod, pExpectedExtCtx->enmMethod);
+    if (pActualExtCtx->cb != pExpectedExtCtx->cb)
+        return Bs3TestFailedF("%u - %s: mismatching context sizes: %#x vs %#x",
+                              idTestStep, pszMode, pActualExtCtx->cb, pExpectedExtCtx->cb);
+
+    /*
+     * Try get the job done quickly with a memory compare.
+     */
+    if (Bs3MemCmp(pActualExtCtx, pExpectedExtCtx, pActualExtCtx->cb) == 0)
+        return true;
+
+    Bs3TestFailedF("%u - %s: context memory differs", idTestStep, pszMode); // debug
+    {
+        uint8_t const BS3_FAR *pb1 = (uint8_t const BS3_FAR *)pActualExtCtx;
+        uint8_t const BS3_FAR *pb2 = (uint8_t const BS3_FAR *)pExpectedExtCtx;
+        unsigned const         cb  = pActualExtCtx->cb;
+        unsigned               off;
+        for (off = 0; off < cb; off++)
+            if (pb1[off] != pb2[off])
+            {
+                unsigned            offStart = off++;
+                const char BS3_FAR *pszName  = NULL;
+                unsigned            cbDiff   = 0;
+                unsigned            idxField;
+                for (idxField = 0; idxField < RT_ELEMENTS(g_aFields); idxField++)
+                    if (   offStart - g_aFields[idxField].off < g_aFields[idxField].cb
+                        && (   g_aFields[idxField].enmMethod == BS3EXTCTXMETHOD_END
+                            || g_aFields[idxField].enmMethod == pActualExtCtx->enmMethod))
+                    {
+                        pszName  = g_aFields[idxField].pszName;
+                        cbDiff   = g_aFields[idxField].cb;
+                        offStart = g_aFields[idxField].off;
+                        off      = offStart + cbDiff;
+                        break;
+                    }
+                if (!pszName)
+                {
+                    while (off < cb && pb1[off] != pb2[off])
+                        off++;
+                    cbDiff = off - offStart;
+                    pszName = "unknown";
+                }
+                switch (cbDiff)
+                {
+                    case 1:
+                        Bs3TestFailedF("%u - %s: Byte difference at %#x (%s): %#04x, expected %#04x",
+                                       idTestStep, pszMode, offStart, pszName, pb1[offStart], pb2[offStart]);
+                        break;
+                    case 2:
+                        Bs3TestFailedF("%u - %s: Word difference at %#x (%s): %#06x, expected %#06x",
+                                       idTestStep, pszMode, offStart, pszName,
+                                       RT_MAKE_U16(pb1[offStart], pb1[offStart + 1]),
+                                       RT_MAKE_U16(pb2[offStart], pb2[offStart + 1]));
+                        break;
+                    case 4:
+                        Bs3TestFailedF("%u - %s: Dword difference at %#x (%s): %#010RX32, expected %#010RX32",
+                                       idTestStep, pszMode, offStart, pszName,
+                                       RT_MAKE_U32_FROM_U8(pb1[offStart], pb1[offStart + 1], pb1[offStart + 2], pb1[offStart + 3]),
+                                       RT_MAKE_U32_FROM_U8(pb2[offStart], pb2[offStart + 1], pb2[offStart + 2], pb2[offStart + 3]));
+                        break;
+                    case 8:
+                        Bs3TestFailedF("%u - %s: Qword difference at %#x (%s): %#018RX64, expected %#018RX64",
+                                       idTestStep, pszMode, offStart, pszName,
+                                       RT_MAKE_U64_FROM_U8(pb1[offStart], pb1[offStart + 1], pb1[offStart + 2], pb1[offStart + 3],
+                                                           pb1[offStart + 4], pb1[offStart + 5], pb1[offStart + 6], pb1[offStart + 7]),
+                                       RT_MAKE_U64_FROM_U8(pb2[offStart], pb2[offStart + 1], pb2[offStart + 2], pb2[offStart + 3],
+                                                           pb2[offStart + 4], pb2[offStart + 5], pb2[offStart + 6], pb2[offStart + 7]));
+                        break;
+                    default:
+                        Bs3TestFailedF("%u - %s: %#x..%#x differs (%s)\n"
+                                       "got      %.*Rhxs\n"
+                                       "expected %.*Rhxs",
+                                       idTestStep, pszMode, offStart, off - 1, pszName,
+                                       off - offStart, &pb1[offStart],
+                                       off - offStart, &pb2[offStart]);
+                        break;
+                }
+            }
+    }
+    return false;
+}
+
Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk	(revision 95374)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk	(revision 95376)
@@ -37,5 +37,7 @@
 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelFar32ToFlat32NoClobber,6)
 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3RegCtxSaveEx,8)
+$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetMm)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetYmm)
+$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestCheckExtCtx)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestCheckRegCtxEx)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestFailed)
@@ -77,4 +79,5 @@
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelProtFar32ToFlat32)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestQueryCfgU32)
+$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxGetMm)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestNow)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestQueryCfgU8)
Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h	(revision 95374)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h	(revision 95376)
@@ -34,4 +34,5 @@
 #define Bs3ExtCtxCopy BS3_CMN_MANGLER(Bs3ExtCtxCopy)
 #define Bs3ExtCtxFree BS3_CMN_MANGLER(Bs3ExtCtxFree)
+#define Bs3ExtCtxGetMm BS3_CMN_MANGLER(Bs3ExtCtxGetMm)
 #define Bs3ExtCtxGetMxCsr BS3_CMN_MANGLER(Bs3ExtCtxGetMxCsr)
 #define Bs3ExtCtxGetSize BS3_CMN_MANGLER(Bs3ExtCtxGetSize)
@@ -40,4 +41,5 @@
 #define Bs3ExtCtxRestore BS3_CMN_MANGLER(Bs3ExtCtxRestore)
 #define Bs3ExtCtxSave BS3_CMN_MANGLER(Bs3ExtCtxSave)
+#define Bs3ExtCtxSetMm BS3_CMN_MANGLER(Bs3ExtCtxSetMm)
 #define Bs3ExtCtxSetMxCsr BS3_CMN_MANGLER(Bs3ExtCtxSetMxCsr)
 #define Bs3ExtCtxSetYmm BS3_CMN_MANGLER(Bs3ExtCtxSetYmm)
@@ -161,4 +163,5 @@
 #define Bs3StrPrintfV BS3_CMN_MANGLER(Bs3StrPrintfV)
 #define Bs3SwitchFromV86To16BitAndCallC BS3_CMN_MANGLER(Bs3SwitchFromV86To16BitAndCallC)
+#define Bs3TestCheckExtCtx BS3_CMN_MANGLER(Bs3TestCheckExtCtx)
 #define Bs3TestCheckRegCtxEx BS3_CMN_MANGLER(Bs3TestCheckRegCtxEx)
 #define Bs3TestFailed BS3_CMN_MANGLER(Bs3TestFailed)
Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h	(revision 95374)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h	(revision 95376)
@@ -34,4 +34,5 @@
 #undef Bs3ExtCtxCopy
 #undef Bs3ExtCtxFree
+#undef Bs3ExtCtxGetMm
 #undef Bs3ExtCtxGetMxCsr
 #undef Bs3ExtCtxGetSize
@@ -40,4 +41,5 @@
 #undef Bs3ExtCtxRestore
 #undef Bs3ExtCtxSave
+#undef Bs3ExtCtxSetMm
 #undef Bs3ExtCtxSetMxCsr
 #undef Bs3ExtCtxSetYmm
@@ -161,4 +163,5 @@
 #undef Bs3StrPrintfV
 #undef Bs3SwitchFromV86To16BitAndCallC
+#undef Bs3TestCheckExtCtx
 #undef Bs3TestCheckRegCtxEx
 #undef Bs3TestFailed
Index: trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
===================================================================
--- trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 95374)
+++ trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 95376)
@@ -2897,7 +2897,26 @@
 
 /**
+ * Gets the value of MM register number @a iReg from @a pExtCtx.
+ *
+ * @returns The MM register value.
+ * @param   pExtCtx         The extended CPU context.
+ * @param   iReg            The register to get (0 thru 7).
+ */
+BS3_CMN_PROTO_STUB(uint64_t, Bs3ExtCtxGetMm,(PCBS3EXTCTX pExtCtx, uint8_t iReg));
+
+/**
+ * Sets the value of YMM register number @a iReg in @a pExtCtx to @a pValue.
+ *
+ * @returns True if set, false if not.
+ * @param   pExtCtx         The extended CPU context.
+ * @param   iReg            The register to set.
+ * @param   uValue          The new register value.
+ */
+BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetMm,(PBS3EXTCTX pExtCtx, uint8_t iReg, uint64_t uValue));
+
+/**
  * Gets the value of YMM register number @a iReg from @a pExtCtx.
  *
- * @returns MXCSR value, 0 if not part of context.
+ * @returns pValue
  * @param   pExtCtx         The extended CPU context.
  * @param   iReg            The register to get.
@@ -3428,4 +3447,19 @@
                                                int16_t cbSpAdjust, uint32_t fExtraEfl,
                                                const char BS3_FAR *pszMode, uint16_t idTestStep));
+
+/**
+ * Compares two extended register contexts.
+ *
+ * Differences will be reported as test failures.
+ *
+ * @returns true if equal, false if not.
+ * @param   pActualExtCtx   The actual register context.
+ * @param   pExpectedExtCtx Expected register context.
+ * @param   fFlags          Reserved, pass 0.
+ * @param   pszMode         CPU mode or some other helpful text.
+ * @param   idTestStep      Test step identifier.
+ */
+BS3_CMN_PROTO_STUB(bool, Bs3TestCheckExtCtx,(PCBS3EXTCTX pActualExtCtx, PCBS3EXTCTX pExpectedExtCtx, uint16_t fFlags,
+                                             const char BS3_FAR *pszMode, uint16_t idTestStep));
 
 /**
