Changeset 66134 in vbox
- Timestamp:
- Mar 16, 2017 3:45:31 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114037
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py ¶
r66127 r66134 304 304 for oOp in oInstr.aoOperands: 305 305 self.sEncoding += '_' + oOp.sType; 306 306 307 self.asFlags = []; 308 if 'invalid_64' in oInstr.dHints: 309 self.asFlags.append('BS3CG1INSTR_F_INVALID_64BIT') 310 307 311 self.fAdvanceMnemonic = True; ##< Set by the caller. 308 312 if self.sEncoding == 'ModR/M': … … 467 471 '{', 468 472 ]; 473 cOperands = 0; 469 474 for oInstr in self.aoInstructions: 470 asLines.append(' ' + oInstr.getOperands() + ','); 475 if oInstr.oInstr.aoOperands: 476 cOperands += len(oInstr.oInstr.aoOperands); 477 asLines.append(' ' + oInstr.getOperands() + ', /* %s */' % (oInstr.oInstr.sStats,)); 478 else: 479 asLines.append(' /* none */'); 480 if not cOperands: 481 asLines.append(' 0 /* dummy */'); 471 482 asLines += [ 472 483 '};', -
TabularUnified trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c ¶
r66124 r66134 646 646 break; 647 647 648 case BS3CG1ENC_FIXED: 649 if (iEncoding == 0) 650 { 651 off = Bs3Cg1InsertOpcodes(pThis, 0); 652 pThis->cbCurInstr = off; 653 iEncoding++; 654 } 655 break; 656 648 657 case BS3CG1ENC_FIXED_AL_Ib: 649 658 if (iEncoding == 0) … … 822 831 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX; 823 832 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 833 break; 834 835 case BS3CG1ENC_FIXED: 836 /* nothing to do here */ 824 837 break; 825 838 … … 1290 1303 unsigned iEncoding; 1291 1304 unsigned iEncodingNext; 1305 bool fInvalidInstr = false; 1306 uint8_t bXcptExpected = BS3_MODE_IS_PAGED(bMode) ? X86_XCPT_PF : X86_XCPT_UD; 1292 1307 1293 1308 /* … … 1322 1337 } 1323 1338 1339 if ((This.fFlags & BS3CG1INSTR_F_INVALID_64BIT) && BS3_MODE_IS_64BIT_CODE(bMode)) 1340 { 1341 fInvalidInstr = true; 1342 bXcptExpected = X86_XCPT_UD; 1343 } 1344 1324 1345 /* 1325 1346 * Prep the operands and encoding handling. … … 1383 1404 1384 1405 /* Check the control exception result first. */ 1385 if ( This.TrapFrame.bXcpt == (BS3_MODE_IS_PAGED(bMode) ? X86_XCPT_PF : X86_XCPT_UD)1386 && This.TrapFrame.Ctx.rip.u == This.Ctx.rip.u + This.cbCurInstr)1406 if ( This.TrapFrame.bXcpt == bXcptExpected 1407 && This.TrapFrame.Ctx.rip.u == This.Ctx.rip.u + (!fInvalidInstr ? This.cbCurInstr : 0)) 1387 1408 { 1388 1409 /* Apply output modifications and compare the contexts. */ 1389 if ( BS3_MODE_IS_PAGED(bMode))1410 if (bXcptExpected == X86_XCPT_PF) 1390 1411 This.Ctx.cr2.u = This.uCodePgFlat + X86_PAGE_SIZE; 1391 1412 This.Ctx.rflags.u32 &= ~X86_EFL_RF; 1392 1413 This.Ctx.rflags.u32 |= This.TrapFrame.Ctx.rflags.u32 & X86_EFL_RF; 1393 if (Bs3Cg1RunContextModifier(&This, &This.Ctx, pHdr, 1394 pHdr->cbSelector + pHdr->cbInput, pHdr->cbOutput, 1395 &This.TrapFrame.Ctx, NULL /*pbCode*/)) 1414 if ( fInvalidInstr 1415 || Bs3Cg1RunContextModifier(&This, &This.Ctx, pHdr, 1416 pHdr->cbSelector + pHdr->cbInput, pHdr->cbOutput, 1417 &This.TrapFrame.Ctx, NULL /*pbCode*/)) 1396 1418 { 1397 if (!Bs3TestCheckRegCtxEx(&This.TrapFrame.Ctx, &This.Ctx, This.cbCurInstr, 0 /*cbSpAdjust*/, 1419 if (!Bs3TestCheckRegCtxEx(&This.TrapFrame.Ctx, &This.Ctx, 1420 !fInvalidInstr ? This.cbCurInstr : 0, 0 /*cbSpAdjust*/, 1398 1421 0 /*fExtraEfl*/, pszMode, iEncoding)) 1399 1422 Bs3TestFailedF("encoding#%u: %.*Rhxs", iEncoding, This.cbCurInstr, This.abCurInstr); … … 1402 1425 else 1403 1426 { 1404 Bs3TestFailedF("bXcpt=%#x expected %#x; rip=%RX64 expected %RX64; encoding# u: %.*Rhxs",1405 This.TrapFrame.bXcpt, BS3_MODE_IS_PAGED(bMode) ? X86_XCPT_PF : X86_XCPT_UD,1406 This.TrapFrame.Ctx.rip.u, This.Ctx.rip.u + This.cbCurInstr,1427 Bs3TestFailedF("bXcpt=%#x expected %#x; rip=%RX64 expected %RX64; encoding#%u: %.*Rhxs", 1428 This.TrapFrame.bXcpt, bXcptExpected, 1429 This.TrapFrame.Ctx.rip.u, This.Ctx.rip.u + (!fInvalidInstr ? This.cbCurInstr : 0), 1407 1430 iEncoding, This.cbCurInstr, This.abCurInstr); 1408 1431 } -
TabularUnified trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h ¶
r66116 r66134 76 76 BS3CG1ENC_MODRM_Gv_Ev, 77 77 78 BS3CG1ENC_FIXED, 78 79 BS3CG1ENC_FIXED_AL_Ib, 79 80 BS3CG1ENC_FIXED_rAX_Iz, … … 130 131 /** Defaults to SS rather than DS. */ 131 132 #define BS3CG1INSTR_F_DEF_SS UINT32_C(0x00000001) 133 /** Invalid instruction in 64-bit mode. */ 134 #define BS3CG1INSTR_F_INVALID_64BIT UINT32_C(0x00000002) 132 135 /** @} */ 133 136
Note:
See TracChangeset
for help on using the changeset viewer.