Changeset 97433 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Nov 7, 2022 3:16:23 PM (2 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.mac
r97431 r97433 517 517 518 518 ; jmp rel8 (backwards) 519 BS3_GLOBAL_NAME_EX RT_CONCAT(BS3_CMN_NM(bs3CpuBasic2_jmp_jb_back__ud2),.again), function, 2 520 ud2 521 times 7 int3 519 522 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmp_jb_back__ud2 520 523 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmp_jb_back__ud2, BS3_PBC_NEAR 521 jmp .start522 .again: ud2523 times 7 int3524 jmp .again525 .start:526 524 jmp short .again 527 525 .post_jmp: 528 526 int3 529 AssertCompile(.post_jmp - .start== 2)527 AssertCompile(.post_jmp - BS3_LAST_LABEL == 2) 530 528 BS3_PROC_END_CMN bs3CpuBasic2_jmp_jb_back__ud2 531 529 … … 549 547 550 548 ; jmp rel16 (backwards) 549 BS3_GLOBAL_NAME_EX RT_CONCAT(BS3_CMN_NM(bs3CpuBasic2_jmp_jv_back__ud2),.again), function, 2 550 ud2 551 times 6 int3 551 552 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmp_jv_back__ud2 552 553 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmp_jv_back__ud2, BS3_PBC_NEAR 553 jmp .start554 .again: ud2555 times 6 int3556 jmp .again557 .start:558 554 jmp near .again 559 555 .post_jmp: 560 556 int3 561 557 %if TMPL_BITS == 16 562 AssertCompile(.post_jmp - .start== 3)558 AssertCompile(.post_jmp - BS3_LAST_LABEL == 3) 563 559 %else 564 AssertCompile(.post_jmp - .start== 5)560 AssertCompile(.post_jmp - BS3_LAST_LABEL == 5) 565 561 %endif 566 562 BS3_PROC_END_CMN bs3CpuBasic2_jmp_jv_back__ud2 … … 599 595 600 596 ; jmp rel8 (backwards) with opsize override. 597 BS3_GLOBAL_NAME_EX RT_CONCAT(BS3_CMN_NM(bs3CpuBasic2_jmp_jb_opsize_back__ud2),.again), function, 2 598 ud2 599 times 19 int3 601 600 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmp_jb_opsize_back__ud2 602 601 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmp_jb_opsize_back__ud2, BS3_PBC_NEAR 603 jmp .start 604 .again: ud2 605 times 19 int3 606 jmp .again 607 .start: 608 db 66h 602 db 66h 609 603 jmp short .again 610 604 .post_jmp: 611 605 int3 612 AssertCompile(.post_jmp - .start== 3)606 AssertCompile(.post_jmp - BS3_LAST_LABEL == 3) 613 607 BS3_PROC_END_CMN bs3CpuBasic2_jmp_jb_opsize_back__ud2 614 608 … … 617 611 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmp_jv_opsize__ud2 618 612 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmp_jv_opsize__ud2, BS3_PBC_NEAR 619 db 66h, 0e9h; o32 jmp near .again613 db 66h, 0e9h ; o32 jmp near .again 620 614 %if TMPL_BITS != 32 621 dd 11615 dd 11 622 616 %else 623 dw 11617 dw 11 624 618 %endif 625 619 .post_jmp: … … 632 626 633 627 ; jmp rel16 (backwards) with opsize override. 628 BS3_GLOBAL_NAME_EX RT_CONCAT(BS3_CMN_NM(bs3CpuBasic2_jmp_jv_opsize_back__ud2),.again), function, 2 629 ud2 630 times 19 int3 634 631 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmp_jv_opsize_back__ud2 635 632 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmp_jv_opsize_back__ud2, BS3_PBC_NEAR 636 jmp .start637 .again: ud2638 int3639 jmp .again640 .start:641 633 %if TMPL_BITS != 32 642 634 db 66h, 0e9h ; o32 jmp near .again 643 dd -(6 + 1 + 2 + 2)635 dd RT_CONCAT(BS3_CMN_NM(bs3CpuBasic2_jmp_jv_opsize_back__ud2),.again) - .post_jmp 644 636 %else 645 637 db 66h, 0e9h ; o16 jmp near .again 646 dw -(4 + 1 + 2 + 2)647 %endif 648 .post_jmp: 649 times 11int3638 dw RT_CONCAT(BS3_CMN_NM(bs3CpuBasic2_jmp_jv_opsize_back__ud2),.again) - .post_jmp 639 %endif 640 .post_jmp: 641 int3 650 642 BS3_PROC_END_CMN bs3CpuBasic2_jmp_jv_opsize_back__ud2 651 643 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-x0.c
r97432 r97433 510 510 511 511 if ( g_f16BitSys 512 || bXcpt == X86_XCPT_DB /* hack (10980xe)... */ 512 513 || ( !f486ResumeFlagHint 513 514 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) <= BS3CPU_80486 ) ) … … 594 595 { 595 596 bs3CpuBasic2_CompareCpuTrapCtx(pTrapCtx, pStartCtx, 0 /*always zero*/, X86_XCPT_AC, true /*f486ResumeFlagHint*/, cbIpAdjust); 597 } 598 599 /** 600 * Compares \#DB trap. 601 */ 602 static void bs3CpuBasic2_CompareDbCtx(PCBS3TRAPFRAME pTrapCtx, PCBS3REGCTX pStartCtx) 603 { 604 bs3CpuBasic2_CompareCpuTrapCtx(pTrapCtx, pStartCtx, 0 /*always zero*/, X86_XCPT_DB, false /*f486ResumeFlagHint?*/, 0 /*cbIpAdjust*/); 596 605 } 597 606 … … 3667 3676 * with control registers and such. 3668 3677 */ 3669 BS3_DECL_FAR(uint8_t) BS3_CMN_FAR_NM(bs3CpuBasic2_jmp )(uint8_t bMode)3678 BS3_DECL_FAR(uint8_t) BS3_CMN_FAR_NM(bs3CpuBasic2_jmp_rel)(uint8_t bMode) 3670 3679 { 3671 3680 BS3TRAPFRAME TrapCtx; … … 3734 3743 Bs3RegCtxSetRipCsFromLnkPtr(&Ctx, s_aTests[iTest].pfnTest); 3735 3744 fpbCode = (uint8_t const BS3_FAR *)BS3_FP_MAKE(Ctx.cs, Ctx.rip.u16); 3736 CtxExpected.rip.u = Ctx.rip.u + fpbCode[-1];3745 CtxExpected.rip.u = Ctx.rip.u + (int64_t)(int8_t)fpbCode[-1]; 3737 3746 } 3738 3747 else … … 3754 3763 3755 3764 Bs3TrapSetJmpAndRestore(&Ctx, &TrapCtx); 3756 3757 3765 if (s_aTests[iTest].iWrap == 0 || !s_aTests[iTest].fOpSizePfx) 3758 3766 bs3CpuBasic2_CompareUdCtx(&TrapCtx, &CtxExpected); 3759 3767 else 3760 3768 bs3CpuBasic2_CompareGpCtx(&TrapCtx, &CtxExpected, 0); 3761 3769 g_usBs3TestStep++; 3770 3771 /* Again single stepping: */ 3772 Ctx.rflags.u16 |= X86_EFL_TF; 3773 CtxExpected.rflags.u16 = Ctx.rflags.u16; 3774 Bs3TrapSetJmpAndRestore(&Ctx, &TrapCtx); 3775 if (s_aTests[iTest].iWrap == 0 || !s_aTests[iTest].fOpSizePfx) 3776 { 3777 /** @todo check DR6.BS. */ 3778 bs3CpuBasic2_CompareDbCtx(&TrapCtx, &CtxExpected); 3779 } 3780 else 3781 bs3CpuBasic2_CompareGpCtx(&TrapCtx, &CtxExpected, 0); 3782 Ctx.rflags.u16 &= ~X86_EFL_TF; 3783 CtxExpected.rflags.u16 = Ctx.rflags.u16; 3762 3784 g_usBs3TestStep++; 3763 3785 } … … 3861 3883 { 3862 3884 uint16_t const offFn = BS3_FP_OFF(s_aTests[iTest].pfnTest); 3863 uint16_t const offUd = offFn + pbCode16[offFn - 1];3885 uint16_t const offUd = offFn + (int16_t)(int8_t)pbCode16[offFn - 1]; 3864 3886 pbCode16[offUd] = 0xf1; /* replace original ud2 with icebp */ 3865 3887 pbCode16[offUd + 1] = 0xf1; … … 3876 3898 uint8_t const BS3_FAR *fpbCode = Bs3SelLnkPtrToCurPtr(s_aTests[iTest].pfnTest); 3877 3899 Ctx.rip.u = Bs3SelLnkPtrToFlat(s_aTests[iTest].pfnTest); 3878 CtxExpected.rip.u = Ctx.rip.u + fpbCode[-1];3900 CtxExpected.rip.u = Ctx.rip.u + (int64_t)(int8_t)fpbCode[-1]; 3879 3901 if (s_aTests[iTest].fOpSizePfx && !fIgnPfx) 3880 3902 CtxExpected.rip.u &= UINT16_MAX; … … 3887 3909 bs3CpuBasic2_CompareUdCtx(&TrapCtx, &CtxExpected); 3888 3910 g_usBs3TestStep++; 3911 3912 /* Again single stepping: */ 3913 Ctx.rflags.u16 |= X86_EFL_TF; 3914 CtxExpected.rflags.u16 = Ctx.rflags.u16; 3915 Bs3TrapSetJmpAndRestore(&Ctx, &TrapCtx); 3916 /** @todo check DR6.BS. */ 3917 bs3CpuBasic2_CompareDbCtx(&TrapCtx, &CtxExpected); 3918 Ctx.rflags.u16 &= ~X86_EFL_TF; 3919 CtxExpected.rflags.u16 = Ctx.rflags.u16; 3920 g_usBs3TestStep++; 3889 3921 } 3890 3922 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2.c
r97431 r97433 55 55 FNBS3TESTDOMODE bs3CpuBasic2_lgdt_f16; 56 56 FNBS3TESTDOMODE bs3CpuBasic2_iret_f16; 57 FNBS3TESTDOMODE bs3CpuBasic2_jmp_ f16;57 FNBS3TESTDOMODE bs3CpuBasic2_jmp_rel_f16; 58 58 59 59 BS3_DECL_CALLBACK(void) bs3CpuBasic2_Do32BitTests_pe32(); … … 76 76 #if 1 77 77 //{ "iret", bs3CpuBasic2_iret_f16, 0 }, 78 { "jmp ", bs3CpuBasic2_jmp_f16, 0 },78 { "jmp jb / jv", bs3CpuBasic2_jmp_rel_f16, 0 }, 79 79 #endif 80 80 #if 0
Note:
See TracChangeset
for help on using the changeset viewer.