Changeset 60296 in vbox for trunk/src/VBox/ValidationKit/bootsectors
- Timestamp:
- Apr 3, 2016 3:26:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
r60295 r60296 489 489 BS3_DATA_NM(Bs3GdteTestPage00) = BS3_DATA_NM(Bs3Gdt)[uSysR0Cs >> X86_SEL_SHIFT]; 490 490 BS3_DATA_NM(Bs3GdteTestPage00).Gen.u1Present = 0; 491 BS3_DATA_NM(Bs3GdteTestPage00).Gen.u4Type &= ~X86_SEL_TYPE_ACCESSED; 491 492 paIdt[0x80 << cIdteShift].Gate.u16Sel = BS3_SEL_TEST_PAGE_00; 492 493 … … 494 495 Bs3TrapSetJmpAndRestore(&Ctx80, &TrapCtx); 495 496 bs3CpuBasic2_CompareNpCtx(&TrapCtx, &Ctx80, BS3_SEL_TEST_PAGE_00); 497 if (BS3_DATA_NM(Bs3GdteTestPage00).Gen.u4Type & X86_SEL_TYPE_ACCESSED) 498 bs3CpuBasic2_FailedF("selector was accessed"); 496 499 g_uLine++; 497 500 … … 503 506 Bs3TrapSetJmpAndRestore(&CtxTmp, &TrapCtx); 504 507 bs3CpuBasic2_CompareGpCtx(&TrapCtx, &CtxTmp, (0x80 << X86_TRAP_ERR_SEL_SHIFT) | X86_TRAP_ERR_IDT); 508 if (BS3_DATA_NM(Bs3GdteTestPage00).Gen.u4Type & X86_SEL_TYPE_ACCESSED) 509 bs3CpuBasic2_FailedF("selector was accessed"); 505 510 g_uLine++; 506 511 } 507 512 508 513 /* CS.DPL mismatch takes precedence over CS.PRESENT = 0. */ 514 BS3_DATA_NM(Bs3GdteTestPage00).Gen.u4Type &= ~X86_SEL_TYPE_ACCESSED; 509 515 Bs3TrapSetJmpAndRestore(&Ctx80, &TrapCtx); 510 516 bs3CpuBasic2_CompareNpCtx(&TrapCtx, &Ctx80, BS3_SEL_TEST_PAGE_00); 517 if (BS3_DATA_NM(Bs3GdteTestPage00).Gen.u4Type & X86_SEL_TYPE_ACCESSED) 518 bs3CpuBasic2_FailedF("CS selector was accessed"); 511 519 g_uLine++; 512 520 for (iDpl = 1; iDpl < 4; iDpl++) … … 515 523 Bs3TrapSetJmpAndRestore(&Ctx80, &TrapCtx); 516 524 bs3CpuBasic2_CompareGpCtx(&TrapCtx, &Ctx80, BS3_SEL_TEST_PAGE_00); 525 if (BS3_DATA_NM(Bs3GdteTestPage00).Gen.u4Type & X86_SEL_TYPE_ACCESSED) 526 bs3CpuBasic2_FailedF("CS selector was accessed"); 517 527 g_uLine++; 518 528 } … … 540 550 } 541 551 552 /* Fix CS again. */ 553 BS3_DATA_NM(Bs3GdteTestPage00) = BS3_DATA_NM(Bs3Gdt)[uSysR0Cs >> X86_SEL_SHIFT]; 554 542 555 /* Test SS. */ 543 556 if (!BS3_MODE_IS_64BIT_SYS(g_bTestMode)) … … 547 560 X86DESC const SavedGate83 = paIdt[0x83 << cIdteShift]; 548 561 549 /* Fix CS again. */550 BS3_DATA_NM(Bs3GdteTestPage00) = BS3_DATA_NM(Bs3Gdt)[uSysR0Cs >> X86_SEL_SHIFT];551 552 562 /* Make the handler execute in ring-2. */ 553 563 BS3_DATA_NM(Bs3GdteTestPage02) = BS3_DATA_NM(Bs3Gdt)[(uSysR0Cs + (2 << BS3_SEL_RING_SHIFT)) >> X86_SEL_SHIFT]; 564 BS3_DATA_NM(Bs3GdteTestPage02).Gen.u4Type &= ~X86_SEL_TYPE_ACCESSED; 554 565 paIdt[0x83 << cIdteShift].Gate.u16Sel = BS3_SEL_TEST_PAGE_02 | 2; 555 566 … … 558 569 Bs3TrapSetJmpAndRestore(&CtxTmp, &TrapCtx); 559 570 bs3CpuBasic2_CompareIntCtx1(&TrapCtx, &CtxTmp, 0x83); 571 if (!(BS3_DATA_NM(Bs3GdteTestPage02).Gen.u4Type & X86_SEL_TYPE_ACCESSED)) 572 bs3CpuBasic2_FailedF("CS selector was not access"); 560 573 g_uLine++; 561 574 … … 601 614 { 602 615 *puTssSs2 = BS3_SEL_TEST_PAGE_03 | iRpl; 616 BS3_DATA_NM(Bs3GdteTestPage02).Gen.u4Type &= ~X86_SEL_TYPE_ACCESSED; 617 BS3_DATA_NM(Bs3GdteTestPage03).Gen.u4Type &= ~X86_SEL_TYPE_ACCESSED; 603 618 Bs3TrapSetJmpAndRestore(&CtxTmp, &TrapCtx); 604 619 if (iRpl != 2 || iRpl != iDpl || k >= 4) … … 612 627 bs3CpuBasic2_FailedF("uHandlerSs=%#x expected %#x\n", TrapCtx.uHandlerSs, BS3_SEL_TEST_PAGE_03 | 2); 613 628 } 629 if (!(BS3_DATA_NM(Bs3GdteTestPage02).Gen.u4Type & X86_SEL_TYPE_ACCESSED)) 630 bs3CpuBasic2_FailedF("CS selector was not access"); 631 if ( TrapCtx.bXcpt == 0x83 632 || (TrapCtx.bXcpt == X86_XCPT_SS && k == 2) ) 633 { 634 if (!(BS3_DATA_NM(Bs3GdteTestPage03).Gen.u4Type & X86_SEL_TYPE_ACCESSED)) 635 bs3CpuBasic2_FailedF("SS selector was not accessed"); 636 } 637 else if (BS3_DATA_NM(Bs3GdteTestPage03).Gen.u4Type & X86_SEL_TYPE_ACCESSED) 638 bs3CpuBasic2_FailedF("SS selector was accessed"); 614 639 g_uLine++; 615 640
Note:
See TracChangeset
for help on using the changeset viewer.