VirtualBox

Ignore:
Timestamp:
Jul 3, 2022 11:37:29 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152105
Message:

ValKit/bs3kit: Added Bs3ExtCtxRestoreEx, Bs3ExtCtxSaveEx, Bs3RegCtxConvertV86ToRm, Bs3TrapSetJmpAndRestoreInRm, and BS3TESTMODEBYONEENTRY_F_REAL_MODE_READY so that it is possible to use a 32-bit test driver to do 64-bit testing as well as real-mode. bugref:9898

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r95481 r95491  
    104104       bs3-cmn-RegCtxRestore.asm \
    105105       bs3-cmn-RegCtxConvertToRingX.c \
     106       bs3-cmn-RegCtxConvertV86ToRm.c \
    106107       bs3-cmn-RegCtxPrint.c \
    107108       bs3-cmn-RegCtxSave.asm \
     
    143144       bs3-cmn-ExtCtxInit.c \
    144145       bs3-cmn-ExtCtxSave.asm \
     146       bs3-cmn-ExtCtxSaveEx.asm \
    145147       bs3-cmn-ExtCtxRestore.asm \
     148       bs3-cmn-ExtCtxRestoreEx.asm \
    146149       bs3-cmn-ExtCtxGetSize.c \
    147150       bs3-cmn-ExtCtxAlloc.c \
     
    237240        bs3-cmn-TrapSetJmp.asm \
    238241        bs3-cmn-TrapSetJmpAndRestore.c \
     242        bs3-cmn-TrapSetJmpAndRestoreInRm.c \
    239243        bs3-cmn-TrapUnsetJmp.c \
    240244       bs3-cmn-UtilSetFullGdtr.asm \
     
    378382        bs3-mode-TrapInit.c \
    379383        bs3-mode-TrapSystemCallHandler.asm \
     384        bs3-mode-TrapSetJmpAndRestoreInRmAsm.asm \
    380385        bs3-mode-TestDoModes.c \
    381386        bs3-mode-TestDoModesByOne.c \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesByOne.c

    r93115 r95491  
    102102        const char *pszFmtStr   = "Error #%u (%#x) in %s!\n";
    103103        bool        fSkipped    = true;
    104         bool const  fOnlyPaging = RT_BOOL(paEntries[i].fFlags & BS3TESTMODEBYONEENTRY_F_ONLY_PAGING);
    105         bool const  fMinimal    = RT_BOOL(paEntries[i].fFlags & BS3TESTMODEBYONEENTRY_F_MINIMAL);
     104        bool const  fOnlyPaging = RT_BOOL((paEntries[i].fFlags | fFlags) & BS3TESTMODEBYONEENTRY_F_ONLY_PAGING);
     105        bool const  fMinimal    = RT_BOOL((paEntries[i].fFlags | fFlags) & BS3TESTMODEBYONEENTRY_F_MINIMAL);
    106106        bool const  fCurDoV86Modes      = fDoV86Modes && !fMinimal;
    107107        bool const  fCurDoWeirdV86Modes = fDoWeirdV86Modes && fCurDoV86Modes;
     
    132132            CHECK_RESULT(g_szBs3ModeName_rm);
    133133        }
     134# else
     135        if (!fOnlyPaging && (paEntries[i].fFlags | fFlags) & BS3TESTMODEBYONEENTRY_F_REAL_MODE_READY)
     136        {
     137            PRE_DO_CALL(g_szBs3ModeName_rm);
     138            bErrNo = TMPL_NM(Bs3TestCallDoerInPE32)(CONV_TO_FLAT(paEntries[i].pfnWorker), BS3_MODE_RM);
     139            CHECK_RESULT(g_szBs3ModeName_rm);
     140        }
    134141# endif
    135142
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r95481 r95491  
    3232$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToFlat,4)
    3333$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToProtFar16,4)
     34$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxRestoreEx,4)
    3435$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxRestore,4)
     36$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxSaveEx,4)
    3537$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxSave,4)
    3638$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelLnkPtrToCurPtr,4)
     
    118120$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PrintStr)
    119121$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3RegCtxConvertToRingX)
     122$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3RegCtxConvertV86ToRm)
    120123$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3RegCtxPrint)
    121124$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3RegCtxSetGrpDsFromCurPtr)
     
    159162$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86SetGate)
    160163$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandlerEx)
     164$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetJmpAndRestoreInRm)
    161165$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetJmpAndRestore)
    162166$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapUnsetJmp)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r95481 r95491  
    4545#define Bs3ExtCtxInit BS3_CMN_MANGLER(Bs3ExtCtxInit)
    4646#define Bs3ExtCtxRestore BS3_CMN_MANGLER(Bs3ExtCtxRestore)
     47#define Bs3ExtCtxRestoreEx BS3_CMN_MANGLER(Bs3ExtCtxRestoreEx)
    4748#define Bs3ExtCtxSave BS3_CMN_MANGLER(Bs3ExtCtxSave)
     49#define Bs3ExtCtxSaveEx BS3_CMN_MANGLER(Bs3ExtCtxSaveEx)
    4850#define Bs3ExtCtxSetAbridgedFtw BS3_CMN_MANGLER(Bs3ExtCtxSetAbridgedFtw)
    4951#define Bs3ExtCtxSetFcw BS3_CMN_MANGLER(Bs3ExtCtxSetFcw)
     
    101103#define Bs3PrintX32 BS3_CMN_MANGLER(Bs3PrintX32)
    102104#define Bs3RegCtxConvertToRingX BS3_CMN_MANGLER(Bs3RegCtxConvertToRingX)
     105#define Bs3RegCtxConvertV86ToRm BS3_CMN_MANGLER(Bs3RegCtxConvertV86ToRm)
    103106#define Bs3RegCtxPrint BS3_CMN_MANGLER(Bs3RegCtxPrint)
    104107#define Bs3RegCtxRestore BS3_CMN_MANGLER(Bs3RegCtxRestore)
     
    215218#define Bs3TrapSetHandlerEx BS3_CMN_MANGLER(Bs3TrapSetHandlerEx)
    216219#define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore)
     220#define Bs3TrapSetJmpAndRestoreInRm BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestoreInRm)
    217221#define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp)
    218222#define Bs3TrapUnsetJmp BS3_CMN_MANGLER(Bs3TrapUnsetJmp)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r95481 r95491  
    4545#undef Bs3ExtCtxInit
    4646#undef Bs3ExtCtxRestore
     47#undef Bs3ExtCtxRestoreEx
    4748#undef Bs3ExtCtxSave
     49#undef Bs3ExtCtxSaveEx
    4850#undef Bs3ExtCtxSetAbridgedFtw
    4951#undef Bs3ExtCtxSetFcw
     
    101103#undef Bs3PrintX32
    102104#undef Bs3RegCtxConvertToRingX
     105#undef Bs3RegCtxConvertV86ToRm
    103106#undef Bs3RegCtxPrint
    104107#undef Bs3RegCtxRestore
     
    215218#undef Bs3TrapSetHandlerEx
    216219#undef Bs3TrapSetJmpAndRestore
     220#undef Bs3TrapSetJmpAndRestoreInRm
    217221#undef Bs3TrapSetJmp
    218222#undef Bs3TrapUnsetJmp
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r95485 r95491  
    26702670
    26712671/**
     2672 * Transforms a V8086 register context to a real mode one.
     2673 *
     2674 * @param   pRegCtx     The register context.
     2675 *
     2676 * @note    Will assert if called on a non-V8086 context.
     2677 */
     2678BS3_CMN_PROTO_STUB(void, Bs3RegCtxConvertV86ToRm,(PBS3REGCTX pRegCtx));
     2679
     2680/**
    26722681 * Restores a register context.
    26732682 *
     
    28782887
    28792888/**
     2889 * Saves the extended CPU state to the given structure, when in long mode this
     2890 * is done from 64-bit mode to capture YMM8 thru YMM15.
     2891 *
     2892 * This is for testing 64-bit code from a 32-bit test driver.
     2893 *
     2894 * @param   pExtCtx         The extended CPU context.
     2895 * @note    Only safe to call from ring-0 at present.
     2896 * @remarks All GPRs preserved.
     2897 * @sa      Bs3ExtCtxRestoreEx
     2898 */
     2899BS3_CMN_PROTO_FARSTUB(4, void, Bs3ExtCtxSaveEx,(PBS3EXTCTX pExtCtx));
     2900
     2901/**
    28802902 * Restores the extended CPU state from the given structure.
    28812903 *
     
    28842906 */
    28852907BS3_CMN_PROTO_FARSTUB(4, void, Bs3ExtCtxRestore,(PBS3EXTCTX pExtCtx));
     2908
     2909/**
     2910 * Restores the extended CPU state from the given structure and in long mode
     2911 * switch to 64-bit mode to do this so YMM8-YMM15 are also loaded.
     2912 *
     2913 * This is for testing 64-bit code from a 32-bit test driver.
     2914 *
     2915 * @param   pExtCtx         The extended CPU context.
     2916 * @note    Only safe to call from ring-0 at present.
     2917 * @remarks All GPRs preserved.
     2918 * @sa      Bs3ExtCtxSaveEx
     2919 */
     2920BS3_CMN_PROTO_FARSTUB(4, void, Bs3ExtCtxRestoreEx,(PBS3EXTCTX pExtCtx));
    28862921
    28872922/**
     
    33903425 */
    33913426BS3_CMN_PROTO_STUB(void, Bs3TrapSetJmpAndRestore,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame));
     3427
     3428/**
     3429 * Combination of Bs3SwitchToRM, #Bs3TrapSetJmp and #Bs3RegCtxRestore.
     3430 *
     3431 * @param   pCtxRestore     The context to restore.  Must be real-mode
     3432 *                          addressable.
     3433 * @param   pTrapFrame      Where to store the trap information.  Must be
     3434 *                          real-mode addressable.
     3435 */
     3436BS3_CMN_PROTO_STUB(void, Bs3TrapSetJmpAndRestoreInRm,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame));
    33923437
    33933438/**
     
    39513996/** Minimal mode selection. */
    39523997#define BS3TESTMODEBYONEENTRY_F_MINIMAL         RT_BIT_32(1)
     3998/** The 32-bit worker is ready to handle real-mode by mode switching. */
     3999#define BS3TESTMODEBYONEENTRY_F_REAL_MODE_READY RT_BIT_32(2)
    39534000/** @} */
    39544001
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette