Changeset 97507 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Nov 11, 2022 11:46:02 AM (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
r97505 r97507 53 53 %endif 54 54 55 %undef BS3_CPUBAS2_REF_LAB LE_VIA_CS55 %undef BS3_CPUBAS2_REF_LABEL_VIA_CS 56 56 %if TMPL_BITS == 16 57 %define BS3_CPUBAS2_REF_LABLE_VIA_CS(a_Label) cs:a_Label 57 %define BS3_CPUBAS2_REF_LABEL_VIA_CS(a_Label) cs:a_Label 58 %define BS3_CPUBAS2_JMP_FAR_MEM_LABEL(a_Label) jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(a_Label)] 58 59 %elif TMPL_BITS == 32 59 %define BS3_CPUBAS2_REF_LABLE_VIA_CS(a_Label) cs:a_Label wrt FLAT 60 %define BS3_CPUBAS2_REF_LABEL_VIA_CS(a_Label) cs:a_Label wrt FLAT 61 %define BS3_CPUBAS2_JMP_FAR_MEM_LABEL(a_Label) jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(a_Label)] 60 62 %elif TMPL_BITS == 64 61 %define BS3_CPUBAS2_REF_LABLE_VIA_CS(a_Label) a_Label wrt FLAT 63 %define BS3_CPUBAS2_REF_LABEL_VIA_CS(a_Label) a_Label wrt FLAT 64 %define BS3_CPUBAS2_JMP_FAR_MEM_LABEL(a_Label) jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(a_Label)] 62 65 %else 63 66 %error TMPL_BITS 64 67 %endif 68 69 %ifndef BS3_CPUBAS2_JMP_FAR_MEM_LABEL_DEFINED 70 %define BS3_CPUBAS2_JMP_FAR_MEM_LABEL_DEFINED 71 %macro BS3_CPUBAS2_JMP_FAR_MEM_LABEL 2 72 %if TMPL_BITS != 64 73 jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(%1)] 74 %elif TMPL_BITS == 64 75 ; 48FF2C25[040C0000] <3> jmp far [BS3_CPUBAS2_REF_LABLE_VIA_CS(.fpfn)] 76 %if %2 != 0 77 db 048h ; REX.W 78 %endif 79 db 0ffh, 02ch, 025h 80 dd %1 wrt FLAT 81 %else 82 %error TMPL_BITS 83 %endif 84 %endmacro 85 %endif ; BS3_CPUBAS2_JMP_FAR_MEM_LABEL_DEFINED 65 86 66 87 … … 1232 1253 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_rm__ud2 1233 1254 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_rm__ud2, BS3_PBC_NEAR 1234 jmp far [BS3_CPUBAS2_REF_LAB LE_VIA_CS(.fpfn)]1255 jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(.fpfn)] 1235 1256 int3 1236 1257 .fpfn: … … 1245 1266 %endif 1246 1267 1247 1248 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r0__ud2 1249 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r0__ud2, BS3_PBC_NEAR 1250 jmp far [BS3_CPUBAS2_REF_LABLE_VIA_CS(.fpfn)] 1268 ; The first 64-bit versions follow AMD behaviour 1269 1270 %ifndef jmpf_macro_defined 1271 %define jmpf_macro_defined 1272 %macro jmpf_macro 2 1273 1274 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r0__ud2 %+ %1 1275 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r0__ud2 %+ %1, BS3_PBC_NEAR 1276 jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(.fpfn)] 1251 1277 .fpfn: 1252 1278 %if TMPL_BITS == 16 … … 1257 1283 dw BS3_SEL_R0_CS32 1258 1284 %else 1259 dd .again wrt FLAT, 0fffff000h 1285 dd .again wrt FLAT 1286 %if %2 != 0 1287 dd 0fffff000h 1288 %endif 1260 1289 dw BS3_SEL_R0_CS64 1261 1290 %endif … … 1265 1294 int3 1266 1295 jmp .again 1267 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r0__ud2 1268 1269 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r1__ud2 1270 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r1__ud2 , BS3_PBC_NEAR1271 jmp far [BS3_CPUBAS2_REF_LAB LE_VIA_CS(.fpfn)]1296 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r0__ud2 %+ %1 1297 1298 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r1__ud2 %+ %1 1299 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r1__ud2 %+ %1, BS3_PBC_NEAR 1300 jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(.fpfn)] 1272 1301 .fpfn: 1273 1302 %if TMPL_BITS == 16 … … 1278 1307 dw BS3_SEL_R1_CS32 | 1 1279 1308 %else 1280 dd .again wrt FLAT, 0fffff000h 1309 dd .again wrt FLAT 1310 %if %2 != 0 1311 dd 0fffff000h 1312 %endif 1281 1313 dw BS3_SEL_R1_CS64 | 1 1282 1314 %endif 1283 1315 .again: ud2 1284 1316 jmp .again 1285 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r1__ud2 1286 1287 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r2__ud2 1288 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r2__ud2 , BS3_PBC_NEAR1289 jmp far [BS3_CPUBAS2_REF_LABLE_VIA_CS(.fpfn)]1317 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r1__ud2 %+ %1 1318 1319 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r2__ud2 %+ %1 1320 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r2__ud2 %+ %1, BS3_PBC_NEAR 1321 BS3_CPUBAS2_JMP_FAR_MEM_LABEL .fpfn, 0 1290 1322 .fpfn: 1291 1323 %if TMPL_BITS == 16 … … 1296 1328 dw BS3_SEL_R2_CS32 | 2 1297 1329 %else 1298 dd .again wrt FLAT, 0fffff000h 1330 dd .again wrt FLAT 1331 %if %2 != 0 1332 dd 0fffff000h 1333 %endif 1299 1334 dw BS3_SEL_R2_CS64 | 2 1300 1335 %endif 1301 1336 .again: ud2 1302 1337 jmp .again 1303 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r2__ud2 1304 1305 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r3__ud2 1306 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r3__ud2 , BS3_PBC_NEAR1307 jmp far [BS3_CPUBAS2_REF_LABLE_VIA_CS(.fpfn)]1338 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r2__ud2 %+ %1 1339 1340 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_same_r3__ud2 %+ %1 1341 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_same_r3__ud2 %+ %1, BS3_PBC_NEAR 1342 BS3_CPUBAS2_JMP_FAR_MEM_LABEL .fpfn, 1 1308 1343 .fpfn: 1309 1344 %if TMPL_BITS == 16 … … 1314 1349 dw BS3_SEL_R3_CS32 | 3 1315 1350 %else 1316 dd .again wrt FLAT, 0fffff000h 1351 dd .again wrt FLAT 1352 %if %2 != 0 1353 dd 0fffff000h 1354 %endif 1317 1355 dw BS3_SEL_R3_CS64 | 3 1318 1356 %endif 1319 1357 .again: ud2 1320 1358 jmp .again 1321 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r3__ud2 1322 1323 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs16__ud2 1324 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs16__ud2 , BS3_PBC_NEAR1359 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_same_r3__ud2 %+ %1 1360 1361 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs16__ud2 %+ %1 1362 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs16__ud2 %+ %1, BS3_PBC_NEAR 1325 1363 %if TMPL_BITS != 16 1326 1364 db 66h 1327 1365 %endif 1328 jmp far [BS3_CPUBAS2_REF_LABLE_VIA_CS(.fpfn)] 1366 BS3_CPUBAS2_JMP_FAR_MEM_LABEL .fpfn, 0 1367 .fpfn: 1368 %if TMPL_BITS != 64 || %2 == 0 1369 dw .again wrt CGROUP16 1370 %else 1371 dd .again wrt CGROUP16, 0 1372 %endif 1373 dw BS3_SEL_R0_CS16 1374 times 4 int3 1375 .again: ud2 1376 jmp .again 1377 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs16__ud2 %+ %1 1378 1379 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs32__ud2 %+ %1 1380 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs32__ud2 %+ %1, BS3_PBC_NEAR 1381 %if TMPL_BITS == 16 1382 db 66h 1383 %endif 1384 BS3_CPUBAS2_JMP_FAR_MEM_LABEL .fpfn, 0 1329 1385 .fpfn: 1330 1386 %if TMPL_BITS != 64 1331 d w .again wrt CGROUP161387 dd .again wrt FLAT 1332 1388 %else 1333 dd .again wrt CGROUP16, 0 1334 %endif 1335 dw BS3_SEL_R0_CS16 1336 times 4 int3 1337 .again: ud2 1338 jmp .again 1339 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs16__ud2 1340 1341 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs32__ud2 1342 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs32__ud2, BS3_PBC_NEAR 1343 %if TMPL_BITS == 16 1344 db 66h 1345 %endif 1346 jmp far [BS3_CPUBAS2_REF_LABLE_VIA_CS(.fpfn)] 1347 .fpfn: 1348 %if TMPL_BITS != 64 1349 dd .again wrt FLAT 1350 %else 1351 dd .again wrt FLAT, 0 1389 dd .again wrt FLAT 1390 %if %2 != 0 1391 dd 0 1392 %endif 1352 1393 %endif 1353 1394 dw BS3_SEL_R0_CS32 … … 1355 1396 .again: ud2 1356 1397 jmp .again 1357 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs32__ud2 1398 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs32__ud2 %+ %1 1358 1399 1359 1400 ; Do a jmp to BS3_SEL_R0_CS64. Except for when we're in long mode, this will 1360 1401 ; result in a 16-bit CS with zero base and 4G limit. 1361 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs64__ud2 1362 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs64__ud2 , BS3_PBC_NEAR1402 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs64__ud2 %+ %1 1403 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs64__ud2 %+ %1, BS3_PBC_NEAR 1363 1404 %if TMPL_BITS == 16 1364 1405 db 066h 1365 1406 %endif 1366 jmp far [BS3_CPUBAS2_REF_LAB LE_VIA_CS(.fpfn)]1407 jmp far [BS3_CPUBAS2_REF_LABEL_VIA_CS(.fpfn)] 1367 1408 .fpfn: 1368 1409 dd .jmp_target wrt FLAT 1369 %if TMPL_BITS == 64 1410 %if TMPL_BITS == 64 && %2 != 0 1370 1411 dd 0fffff000h 1371 1412 %endif … … 1378 1419 .again: ud2 1379 1420 jmp .again 1380 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs64__ud2 1421 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs64__ud2 %+ %1 1381 1422 1382 1423 ; Variation of the previous with a CS16 copy that has the L bit set, emulating … … 1384 1425 ; long mode w/o copying the 3 bytes to the 0xxxxh memory range.) 1385 1426 ; The _c64 version will test that the base is ignored. 1386 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2 1387 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2 , BS3_PBC_NEAR1388 %if TMPL_BITS != 161427 BS3_CPUBAS2_UD_OFF bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2 %+ %1 1428 BS3_PROC_BEGIN_CMN bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2 %+ %1, BS3_PBC_NEAR 1429 %if TMPL_BITS == 32 1389 1430 db 066h 1390 1431 %endif 1391 jmp far [BS3_CPUBAS2_REF_LABLE_VIA_CS(.fpfn)]1432 BS3_CPUBAS2_JMP_FAR_MEM_LABEL .fpfn, 0 1392 1433 .fpfn: 1393 1434 %if TMPL_BITS != 64 1394 1435 dw .jmp_target wrt CGROUP16 1395 1436 %else 1396 dd .jmp_target wrt FLAT, 0fffff000h 1437 dd .jmp_target wrt FLAT 1438 %if %2 != 0 1439 dd 0fffff000h 1440 %endif 1397 1441 %endif 1398 1442 dw BS3_SEL_SPARE_00 ; ASSUMES this is set up as CGROUP16 but with L=1. … … 1404 1448 .again: ud2 1405 1449 jmp .again 1406 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2 1407 1450 BS3_PROC_END_CMN bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2 %+ %1 1451 1452 %endmacro 1453 %endif 1454 1455 ; Instantiate the above code 1456 jmpf_macro , 0 1457 %if TMPL_BITS == 64 1458 jmpf_macro _intel, 1 1459 %endif 1408 1460 1409 1461 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-x0.c
r97505 r97507 4104 4104 PROTO_ALL(bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2); 4105 4105 4106 FNBS3FAR bs3CpuBasic2_jmpf_mem_same_r0__ud2_intel_c64; 4107 FNBS3FAR bs3CpuBasic2_jmpf_mem_same_r1__ud2_intel_c64; 4108 FNBS3FAR bs3CpuBasic2_jmpf_mem_same_r2__ud2_intel_c64; 4109 FNBS3FAR bs3CpuBasic2_jmpf_mem_same_r3__ud2_intel_c64; 4110 FNBS3FAR bs3CpuBasic2_jmpf_mem_r0_cs16__ud2_intel_c64; 4111 FNBS3FAR bs3CpuBasic2_jmpf_mem_r0_cs32__ud2_intel_c64; 4112 FNBS3FAR bs3CpuBasic2_jmpf_mem_r0_cs64__ud2_intel_c64; 4113 FNBS3FAR bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2_intel_c64; 4114 4106 4115 #undef PROTO_ALL 4107 4116 … … 4371 4380 uint8_t uDstBits; 4372 4381 bool fOpSizePfx; 4382 int8_t fFix64OpSize; 4373 4383 FPFNBS3FAR pfnTest; 4374 4384 } … … 4376 4386 { 4377 4387 /* invalid opcodes: */ 4378 { true, false, BS3_SEL_R0_CS32, 64, false, bs3CpuBasic2_jmpf_ptr_same_r0__ud2_c32, }, 4379 { true, false, BS3_SEL_R1_CS32 | 1, 64, false, bs3CpuBasic2_jmpf_ptr_same_r1__ud2_c32, }, 4380 { true, false, BS3_SEL_R2_CS32 | 2, 64, false, bs3CpuBasic2_jmpf_ptr_same_r2__ud2_c32, }, 4381 { true, false, BS3_SEL_R3_CS32 | 3, 64, false, bs3CpuBasic2_jmpf_ptr_same_r3__ud2_c32, }, 4382 { true, false, BS3_SEL_R0_CS16, 64, false, bs3CpuBasic2_jmpf_ptr_opsize_flipbit_r0__ud2_c32, }, 4383 { true, false, BS3_SEL_R0_CS64, 64, false, bs3CpuBasic2_jmpf_ptr_r0_cs64__ud2_c32, }, 4384 { true, false, BS3_SEL_SPARE_00, 64, false, bs3CpuBasic2_jmpf_ptr_r0_cs16l__ud2_c32, }, 4385 4386 { true, true, BS3_SEL_R0_CS32, 64, false, bs3CpuBasic2_callf_ptr_same_r0__ud2_c32, }, 4387 { true, true, BS3_SEL_R1_CS32 | 1, 64, false, bs3CpuBasic2_callf_ptr_same_r1__ud2_c32, }, 4388 { true, true, BS3_SEL_R2_CS32 | 2, 64, false, bs3CpuBasic2_callf_ptr_same_r2__ud2_c32, }, 4389 { true, true, BS3_SEL_R3_CS32 | 3, 64, false, bs3CpuBasic2_callf_ptr_same_r3__ud2_c32, }, 4390 { true, true, BS3_SEL_R0_CS16, 64, false, bs3CpuBasic2_callf_ptr_opsize_flipbit_r0__ud2_c32, }, 4391 { true, true, BS3_SEL_R0_CS64, 64, false, bs3CpuBasic2_callf_ptr_r0_cs64__ud2_c32, }, 4392 { true, true, BS3_SEL_SPARE_00, 64, false, bs3CpuBasic2_callf_ptr_r0_cs16l__ud2_c32, }, 4393 4394 { false, false, BS3_SEL_R0_CS64, 64, false, bs3CpuBasic2_jmpf_mem_same_r0__ud2_c64, }, 4395 { false, false, BS3_SEL_R1_CS64 | 1, 64, false, bs3CpuBasic2_jmpf_mem_same_r1__ud2_c64, }, 4396 { false, false, BS3_SEL_R2_CS64 | 2, 64, false, bs3CpuBasic2_jmpf_mem_same_r2__ud2_c64, }, 4397 { false, false, BS3_SEL_R3_CS64 | 3, 64, false, bs3CpuBasic2_jmpf_mem_same_r3__ud2_c64, }, 4398 { false, false, BS3_SEL_R0_CS16, 16, true, bs3CpuBasic2_jmpf_mem_r0_cs16__ud2_c64, }, 4399 { false, false, BS3_SEL_R0_CS32, 32, false, bs3CpuBasic2_jmpf_mem_r0_cs32__ud2_c64, }, 4400 { false, false, BS3_SEL_R0_CS64, 64, false, bs3CpuBasic2_jmpf_mem_r0_cs64__ud2_c64, }, /* 16-bit CS, except in LM. */ 4401 { false, false, BS3_SEL_SPARE_00, 64, true, bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2_c64, }, /* 16-bit CS, except in LM. */ 4388 { true, false, BS3_SEL_R0_CS32, 64, false, -1, bs3CpuBasic2_jmpf_ptr_same_r0__ud2_c32, }, 4389 { true, false, BS3_SEL_R1_CS32 | 1, 64, false, -1, bs3CpuBasic2_jmpf_ptr_same_r1__ud2_c32, }, 4390 { true, false, BS3_SEL_R2_CS32 | 2, 64, false, -1, bs3CpuBasic2_jmpf_ptr_same_r2__ud2_c32, }, 4391 { true, false, BS3_SEL_R3_CS32 | 3, 64, false, -1, bs3CpuBasic2_jmpf_ptr_same_r3__ud2_c32, }, 4392 { true, false, BS3_SEL_R0_CS16, 64, false, -1, bs3CpuBasic2_jmpf_ptr_opsize_flipbit_r0__ud2_c32, }, 4393 { true, false, BS3_SEL_R0_CS64, 64, false, -1, bs3CpuBasic2_jmpf_ptr_r0_cs64__ud2_c32, }, 4394 { true, false, BS3_SEL_SPARE_00, 64, false, -1, bs3CpuBasic2_jmpf_ptr_r0_cs16l__ud2_c32, }, 4395 4396 { true, true, BS3_SEL_R0_CS32, 64, false, -1, bs3CpuBasic2_callf_ptr_same_r0__ud2_c32, }, 4397 { true, true, BS3_SEL_R1_CS32 | 1, 64, false, -1, bs3CpuBasic2_callf_ptr_same_r1__ud2_c32, }, 4398 { true, true, BS3_SEL_R2_CS32 | 2, 64, false, -1, bs3CpuBasic2_callf_ptr_same_r2__ud2_c32, }, 4399 { true, true, BS3_SEL_R3_CS32 | 3, 64, false, -1, bs3CpuBasic2_callf_ptr_same_r3__ud2_c32, }, 4400 { true, true, BS3_SEL_R0_CS16, 64, false, -1, bs3CpuBasic2_callf_ptr_opsize_flipbit_r0__ud2_c32, }, 4401 { true, true, BS3_SEL_R0_CS64, 64, false, -1, bs3CpuBasic2_callf_ptr_r0_cs64__ud2_c32, }, 4402 { true, true, BS3_SEL_SPARE_00, 64, false, -1, bs3CpuBasic2_callf_ptr_r0_cs16l__ud2_c32, }, 4403 4404 { false, false, BS3_SEL_R0_CS64, 64, false, false, bs3CpuBasic2_jmpf_mem_same_r0__ud2_c64, }, 4405 { false, false, BS3_SEL_R1_CS64 | 1, 64, false, false, bs3CpuBasic2_jmpf_mem_same_r1__ud2_c64, }, 4406 { false, false, BS3_SEL_R2_CS64 | 2, 64, false, false, bs3CpuBasic2_jmpf_mem_same_r2__ud2_c64, }, 4407 { false, false, BS3_SEL_R3_CS64 | 3, 64, false, false, bs3CpuBasic2_jmpf_mem_same_r3__ud2_c64, }, 4408 { false, false, BS3_SEL_R0_CS16, 16, true, false, bs3CpuBasic2_jmpf_mem_r0_cs16__ud2_c64, }, 4409 { false, false, BS3_SEL_R0_CS32, 32, false, false, bs3CpuBasic2_jmpf_mem_r0_cs32__ud2_c64, }, 4410 { false, false, BS3_SEL_R0_CS64, 64, false, false, bs3CpuBasic2_jmpf_mem_r0_cs64__ud2_c64, }, /* 16-bit CS, except in LM. */ 4411 { false, false, BS3_SEL_SPARE_00, 64, true, false, bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2_c64, }, /* 16-bit CS, except in LM. */ 4412 4413 { false, false, BS3_SEL_R0_CS64, 64, false, true, bs3CpuBasic2_jmpf_mem_same_r0__ud2_intel_c64, }, 4414 { false, false, BS3_SEL_R1_CS64 | 1, 64, false, true, bs3CpuBasic2_jmpf_mem_same_r1__ud2_intel_c64, }, 4415 { false, false, BS3_SEL_R2_CS64 | 2, 64, false, true, bs3CpuBasic2_jmpf_mem_same_r2__ud2_intel_c64, }, 4416 { false, false, BS3_SEL_R3_CS64 | 3, 64, false, true, bs3CpuBasic2_jmpf_mem_same_r3__ud2_intel_c64, }, 4417 { false, false, BS3_SEL_R0_CS16, 16, true, true, bs3CpuBasic2_jmpf_mem_r0_cs16__ud2_intel_c64, }, 4418 { false, false, BS3_SEL_R0_CS32, 32, false, true, bs3CpuBasic2_jmpf_mem_r0_cs32__ud2_intel_c64, }, 4419 { false, false, BS3_SEL_R0_CS64, 64, false, true, bs3CpuBasic2_jmpf_mem_r0_cs64__ud2_intel_c64, }, /* 16-bit CS, except in LM. */ 4420 { false, false, BS3_SEL_SPARE_00, 64, true, true, bs3CpuBasic2_jmpf_mem_r0_cs16l__ud2_intel_c64, }, /* 16-bit CS, except in LM. */ 4402 4421 }; 4422 BS3CPUVENDOR const enmCpuVendor = Bs3GetCpuVendor(); 4423 bool const fFix64OpSize = enmCpuVendor == BS3CPUVENDOR_INTEL; /** @todo what does VIA do? */ 4403 4424 4404 4425 for (iTest = 0; iTest < RT_ELEMENTS(s_aTests); iTest++) … … 4408 4429 bool const fGp = !s_aTests[iTest].fCall && (s_aTests[iTest].uDstSel & X86_SEL_RPL) != 0; 4409 4430 uint8_t const BS3_FAR *fpbCode = Bs3SelLnkPtrToCurPtr(s_aTests[iTest].pfnTest); 4431 4432 if (s_aTests[iTest].fFix64OpSize != fFix64OpSize && s_aTests[iTest].fFix64OpSize >= 0) 4433 continue; 4410 4434 4411 4435 Ctx.rip.u = Bs3SelLnkPtrToFlat(s_aTests[iTest].pfnTest); … … 4414 4438 if (s_aTests[iTest].uDstBits == 16) 4415 4439 CtxExpected.rip.u &= UINT16_MAX; 4416 else if (s_aTests[iTest].uDstBits == 64 )4440 else if (s_aTests[iTest].uDstBits == 64 && fFix64OpSize) 4417 4441 CtxExpected.rip.u |= UINT64_C(0xfffff00000000000); 4418 4442
Note:
See TracChangeset
for help on using the changeset viewer.