Changeset 97489 in vbox
- Timestamp:
- Nov 9, 2022 9:15:54 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-asm.asm
r97431 r97489 197 197 198 198 ; 0084 199 BS3_GLOBAL_NAME_EX NAME(bs3CpuBasic2_jmp_jv16_opsize_wrap_backward__ud2), function, 3199 BS3_GLOBAL_NAME_EX NAME(bs3CpuBasic2_jmp_jv16_opsize_wrap_backward__ud2), function, 6 200 200 db 066h, 0e9h ; jmp (0x0084 + 6 - 0x92 = 0xFFFFFFF8 (-8)) 201 201 dd -092h 202 202 int3 203 203 204 ; 008b 205 BS3_GLOBAL_NAME_EX NAME(bs3CpuBasic2_call_jv16_wrap_backward__ud2), function, 3 206 db 0e8h ; call (0x008b + 3 - 0x96) 207 dw -096h 208 int3 209 210 ; 008f 211 BS3_GLOBAL_NAME_EX NAME(bs3CpuBasic2_call_jv16_opsize_wrap_backward__ud2), function, 6 212 db 066h, 0e8h ; call (0x008f + 6 - 0x9d = 0xFFFFFFF8 (-8)) 213 dd -09dh 214 int3 215 204 216 205 217 align 0x100, int3 ; Note! Doesn't work correctly for higher values. 206 times (0xff76 - 0x100) int3 207 218 times (0xff6b - 0x100) int3 219 220 ; ff6b 221 BS3_GLOBAL_NAME_EX NAME(bs3CpuBasic2_call_jv16_wrap_forward__ud2), function, 4 222 db 0e8h ; call (0xff6b+3 + 0x94 = 0x10002 (65538)) 223 dw 094h 224 int3 225 226 ; ff6f 227 BS3_GLOBAL_NAME_EX NAME(bs3CpuBasic2_call_jv16_opsize_wrap_forward__ud2), function, 7 228 db 066h, 0e8h ; o32 call (0xff6f+6 + 0x8d = 0x10002 (65538)) 229 dd 08dh 230 int3 208 231 209 232 ; ff76 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.mac
r97477 r97489 657 657 BS3_PROC_END_CMN bs3CpuBasic2_call_jv_back__ud2 658 658 659 ; call [indirect] 660 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ind_mem__ud2 661 BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ind_mem__ud2, BS3_PBC_NEAR 662 %if TMPL_BITS == 16 663 call [word cs:.npAgain] 664 %elif TMPL_BITS == 32 665 call [dword cs:.npAgain] 666 %else 667 call [.npAgain] 668 %endif 669 .post_call: 670 times 9 int3 671 .npAgain: 672 %if TMPL_BITS == 16 673 dw BS3_TEXT16_WRT(.again) 674 %else 675 dd .again wrt FLAT 676 %if TMPL_BITS == 64 677 dd 0 678 %endif 679 %endif 680 .again: ud2 681 int3 682 jmp .again 683 BS3_PROC_END_CMN bs3CpuBasic2_call_ind_mem__ud2 684 685 ; call [xAX] 686 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ind_xAX__ud2 687 BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ind_xAX__ud2, BS3_PBC_NEAR 688 call xAX 689 .post_call: 690 times 17 int3 691 .again: ud2 692 int3 693 jmp .again 694 BS3_PROC_END_CMN bs3CpuBasic2_call_ind_xAX__ud2 695 696 ; call [xDI] 697 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ind_xDI__ud2 698 BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ind_xDI__ud2, BS3_PBC_NEAR 699 call xDI 700 .post_call: 701 times 17 int3 702 .again: ud2 703 int3 704 jmp .again 705 BS3_PROC_END_CMN bs3CpuBasic2_call_ind_xDI__ud2 706 707 %if TMPL_BITS == 64 708 ; call [xAX] 709 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ind_r9__ud2 710 BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ind_r9__ud2, BS3_PBC_NEAR 711 call r9 712 .post_call: 713 times 17 int3 714 .again: ud2 715 int3 716 jmp .again 717 BS3_PROC_END_CMN bs3CpuBasic2_call_ind_r9__ud2 718 %endif 719 659 720 660 721 ; … … 831 892 BS3_PROC_END_CMN bs3CpuBasic2_call_jv_opsize_back__ud2 832 893 894 ; call [indirect] 895 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ind_mem_opsize__ud2 896 BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ind_mem_opsize__ud2, BS3_PBC_NEAR 897 db 66h 898 %if TMPL_BITS == 16 899 call [word cs:.npAgain] 900 %elif TMPL_BITS == 32 901 call [dword cs:.npAgain wrt FLAT] 902 %else 903 call [.npAgain wrt FLAT] 904 %endif 905 .post_call: 906 times 9 int3 907 .npAgain: 908 %if TMPL_BITS == 16 909 dw BS3_TEXT16_WRT(.again) 910 dw 0 911 %else 912 dw .again wrt CGROUP16 913 dw 0faceh, 0f00dh, 07777h ; non-canonical address 914 %endif 915 .again: ud2 916 int3 917 jmp .again 918 BS3_PROC_END_CMN bs3CpuBasic2_call_ind_mem_opsize__ud2 919 920 %if TMPL_BITS == 64 921 ; call [indirect] - 64-bit intel version 922 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ind_mem_opsize__ud2__intel 923 BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ind_mem_opsize__ud2__intel, BS3_PBC_NEAR 924 db 66h 925 call [.npAgain wrt FLAT] 926 .post_call: 927 times 8 int3 928 .npAgain: 929 dd .again wrt FLAT 930 dd 0 931 .again: ud2 932 int3 933 jmp .again 934 BS3_PROC_END_CMN bs3CpuBasic2_call_ind_mem_opsize__ud2__intel 935 %endif 936 937 ; call [xAX] 938 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ind_xAX_opsize__ud2 939 BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ind_xAX_opsize__ud2, BS3_PBC_NEAR 940 db 66h 941 call xAX 942 .post_call: 943 times 8 int3 944 .again: ud2 945 int3 946 jmp .again 947 BS3_PROC_END_CMN bs3CpuBasic2_call_ind_xAX_opsize__ud2 948 833 949 834 950 %endif ; BS3_INSTANTIATING_CMN -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-x0.c
r97477 r97489 3648 3648 PROTO_ALL(bs3CpuBasic2_call_jv__ud2); 3649 3649 PROTO_ALL(bs3CpuBasic2_call_jv_back__ud2); 3650 PROTO_ALL(bs3CpuBasic2_call_ind_mem__ud2); 3651 PROTO_ALL(bs3CpuBasic2_call_ind_xAX__ud2); 3652 PROTO_ALL(bs3CpuBasic2_call_ind_xDI__ud2); 3653 FNBS3FAR bs3CpuBasic2_call_ind_r9__ud2_c64; 3650 3654 3651 3655 PROTO_ALL(bs3CpuBasic2_jmp_opsize_begin); … … 3659 3663 PROTO_ALL(bs3CpuBasic2_call_jv_opsize__ud2); 3660 3664 PROTO_ALL(bs3CpuBasic2_call_jv_opsize_back__ud2); 3665 PROTO_ALL(bs3CpuBasic2_call_ind_mem_opsize__ud2); 3666 FNBS3FAR bs3CpuBasic2_call_ind_mem_opsize__ud2__intel_c64; 3667 PROTO_ALL(bs3CpuBasic2_call_ind_xAX_opsize__ud2); 3661 3668 PROTO_ALL(bs3CpuBasic2_jmp_opsize_end); 3662 3669 #undef PROTO_ALL … … 3669 3676 FNBS3FAR bs3CpuBasic2_jmp_jv16_wrap_forward__ud2; 3670 3677 FNBS3FAR bs3CpuBasic2_jmp_jv16_opsize_wrap_forward__ud2; 3678 FNBS3FAR bs3CpuBasic2_call_jv16_wrap_forward__ud2; 3679 FNBS3FAR bs3CpuBasic2_call_jv16_opsize_wrap_forward__ud2; 3671 3680 3672 3681 FNBS3FAR bs3CpuBasic2_jmp_target_wrap_backward; … … 3675 3684 FNBS3FAR bs3CpuBasic2_jmp_jv16_wrap_backward__ud2; 3676 3685 FNBS3FAR bs3CpuBasic2_jmp_jv16_opsize_wrap_backward__ud2; 3686 FNBS3FAR bs3CpuBasic2_call_jv16_wrap_backward__ud2; 3687 FNBS3FAR bs3CpuBasic2_call_jv16_opsize_wrap_backward__ud2; 3677 3688 3678 3689 … … 3743 3754 { 0, true, -1, true, bs3CpuBasic2_call_jv_opsize__ud2_c16, }, 3744 3755 { 0, true, -1, true, bs3CpuBasic2_call_jv_opsize_back__ud2_c16, }, 3756 { 0, false, -1, true, bs3CpuBasic2_call_ind_mem__ud2_c16, }, 3757 { 0, true, -1, true, bs3CpuBasic2_call_ind_mem_opsize__ud2_c16, }, 3758 { 0, false, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX__ud2_c16, }, 3759 { 0, false, X86_GREG_xDI, true, bs3CpuBasic2_call_ind_xDI__ud2_c16, }, 3760 { 0, true, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX_opsize__ud2_c16, }, 3745 3761 3746 3762 { -1, false, -1, false, bs3CpuBasic2_jmp_jb_wrap_backward__ud2, }, … … 3753 3769 { -1, true, -1, false, bs3CpuBasic2_jmp_jv16_opsize_wrap_backward__ud2, }, 3754 3770 { +1, true, -1, false, bs3CpuBasic2_jmp_jv16_opsize_wrap_forward__ud2, }, 3771 { -1, false, -1, true, bs3CpuBasic2_call_jv16_wrap_backward__ud2, }, 3772 { +1, false, -1, true, bs3CpuBasic2_call_jv16_wrap_forward__ud2, }, 3773 { -1, true, -1, true, bs3CpuBasic2_call_jv16_opsize_wrap_backward__ud2, }, 3774 { +1, true, -1, true, bs3CpuBasic2_call_jv16_opsize_wrap_forward__ud2, }, 3755 3775 }; 3756 3776 … … 3821 3841 } 3822 3842 3823 /* Limit the wraparound CS segment to ex lcude bs3CpuBasic2_jmp_target_wrap_backward3843 /* Limit the wraparound CS segment to exclude bs3CpuBasic2_jmp_target_wrap_backward 3824 3844 and run the backward wrapping tests. */ 3825 3845 if (!BS3_MODE_IS_RM_OR_V86(bMode)) 3826 3846 { 3827 3847 Bs3GdteSpare03.Gen.u16LimitLow = BS3_FP_OFF(bs3CpuBasic2_jmp_target_wrap_backward) - 1; 3828 CtxExpected.cs = Ctx.cs = BS3_SEL_SPARE_03; 3848 CtxExpected.cs = Ctx.cs = BS3_SEL_SPARE_03; 3849 CtxExpected.rsp.u = Ctx.rsp.u; 3829 3850 for (iTest = 0; iTest < RT_ELEMENTS(s_aTests); iTest++) 3830 3851 if (s_aTests[iTest].iWrap < 0) … … 3848 3869 else 3849 3870 CtxExpected.rip.u = BS3_FP_OFF(bs3CpuBasic2_jmp_target_wrap_backward); 3871 CtxExpected.rsp.u = Ctx.rsp.u; 3872 if (s_aTests[iTest].fCall && (s_aTests[iTest].iWrap == 0 || !s_aTests[iTest].fOpSizePfx)) 3873 CtxExpected.rsp.u -= s_aTests[iTest].fOpSizePfx ? 4 : 2; 3850 3874 //Bs3TestPrintf("cs:rip=%04RX16:%04RX64 v2\n", Ctx.cs, Ctx.rip.u); 3851 3875 Bs3TrapSetJmpAndRestore(&Ctx, &TrapCtx); … … 3893 3917 { 32, true, false, -1, true, bs3CpuBasic2_call_jv_opsize__ud2_c32, }, 3894 3918 { 32, true, false, -1, true, bs3CpuBasic2_call_jv_opsize_back__ud2_c32, }, 3919 { 32, false, false, -1, true, bs3CpuBasic2_call_ind_mem__ud2_c32, }, 3920 { 32, true, false, -1, true, bs3CpuBasic2_call_ind_mem_opsize__ud2_c32, }, 3921 { 32, false, false, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX__ud2_c32, }, 3922 { 32, false, false, X86_GREG_xDI, true, bs3CpuBasic2_call_ind_xDI__ud2_c32, }, 3923 { 32, true, false, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX_opsize__ud2_c32, }, 3895 3924 /* 64bit/Intel: Use the _c64 tests, which are written to ignore the o16 prefix. */ 3896 3925 { 64, false, true, -1, false, bs3CpuBasic2_jmp_jb__ud2_c64, }, … … 3912 3941 { 64, true, true, -1, true, bs3CpuBasic2_call_jv_opsize__ud2_c64, }, 3913 3942 { 64, true, true, -1, true, bs3CpuBasic2_call_jv_opsize_back__ud2_c64, }, 3943 { 64, false, true, -1, true, bs3CpuBasic2_call_ind_mem__ud2_c64, }, 3944 { 64, true, true, -1, true, bs3CpuBasic2_call_ind_mem_opsize__ud2__intel_c64,}, 3945 { 64, false, true, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX__ud2_c64, }, 3946 { 64, false, true, X86_GREG_xDI, true, bs3CpuBasic2_call_ind_xDI__ud2_c64, }, 3947 { 64, false, true, X86_GREG_x9, true, bs3CpuBasic2_call_ind_r9__ud2_c64, }, 3948 { 64, true, true, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX_opsize__ud2_c64, }, /* no intel version needed */ 3914 3949 /* 64bit/AMD: Use the _c32 tests. */ 3915 3950 { 64, false, false, -1, false, bs3CpuBasic2_jmp_jb__ud2_c32, }, … … 3922 3957 { 64, true, false, -1, false, bs3CpuBasic2_jmp_jv_opsize_back__ud2_c32, }, 3923 3958 { 64, false, false, -1, false, bs3CpuBasic2_jmp_ind_mem__ud2_c64, }, /* using c64 here */ 3924 { 64, true, false, -1, false, bs3CpuBasic2_jmp_ind_mem_opsize__ud2_c64, }, /* using c64 here*/3959 { 64, true, false, -1, false, bs3CpuBasic2_jmp_ind_mem_opsize__ud2_c64, }, /* ditto */ 3925 3960 { 64, false, false, X86_GREG_xAX, false, bs3CpuBasic2_jmp_ind_xAX__ud2_c64, }, /* ditto */ 3926 3961 { 64, false, false, X86_GREG_xDI, false, bs3CpuBasic2_jmp_ind_xDI__ud2_c64, }, /* ditto */ … … 3931 3966 { 64, true, false, -1, true, bs3CpuBasic2_call_jv_opsize__ud2_c32, }, 3932 3967 { 64, true, false, -1, true, bs3CpuBasic2_call_jv_opsize_back__ud2_c32, }, 3968 { 64, false, false, -1, true, bs3CpuBasic2_call_ind_mem__ud2_c64, }, /* using c64 here */ 3969 { 64, true, false, -1, true, bs3CpuBasic2_call_ind_mem_opsize__ud2_c64, }, /* ditto */ 3970 { 64, false, false, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX__ud2_c64, }, /* ditto */ 3971 { 64, false, false, X86_GREG_xDI, true, bs3CpuBasic2_call_ind_xDI__ud2_c64, }, /* ditto */ 3972 { 64, false, false, X86_GREG_x9, true, bs3CpuBasic2_call_ind_r9__ud2_c64, }, /* ditto */ 3973 { 64, true, false, X86_GREG_xAX, true, bs3CpuBasic2_call_ind_xAX_opsize__ud2_c64, }, /* ditto */ 3933 3974 }; 3934 3975 uint8_t const cBits = BS3_MODE_IS_64BIT_CODE(bMode) ? 64 : 32;
Note:
See TracChangeset
for help on using the changeset viewer.