Changeset 41985 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jul 2, 2012 3:00:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/VMMTests.cpp
r41965 r41985 43 43 #include <iprt/x86.h> 44 44 45 static void vmmR3TestClearStack(PVMCPU pVCpu) 46 { 47 /* We leave the first 64 bytes of the stack alone because of strict 48 ring-0 long jump code uses it. */ 49 memset(pVCpu->vmm.s.pbEMTStackR3 + 64, 0xaa, VMM_STACK_SIZE - 64); 50 } 51 45 52 46 53 /** … … 61 68 return rc; 62 69 63 memset(pVCpu->vmm.s.pbEMTStackR3, 0xaa, VMM_STACK_SIZE);64 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */70 CPUMSetHyperState(pVCpu, pVM->vmm.s.pfnCallTrampolineRC, pVCpu->vmm.s.pbEMTStackBottomRC, 0, 0); 71 vmmR3TestClearStack(pVCpu); 65 72 CPUMPushHyper(pVCpu, uVariation); 66 73 CPUMPushHyper(pVCpu, enmTestcase); … … 68 75 CPUMPushHyper(pVCpu, 3 * sizeof(RTRCPTR)); /* stack frame size */ 69 76 CPUMPushHyper(pVCpu, RCPtrEP); /* what to call */ 70 CPUMSetHyperEIP(pVCpu, pVM->vmm.s.pfnCallTrampolineRC);71 77 Assert(CPUMGetHyperCR3(pVCpu) && CPUMGetHyperCR3(pVCpu) == PGMGetHyperCR3(pVCpu)); 72 78 rc = SUPR3CallVMMR0Fast(pVM->pVMR0, VMMR0_DO_RAW_RUN, 0); … … 100 106 return rc; 101 107 102 memset(pVCpu->vmm.s.pbEMTStackR3, 0xaa, VMM_STACK_SIZE);103 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */108 CPUMSetHyperState(pVCpu, pVM->vmm.s.pfnCallTrampolineRC, pVCpu->vmm.s.pbEMTStackBottomRC, 0, 0); 109 vmmR3TestClearStack(pVCpu); 104 110 CPUMPushHyper(pVCpu, uVariation); 105 111 CPUMPushHyper(pVCpu, u8Trap + VMMGC_DO_TESTCASE_TRAP_FIRST); … … 107 113 CPUMPushHyper(pVCpu, 3 * sizeof(RTRCPTR)); /* stack frame size */ 108 114 CPUMPushHyper(pVCpu, RCPtrEP); /* what to call */ 109 CPUMSetHyperEIP(pVCpu, pVM->vmm.s.pfnCallTrampolineRC);110 115 Assert(CPUMGetHyperCR3(pVCpu) && CPUMGetHyperCR3(pVCpu) == PGMGetHyperCR3(pVCpu)); 111 116 rc = SUPR3CallVMMR0Fast(pVM->pVMR0, VMMR0_DO_RAW_RUN, 0); … … 221 226 vmmR3DoTrapTest(pVM, 0xe, 1, VERR_TRPM_DONT_PANIC, 0x00000000, "vmmGCTestTrap0e_FaultEIP", "#PF (NULL) WP"); 222 227 vmmR3DoTrapTest(pVM, 0xe, 2, VINF_SUCCESS, 0x00000000, NULL, "#PF w/Tmp Handler"); 228 /* This test is no longer relevant as fs and gs are loaded with NULL 229 selectors and we will always return to HC if a #GP occurs while 230 returning to guest code. 223 231 vmmR3DoTrapTest(pVM, 0xe, 4, VINF_SUCCESS, 0x00000000, NULL, "#PF w/Tmp Handler and bad fs"); 232 */ 224 233 225 234 /* … … 266 275 if (rc != VINF_SUCCESS) 267 276 { 268 RTPrintf("VMM: failed to resume on hyper breakpoint, rc=%Rrc \n", rc);277 RTPrintf("VMM: failed to resume on hyper breakpoint, rc=%Rrc = KNOWN BUG\n", rc); /** @todo fix VMMR3ResumeHyper */ 269 278 return rc; 270 279 } … … 337 346 * Interrupt forwarding. 338 347 */ 339 CPUMSetHyper ESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */348 CPUMSetHyperState(pVCpu, pVM->vmm.s.pfnCallTrampolineRC, pVCpu->vmm.s.pbEMTStackBottomRC, 0, 0); 340 349 CPUMPushHyper(pVCpu, 0); 341 350 CPUMPushHyper(pVCpu, VMMGC_DO_TESTCASE_HYPER_INTERRUPT); … … 343 352 CPUMPushHyper(pVCpu, 3 * sizeof(RTRCPTR)); /* stack frame size */ 344 353 CPUMPushHyper(pVCpu, RCPtrEP); /* what to call */ 345 CPUMSetHyperEIP(pVCpu, pVM->vmm.s.pfnCallTrampolineRC);346 354 Log(("trampoline=%x\n", pVM->vmm.s.pfnCallTrampolineRC)); 347 355 … … 400 408 for (i = 0; i < 1000000; i++) 401 409 { 402 CPUMSetHyper ESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */410 CPUMSetHyperState(pVCpu, pVM->vmm.s.pfnCallTrampolineRC, pVCpu->vmm.s.pbEMTStackBottomRC, 0, 0); 403 411 CPUMPushHyper(pVCpu, 0); 404 412 CPUMPushHyper(pVCpu, VMMGC_DO_TESTCASE_NOP); … … 406 414 CPUMPushHyper(pVCpu, 3 * sizeof(RTRCPTR)); /* stack frame size */ 407 415 CPUMPushHyper(pVCpu, RCPtrEP); /* what to call */ 408 CPUMSetHyperEIP(pVCpu, pVM->vmm.s.pfnCallTrampolineRC);409 416 410 417 uint64_t TickThisStart = ASMReadTSC(); … … 533 540 for (i = 0; i < 1000000; i++) 534 541 { 535 CPUMSetHyper ESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */542 CPUMSetHyperState(pVCpu, pVM->vmm.s.pfnCallTrampolineRC, pVCpu->vmm.s.pbEMTStackBottomRC, 0, 0); 536 543 CPUMPushHyper(pVCpu, 0); 537 544 CPUMPushHyper(pVCpu, VMMGC_DO_TESTCASE_HWACCM_NOP); … … 539 546 CPUMPushHyper(pVCpu, 3 * sizeof(RTRCPTR)); /* stack frame size */ 540 547 CPUMPushHyper(pVCpu, RCPtrEP); /* what to call */ 541 CPUMSetHyperEIP(pVCpu, pVM->vmm.s.pfnCallTrampolineRC);542 548 543 549 pHyperCtx = CPUMGetHyperCtxPtr(pVCpu);
Note:
See TracChangeset
for help on using the changeset viewer.