VirtualBox

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


Ignore:
Timestamp:
Jan 22, 2018 8:54:43 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120403
Message:

bootsectors/bs3-cpu-instr-2: Clear out rbx so rdfsbase, rdgsbase can't incorrectly return the correct value.

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

Legend:

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

    r70666 r70667  
    9797static BS3CI2FSGSBASE const s_aWrFsBaseWorkers[] =
    9898{
    99     { "wrfsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_wrfsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_rbx_rdfsbase_rcx_ud2), 10 },
    100     { "wrfsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_ebx_rdfsbase_ecx_ud2),  8 },
     99    { "wrfsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_wrfsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_rbx_rdfsbase_rcx_ud2), 13 },
     100    { "wrfsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_ebx_rdfsbase_ecx_ud2), 10 },
    101101};
    102102
    103103static BS3CI2FSGSBASE const s_aWrGsBaseWorkers[] =
    104104{
    105     { "wrgsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_wrgsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_rbx_rdgsbase_rcx_ud2), 10 },
    106     { "wrgsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_ebx_rdgsbase_ecx_ud2),  8 },
     105    { "wrgsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_wrgsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_rbx_rdgsbase_rcx_ud2), 13 },
     106    { "wrgsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_ebx_rdgsbase_ecx_ud2), 10 },
    107107};
    108108
    109109static BS3CI2FSGSBASE const s_aRdFsBaseWorkers[] =
    110110{
    111     { "rdfsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_rdfsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_rbx_rdfsbase_rcx_ud2), 10 },
    112     { "rdfsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_rdfsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_ebx_rdfsbase_ecx_ud2),  8 },
     111    { "rdfsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_rdfsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_rbx_rdfsbase_rcx_ud2), 13 },
     112    { "rdfsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_rdfsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrfsbase_ebx_rdfsbase_ecx_ud2), 10 },
    113113};
    114114
    115115static BS3CI2FSGSBASE const s_aRdGsBaseWorkers[] =
    116116{
    117     { "rdgsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_rdgsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_rbx_rdgsbase_rcx_ud2), 10 },
    118     { "rdgsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_rdgsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_ebx_rdgsbase_ecx_ud2),  8 },
     117    { "rdgsbase rbx", true,  BS3_CMN_NM(bs3CpuInstr2_rdgsbase_rbx_ud2), 5, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_rbx_rdgsbase_rcx_ud2), 13 },
     118    { "rdgsbase ebx", false, BS3_CMN_NM(bs3CpuInstr2_rdgsbase_ebx_ud2), 4, BS3_CMN_NM(bs3CpuInstr2_wrgsbase_ebx_rdgsbase_ecx_ud2), 10 },
    119119};
    120120# endif
     
    806806            Bs3TrapSetJmpAndRestore(pCtx, pTrapFrame);
    807807            pExpectCtx->rip.u       = pCtx->rip.u + (!fGP ? pFsGsBaseWorker->offVerifyWorkerUd2 : 0);
     808            pExpectCtx->rbx.u       = !fGP ? 0 : s_aValues64[iValue].u64Base;
    808809            pExpectCtx->rcx.u       = !fGP ? s_aValues64[iValue].u64Base : 0;
    809810            pExpectCtx->rflags.u32 |= X86_EFL_RF;
     
    829830            Bs3TrapSetJmpAndRestore(pCtx, pTrapFrame);
    830831            pExpectCtx->rip.u       = pCtx->rip.u + pFsGsBaseWorker->offVerifyWorkerUd2;
     832            pExpectCtx->rbx.u       = 0;
    831833            pExpectCtx->rcx.u       = s_aValues64[iValue].u64Base & UINT64_C(0x00000000ffffffff);
    832834            pExpectCtx->rflags.u32 |= X86_EFL_RF;
     
    879881            bs3CpuInstr2_fsgsbase_ExpectUD(bMode, &Ctx, &ExpectCtx, &TrapFrame);
    880882
    881             /* Read existing base address. */
     883            /* Read any existing base address. */
    882884            Ctx.rbx.u  = 0xa0000;
    883885            Ctx.cr4.u |= X86_CR4_FSGSBASE;
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-2-template.mac

    r70651 r70667  
    197197BS3_PROC_BEGIN_CMN bs3CpuInstr2_wrfsbase_rbx_rdfsbase_rcx_ud2, BS3_PBC_NEAR
    198198        wrfsbase rbx
     199        xor      rbx, rbx
    199200        rdfsbase rcx
    200201.again:
    201202        ud2
    202203        jmp     .again
    203 AssertCompile(.again - BS3_LAST_LABEL == 10)
     204AssertCompile(.again - BS3_LAST_LABEL == 13)
    204205BS3_PROC_END_CMN   bs3CpuInstr2_wrfsbase_rbx_rdfsbase_rcx_ud2
    205206
     
    207208BS3_PROC_BEGIN_CMN bs3CpuInstr2_wrfsbase_ebx_rdfsbase_ecx_ud2, BS3_PBC_NEAR
    208209        wrfsbase ebx
     210        xor      ebx, ebx
    209211        rdfsbase ecx
    210212.again:
    211213        ud2
    212214        jmp     .again
    213 AssertCompile(.again - BS3_LAST_LABEL == 8)
     215AssertCompile(.again - BS3_LAST_LABEL == 10)
    214216BS3_PROC_END_CMN   bs3CpuInstr2_wrfsbase_ebx_rdfsbase_ecx_ud2
    215217
     
    217219BS3_PROC_BEGIN_CMN bs3CpuInstr2_wrgsbase_rbx_rdgsbase_rcx_ud2, BS3_PBC_NEAR
    218220        wrgsbase rbx
     221        xor      rbx, rbx
    219222        rdgsbase rcx
    220223.again:
    221224        ud2
    222225        jmp     .again
    223 AssertCompile(.again - BS3_LAST_LABEL == 10)
     226AssertCompile(.again - BS3_LAST_LABEL == 13)
    224227BS3_PROC_END_CMN   bs3CpuInstr2_wrgsbase_rbx_rdgsbase_rcx_ud2
    225228
     
    227230BS3_PROC_BEGIN_CMN bs3CpuInstr2_wrgsbase_ebx_rdgsbase_ecx_ud2, BS3_PBC_NEAR
    228231        wrgsbase ebx
     232        xor      ebx, ebx
    229233        rdgsbase ecx
    230234.again:
    231235        ud2
    232236        jmp     .again
    233 AssertCompile(.again - BS3_LAST_LABEL == 8)
     237AssertCompile(.again - BS3_LAST_LABEL == 10)
    234238BS3_PROC_END_CMN   bs3CpuInstr2_wrfgbase_ebx_rdgsbase_ecx_ud2
    235239
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