Changeset 97582 in vbox
- Timestamp:
- Nov 16, 2022 11:54:58 PM (2 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.mac
r97579 r97582 1722 1722 BS3_PROC_END_CMN bs3CpuBasic2_retn_i0__ud2 1723 1723 1724 %if TMPL_BITS == 64 1725 1726 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_retn_rexw__ud2 1727 BS3_PROC_BEGIN_CMN bs3CpuBasic2_retn_rexw__ud2, BS3_PBC_NEAR 1728 db 048h ; REX.W 1729 ret 1730 .again: ud2 1731 jmp .again 1732 BS3_PROC_END_CMN bs3CpuBasic2_retn_rexw__ud2 1733 1734 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_retn_i24_rexw__ud2 1735 BS3_PROC_BEGIN_CMN bs3CpuBasic2_retn_i24_rexw__ud2, BS3_PBC_NEAR 1736 db 048h ; REX.W 1737 ret 24 1738 .again: ud2 1739 jmp .again 1740 AssertCompile(.again - BS3_LAST_LABEL == 4) 1741 BS3_PROC_END_CMN bs3CpuBasic2_retn_i24_rexw__ud2 1742 1743 %endif 1744 1724 1745 ; Mark the start of opsize tests as we end up below 64K in 32-bit and 64-bit when used. 1725 1746 BS3_BEGIN_TEXT16 TMPL_BITS … … 1753 1774 BS3_PROC_END_CMN bs3CpuBasic2_retn_i0_opsize__ud2 1754 1775 1776 %if TMPL_BITS == 64 1777 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_retn_opsize_rexw__ud2 1778 BS3_PROC_BEGIN_CMN bs3CpuBasic2_retn_opsize_rexw__ud2, BS3_PBC_NEAR 1779 db 66h, 048h 1780 ret 1781 .again: ud2 1782 jmp .again 1783 BS3_PROC_END_CMN bs3CpuBasic2_retn_opsize_rexw__ud2 1784 1785 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_retn_i24_opsize_rexw__ud2 1786 BS3_PROC_BEGIN_CMN bs3CpuBasic2_retn_i24_opsize_rexw__ud2, BS3_PBC_NEAR 1787 db 66h, 048h 1788 ret 24 1789 .again: ud2 1790 jmp .again 1791 AssertCompile(.again - BS3_LAST_LABEL == 5) 1792 BS3_PROC_END_CMN bs3CpuBasic2_retn_i24_opsize_rexw__ud2 1793 %endif 1794 1755 1795 ; End of opsize tests. 1756 1796 BS3_GLOBAL_NAME_EX BS3_CMN_NM(bs3CpuBasic2_retn_opsize_end), , 1 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-x0.c
r97580 r97582 4627 4627 PROTO_ALL(bs3CpuBasic2_retn_i0__ud2); 4628 4628 PROTO_ALL(bs3CpuBasic2_retn_i0_opsize__ud2); 4629 FNBS3FAR bs3CpuBasic2_retn_rexw__ud2_c64; 4630 FNBS3FAR bs3CpuBasic2_retn_i24_rexw__ud2_c64; 4631 FNBS3FAR bs3CpuBasic2_retn_opsize_rexw__ud2_c64; 4632 FNBS3FAR bs3CpuBasic2_retn_i24_opsize_rexw__ud2_c64; 4629 4633 PROTO_ALL(bs3CpuBasic2_retn_opsize_end); 4630 4634 #undef PROTO_ALL … … 4833 4837 { 4834 4838 { 32, false, 0, bs3CpuBasic2_retn__ud2_c64, }, 4839 { 32, false, 0, bs3CpuBasic2_retn_rexw__ud2_c64, }, 4835 4840 { 32, true, 0, bs3CpuBasic2_retn_opsize__ud2_c64, }, 4841 { 32, true, 0, bs3CpuBasic2_retn_opsize_rexw__ud2_c64, }, 4836 4842 { 32, false, 24, bs3CpuBasic2_retn_i24__ud2_c64, }, 4843 { 32, false, 24, bs3CpuBasic2_retn_i24_rexw__ud2_c64, }, 4837 4844 { 32, true, 24, bs3CpuBasic2_retn_i24_opsize__ud2_c64, }, 4845 { 32, true, 24, bs3CpuBasic2_retn_i24_opsize_rexw__ud2_c64, }, 4838 4846 { 32, false, 0, bs3CpuBasic2_retn_i0__ud2_c64, }, 4839 4847 { 32, true, 0, bs3CpuBasic2_retn_i0_opsize__ud2_c64, }, … … 4842 4850 bool const fFix64OpSize = enmCpuVendor == BS3CPUVENDOR_INTEL; /** @todo what does VIA do? */ 4843 4851 4844 /* Prepare a copy of the UD2 instructions in low memory for opsize prefixed tests. */ 4852 /* Prepare a copy of the UD2 instructions in low memory for opsize prefixed 4853 tests, unless we're on intel where the opsize prefix is ignored. Here we 4854 just fill low memory with int3's so we can detect non-intel behaviour. */ 4845 4855 uint16_t const offLow = BS3_FP_OFF(bs3CpuBasic2_retn_opsize_begin_c64); 4846 4856 uint16_t const cbLow = BS3_FP_OFF(bs3CpuBasic2_retn_opsize_end_c64) - offLow; … … 4850 4860 Bs3TestFailedF("Opsize overriden jumps/calls are out of place: %#x LB %#x\n", offLow, cbLow); 4851 4861 Bs3MemSet(&pbLow[offLow], 0xcc /*int3*/, cbLow); 4852 for (iTest = 0; iTest < RT_ELEMENTS(s_aTests); iTest++) 4853 if (s_aTests[iTest].fOpSizePfx) 4854 { 4855 uint16_t const offFn = BS3_FP_OFF(s_aTests[iTest].pfnTest); 4856 uint16_t const offUd = offFn + (int16_t)(int8_t)pbCode16[offFn - 1]; 4857 BS3_ASSERT(offUd - offLow + 1 < cbLow); 4858 pbCode16[offUd] = 0xf1; /* replace original ud2 with icebp */ 4859 pbCode16[offUd + 1] = 0xf1; 4860 pbLow[offUd] = 0x0f; /* plant ud2 in low memory */ 4861 pbLow[offUd + 1] = 0x0b; 4862 } 4862 if (!fFix64OpSize) 4863 for (iTest = 0; iTest < RT_ELEMENTS(s_aTests); iTest++) 4864 if (s_aTests[iTest].fOpSizePfx) 4865 { 4866 uint16_t const offFn = BS3_FP_OFF(s_aTests[iTest].pfnTest); 4867 uint16_t const offUd = offFn + (int16_t)(int8_t)pbCode16[offFn - 1]; 4868 BS3_ASSERT(offUd - offLow + 1 < cbLow); 4869 pbCode16[offUd] = 0xf1; /* replace original ud2 with icebp */ 4870 pbCode16[offUd + 1] = 0xf1; 4871 pbLow[offUd] = 0x0f; /* plant ud2 in low memory */ 4872 pbLow[offUd + 1] = 0x0b; 4873 } 4863 4874 4864 4875 for (iTest = 0; iTest < RT_ELEMENTS(s_aTests); iTest++) … … 4877 4888 } 4878 4889 g_uBs3TrapEipHint = CtxExpected.rip.u32; 4879 Bs3TestPrintf("cs:rip=%04RX16:%04RX64 -> %04RX16:%04RX64\n", Ctx.cs, Ctx.rip.u, CtxExpected.cs, CtxExpected.rip.u);4890 //Bs3TestPrintf("cs:rip=%04RX16:%04RX64 -> %04RX16:%04RX64\n", Ctx.cs, Ctx.rip.u, CtxExpected.cs, CtxExpected.rip.u); 4880 4891 //Bs3TestPrintf("ss:rsp=%04RX16:%04RX64\n", Ctx.ss, Ctx.rsp.u); 4881 4892 bs3CpuBasic2_retn_PrepStack(StkPtr, &CtxExpected, s_aTests[iTest].fOpSizePfx && !fFix64OpSize ? 2 : 8);
Note:
See TracChangeset
for help on using the changeset viewer.