VirtualBox

Changeset 60444 in vbox


Ignore:
Timestamp:
Apr 12, 2016 7:57:12 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106531
Message:

bs3-cpu-basic-2: two 286 adjustments while at it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c

    r60321 r60444  
    349349# if TMPL_BITS == 16
    350350    bool const      f386Plus = (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386;
     351    bool const      f286     = (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80286;
    351352# else
     353    bool const      f286     = false;
    352354    bool const      f386Plus = true;
    353355    int             rc;
     
    662664                    g_usBs3TestStep++;
    663665
    664                     /* Modify the gate DPL to check that this is checked before SS.DPL and SS.PRESENT. */
     666                    /* +1: Modify the gate DPL to check that this is checked before SS.DPL and SS.PRESENT. */
    665667                    paIdt[0x83 << cIdteShift].Gate.u2Dpl = 2;
    666668                    Bs3TrapSetJmpAndRestore(&CtxTmp, &TrapCtx);
     
    669671                    g_usBs3TestStep++;
    670672
    671                     /* Check the the CS.DPL check is done before the SS ones. Restoring the ring-0 INT 83
    672                        context triggers the CS.DPL < CPL check. */
     673                    /* +2: Check the the CS.DPL check is done before the SS ones. Restoring the
     674                           ring-0 INT 83 context triggers the CS.DPL < CPL check. */
    673675                    Bs3TrapSetJmpAndRestore(&Ctx83, &TrapCtx);
    674676                    bs3CpuBasic2_CompareGpCtx(&TrapCtx, &Ctx83, BS3_SEL_TEST_PAGE_02);
    675677                    g_usBs3TestStep++;
    676678
    677                     /* Now mark the CS selector not present and check that that also triggers before SS stuff. */
     679                    /* +3: Now mark the CS selector not present and check that that also triggers before SS stuff. */
    678680                    Bs3GdteTestPage02.Gen.u1Present = 0;
    679681                    Bs3TrapSetJmpAndRestore(&CtxTmp, &TrapCtx);
     
    682684                    g_usBs3TestStep++;
    683685
    684                     /* Make the CS selector some invalid type and check it triggers before SS stuff. */
     686                    /* +4: Make the CS selector some invalid type and check it triggers before SS stuff. */
    685687                    Bs3GdteTestPage02.Gen.u4Type = g_aInvalidCsTypes[i].u4Type;
    686688                    Bs3GdteTestPage02.Gen.u1DescType = g_aInvalidCsTypes[i].u1DescType;
     
    691693                    g_usBs3TestStep++;
    692694
    693                     /* Now, make the CS selector limit too small and that it triggers after SS trouble. */
     695                    /* +5: Now, make the CS selector limit too small and that it triggers after SS trouble.
     696                           The 286 had a simpler approach to these GP(0). */
    694697                    Bs3GdteTestPage02.Gen.u16LimitLow = 0;
    695698                    Bs3GdteTestPage02.Gen.u4LimitHigh = 0;
    696699                    Bs3GdteTestPage02.Gen.u1Granularity = 0;
    697700                    Bs3TrapSetJmpAndRestore(&CtxTmp, &TrapCtx);
    698                     if (iRpl != 2 || iRpl != iDpl || k >= 4)
     701                    if (f286)
     702                        bs3CpuBasic2_CompareGpCtx(&TrapCtx, &CtxTmp, 0 /*uErrCd*/);
     703                    else if (iRpl != 2 || iRpl != iDpl || k >= 4)
    699704                        bs3CpuBasic2_CompareTsCtx(&TrapCtx, &CtxTmp, BS3_SEL_TEST_PAGE_03);
    700705                    else if (k != 0)
     
    907912
    908913    /*
    909      * IDT limit check.
     914     * IDT limit check.  The 286 does not access X86DESCGATE::u16OffsetHigh.
    910915     */
    911916    g_usBs3TestStep = 5000;
    912917    i = (0x80 << (cIdteShift + 3)) - 1;
    913     j = (0x82 << (cIdteShift + 3)) - 1;
     918    j = (0x82 << (cIdteShift + 3)) - (!f286 ? 1 : 3);
    914919    k = (0x83 << (cIdteShift + 3)) - 1;
    915920    for (; i <= k; i++, g_usBs3TestStep++)
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