VirtualBox

Changeset 64703 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 17, 2016 10:51:37 PM (8 years ago)
Author:
vboxsync
Message:

bs3-basic-2: started on #PF testcase

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingAlias.c

    r62471 r64703  
    166166#if ARCH_BITS == 16
    167167    /*
    168      * We can do this stuff in v8086 mode.
     168     * We can't do this stuff in v8086 mode, so switch to 16-bit prot mode and do it there.
    169169     */
    170170    else
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingProtect.c

    r62471 r64703  
    362362}
    363363
     364
     365#undef Bs3PagingGetPte
     366BS3_CMN_DEF(void BS3_FAR *, Bs3PagingGetPte,(uint64_t uFlat, int *prc))
     367{
     368    RTCCUINTXREG const  cr3        = ASMGetCR3();
     369    RTCCUINTXREG const  cr4        = g_uBs3CpuDetected & BS3CPU_F_CPUID ? ASMGetCR4() : 0;
     370    bool const          fLegacyPTs = !(cr4 & X86_CR4_PAE);
     371    bool const          fUseInvlPg = (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80486;
     372    int                 rc;
     373    if (!prc)
     374        prc = &rc;
     375    if (!fLegacyPTs)
     376        return BS3_CMN_FAR_NM(bs3PagingGetPte)(cr3,  g_bBs3CurrentMode, uFlat, fUseInvlPg, prc);
     377    if (uFlat < _4G)
     378        return BS3_CMN_FAR_NM(bs3PagingGetLegacyPte)(cr3, (uint32_t)uFlat, fUseInvlPg, prc);
     379    *prc = VERR_OUT_OF_RANGE;
     380    return NULL;
     381}
     382
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesByOne.c

    r64694 r64703  
    151151    for (i = 0; i < cEntries; i++)
    152152    {
    153         const char *pszFmtStr = "Error #%u (%#x) in %s!\n";
    154         bool        fSkipped  = true;
     153        const char *pszFmtStr   = "Error #%u (%#x) in %s!\n";
     154        bool        fSkipped    = true;
     155        bool const  fOnlyPaging = RT_BOOL(paEntries[i].fFlags & BS3TESTMODEBYONEENTRY_F_ONLY_PAGING);
    155156        uint8_t     bErrNo;
    156157        Bs3TestSub(paEntries[i].pszSubTest);
     
    173174
    174175# if ARCH_BITS == 16
    175         if (true)
     176        if (!fOnlyPaging)
    176177        {
    177178            PRE_DO_CALL(g_szBs3ModeName_rm);
     
    191192         * Unpaged prot mode.
    192193         */
    193         if (true)
     194        if (!fOnlyPaging)
    194195        {
    195196            PRE_DO_CALL(g_szBs3ModeName_pe16);
     
    208209        }
    209210
    210         if (true)
     211        if (!fOnlyPaging)
    211212        {
    212213            PRE_DO_CALL(g_szBs3ModeName_pe16_32);
     
    219220        }
    220221
    221         if (fDoWeirdV86Modes)
     222        if (fDoWeirdV86Modes && !fOnlyPaging)
    222223        {
    223224            PRE_DO_CALL(g_szBs3ModeName_pe16_v86);
     
    230231        }
    231232
    232         if (true)
     233        if (!fOnlyPaging)
    233234        {
    234235            PRE_DO_CALL(g_szBs3ModeName_pe32);
     
    241242        }
    242243
    243         if (true)
     244        if (!fOnlyPaging)
    244245        {
    245246            PRE_DO_CALL(g_szBs3ModeName_pe32_16);
     
    252253        }
    253254
    254         if (fDoV86Modes)
     255        if (fDoV86Modes && !fOnlyPaging)
    255256        {
    256257            PRE_DO_CALL(g_szBs3ModeName_pev86);
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r61389 r64703  
    6565$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemMove)
    6666$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemPCpy)
     67$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingGetPde)
     68$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingGetPte)
    6769$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingSetupCanonicalTraps)
    6870$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAlloc)
     
    123125$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetLegacyPte)
    124126$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetPte)
     127$(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3SwitchTo32BitAndCallC)
    125128$(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3TrapInit)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r61389 r64703  
    5050#define Bs3PagingAlias BS3_CMN_MANGLER(Bs3PagingAlias)
    5151#define bs3PagingGetLegacyPte BS3_CMN_MANGLER(bs3PagingGetLegacyPte)
     52#define Bs3PagingGetPde BS3_CMN_MANGLER(Bs3PagingGetPde)
     53#define Bs3PagingGetPte BS3_CMN_MANGLER(Bs3PagingGetPte)
    5254#define bs3PagingGetPte BS3_CMN_MANGLER(bs3PagingGetPte)
    5355#define Bs3PagingInitRootForLM BS3_CMN_MANGLER(Bs3PagingInitRootForLM)
     
    153155#ifndef BS3_CMN_ONLY
    154156# define Bs3CpuDetect BS3_MODE_MANGLER(Bs3CpuDetect)
     157# define Bs3SwitchTo32BitAndCallC BS3_MODE_MANGLER(Bs3SwitchTo32BitAndCallC)
    155158# define Bs3TestDoModes BS3_MODE_MANGLER(Bs3TestDoModes)
    156159# define Bs3TestDoModesByOne BS3_MODE_MANGLER(Bs3TestDoModesByOne)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r61389 r64703  
    5050#undef Bs3PagingAlias
    5151#undef bs3PagingGetLegacyPte
     52#undef Bs3PagingGetPde
     53#undef Bs3PagingGetPte
    5254#undef bs3PagingGetPte
    5355#undef Bs3PagingInitRootForLM
     
    153155#ifndef BS3_CMN_ONLY
    154156# undef Bs3CpuDetect
     157# undef Bs3SwitchTo32BitAndCallC
    155158# undef Bs3TestDoModes
    156159# undef Bs3TestDoModesByOne
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r64698 r64703  
    22022202BS3_CMN_PROTO_STUB(int, Bs3PagingUnalias,(uint64_t uDst, uint32_t cbHowMuch));
    22032203
     2204/**
     2205 * Get the pointer to the PTE for the given address.
     2206 *
     2207 * @returns Pointer to the PTE.
     2208 * @param   uFlat               The flat address of the page which PTE we want.
     2209 * @param   prc                 Where to return additional error info. Optional.
     2210 */
     2211BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3PagingGetPte,(uint64_t uFlat, int *prc));
     2212
     2213/**
     2214 * Get the pointer to the PDE for the given address.
     2215 *
     2216 * @returns Pointer to the PDE.
     2217 * @param   uFlat               The flat address of the page which PDE we want.
     2218 */
     2219BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3PagingGetPde,(uint64_t uFlat));
     2220
    22042221
    22052222/** The physical / flat address of the buffer backing the canonical traps.
     
    30993116    const char * BS3_FAR    pszSubTest;
    31003117    PFNBS3TESTDOMODE        pfnWorker;
    3101     uint32_t                u32Reserved;
     3118    /** BS3TESTMODEBYONEENTRY_F_XXX. */
     3119    uint32_t                fFlags;
    31023120} BS3TESTMODEBYONEENTRY;
    31033121/** Pointer to a mode-by-one sub-test entry. */
    31043122typedef BS3TESTMODEBYONEENTRY const *PCBS3TESTMODEBYONEENTRY;
     3123
     3124/** @name BS3TESTMODEBYONEENTRY_F_XXX - flags.
     3125 * @{ */
     3126/** Only test modes that has paging enabled. */
     3127#define BS3TESTMODEBYONEENTRY_F_ONLY_PAGING     RT_BIT_32(0)
     3128/** @} */
    31053129
    31063130
Note: See TracChangeset for help on using the changeset viewer.

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