VirtualBox

Changeset 66206 in vbox


Ignore:
Timestamp:
Mar 22, 2017 4:39:22 PM (8 years ago)
Author:
vboxsync
Message:

bs3-cpu-generated-1: make sure the high 32-bits of GPRs are populated when in long-mode (that's why we're driving the LMxx tests from 64-bit code).

Location:
trunk/src/VBox/ValidationKit/bootsectors
Files:
2 edited

Legend:

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

    r66203 r66206  
    15341534
    15351535                case 4:
     1536                    if (offField <= RT_OFFSETOF(BS3REGCTX, r15)) /* Clear the top dword. */
     1537                        PtrField.pu32[1] = 0;
    15361538                    switch (bOpcode & BS3CG1_CTXOP_OPERATOR_MASK)
    15371539                    {
     
    16251627                  && pThis->TrapFrame.Ctx.rip.u == pThis->Ctx.rip.u + cbAdjustPc))
    16261628    {
     1629        /*
     1630         * Check the register content.
     1631         */
    16271632        if (RT_LIKELY(Bs3TestCheckRegCtxEx(&pThis->TrapFrame.Ctx, &pThis->Ctx,
    16281633                                           cbAdjustPc, 0 /*cbSpAdjust*/, 0 /*fExtraEfl*/,
    16291634                                           pThis->pszMode, iEncoding)))
    16301635        {
     1636            /*
     1637             * Check memory output operands.
     1638             */
    16311639            bool fOkay = true;
    16321640            iOperand = pThis->cOperands;
     
    16901698    Bs3TestPrintf("cpl=%u cbOperands=%u\n", pThis->uCpl, pThis->cbOperand);
    16911699
    1692     /* Display memory operands. */
     1700    /*
     1701     * Display memory operands.
     1702     */
    16931703    for (iOperand = 0; iOperand < pThis->cOperands; iOperand++)
    16941704    {
     
    17701780    }
    17711781
    1772     /* Display contexts: */
     1782    /*
     1783     * Display contexts.
     1784     */
    17731785    Bs3TestPrintf("-- Expected context:\n");
    17741786    Bs3RegCtxPrint(&pThis->Ctx);
     
    19101922       set up code selectors that can access pbCodePg.  ASSUMES 16-bit driver code! */
    19111923    Bs3RegCtxSaveEx(&pThis->aInitialCtxs[pThis->iFirstRing], bMode, 1024 * 3);
     1924#if ARCH_BITS == 64
     1925    pThis->aInitialCtxs[pThis->iFirstRing].rax.u |= UINT64_C(0x0101010100000000);
     1926    pThis->aInitialCtxs[pThis->iFirstRing].rbx.u |= UINT64_C(0x0202020200000000);
     1927    pThis->aInitialCtxs[pThis->iFirstRing].rcx.u |= UINT64_C(0x0303030300000000);
     1928    pThis->aInitialCtxs[pThis->iFirstRing].rdx.u |= UINT64_C(0x0404040400000000);
     1929    pThis->aInitialCtxs[pThis->iFirstRing].rbp.u |= UINT64_C(0x0505050500000000);
     1930    pThis->aInitialCtxs[pThis->iFirstRing].rdi.u |= UINT64_C(0x0606060600000000);
     1931    pThis->aInitialCtxs[pThis->iFirstRing].rsi.u |= UINT64_C(0x0707070700000000);
     1932    pThis->aInitialCtxs[pThis->iFirstRing].r8.u  |= UINT64_C(0x0808080800000000);
     1933    pThis->aInitialCtxs[pThis->iFirstRing].r9.u  |= UINT64_C(0x0909090900000000);
     1934    pThis->aInitialCtxs[pThis->iFirstRing].r10.u |= UINT64_C(0x1010101000000000);
     1935    pThis->aInitialCtxs[pThis->iFirstRing].r11.u |= UINT64_C(0x1111111100000000);
     1936    pThis->aInitialCtxs[pThis->iFirstRing].r12.u |= UINT64_C(0x1212121200000000);
     1937    pThis->aInitialCtxs[pThis->iFirstRing].r13.u |= UINT64_C(0x1313131300000000);
     1938    pThis->aInitialCtxs[pThis->iFirstRing].r14.u |= UINT64_C(0x1414141400000000);
     1939    pThis->aInitialCtxs[pThis->iFirstRing].r15.u |= UINT64_C(0x1515151500000000);
     1940#endif
    19121941    if (BS3_MODE_IS_RM_OR_V86(bMode))
    19131942    {
     
    21222151# if 0
    21232152    /* (for debugging) */
    2124     if (bMode != BS3_MODE_PPV86)
     2153    if (bMode < BS3_MODE_LM16)
    21252154        return BS3TESTDOMODE_SKIPPED;
    21262155# endif
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxPrint.c

    r62471 r66206  
    55
    66/*
    7  * Copyright (C) 2007-2016 Oracle Corporation
     7 * Copyright (C) 2007-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3535BS3_CMN_DEF(void, Bs3RegCtxPrint,(PCBS3REGCTX pRegCtx))
    3636{
    37     //if (BS3_MODE_IS_64BIT_CODE(pRegCtx->bMode))
    38     //{
     37    if (BS3_MODE_IS_64BIT_CODE(pRegCtx->bMode))
     38    {
    3939        Bs3TestPrintf("eax=%08RX32 ebx=%08RX32 ecx=%08RX32 edx=%08RX32 esi=%08RX32 edi=%08RX32\n",
    4040                      pRegCtx->rax.u32, pRegCtx->rbx.u32, pRegCtx->rcx.u32, pRegCtx->rdx.u32, pRegCtx->rsi.u32, pRegCtx->rdi.u32);
     
    4545                      pRegCtx->cs, pRegCtx->ds, pRegCtx->es, pRegCtx->fs, pRegCtx->gs, pRegCtx->ss,
    4646                      pRegCtx->cr3.u32, pRegCtx->cr4.u32);
    47         Bs3TestPrintf("tr=%04RX16 ldtr=%04RX16 cpl=%d   mode=%#x fbFlags=%#x\n",
    48                       pRegCtx->tr, pRegCtx->ldtr, pRegCtx->bCpl, pRegCtx->bMode, pRegCtx->fbFlags);
    49     //}
    50     //else
    51     //{
    52     //
    53     //}
     47    }
     48    else
     49    {
     50        Bs3TestPrintf("rax=%016RX64 rbx=%016RX64 rcx=%016RX64 rdx=%016RX64\n",
     51                      pRegCtx->rax.u64, pRegCtx->rbx.u64, pRegCtx->rcx.u64, pRegCtx->rdx.u64);
     52        Bs3TestPrintf("rsi=%016RX64 rdi=%016RX64 r8 =%016RX64 r9 =%016RX64\n",
     53                      pRegCtx->rsi.u64, pRegCtx->rdi.u64, pRegCtx->r8.u64, pRegCtx->r9.u64);
     54        Bs3TestPrintf("r10=%016RX64 r11=%016RX64 r12=%016RX64 r13=%016RX64\n",
     55                      pRegCtx->r10.u64, pRegCtx->r11.u64, pRegCtx->r12.u64, pRegCtx->r13.u64);
     56        Bs3TestPrintf("r14=%016RX64 r15=%016RX64  cr0=%08RX64  cr4=%08RX64  cr3=%08RX64\n",
     57                      pRegCtx->r14.u64, pRegCtx->r15.u64, pRegCtx->cr0.u64, pRegCtx->cr4.u64, pRegCtx->cr3.u64);
     58        Bs3TestPrintf("rip=%016RX64 rsp=%016RX64 rbp=%016RX64 rfl=%08RX64\n",
     59                      pRegCtx->rip.u64, pRegCtx->rsp.u64, pRegCtx->rbp.u64, pRegCtx->rflags.u32);
     60        Bs3TestPrintf("cs=%04RX16   ds=%04RX16 es=%04RX16 fs=%04RX16 gs=%04RX16   ss=%04RX16            cr2=%016RX64\n",
     61                      pRegCtx->cs, pRegCtx->ds, pRegCtx->es, pRegCtx->fs, pRegCtx->gs, pRegCtx->ss,
     62                      pRegCtx->cr3.u64, pRegCtx->cr2.u64);
     63    }
     64    Bs3TestPrintf("tr=%04RX16 ldtr=%04RX16 cpl=%d   mode=%#x fbFlags=%#x\n",
     65                  pRegCtx->tr, pRegCtx->ldtr, pRegCtx->bCpl, pRegCtx->bMode, pRegCtx->fbFlags);
    5466}
    5567
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