Changeset 41336 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 16, 2012 12:56:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r41335 r41336 971 971 /* Fall back to rdtsc emulation as we would otherwise pass decreasing tsc values to the guest. */ 972 972 LogFlow(("TSC %RX64 offset %RX64 time=%RX64 last=%RX64 (diff=%RX64, virt_tsc=%RX64)\n", u64CurTSC, 973 pVMCB->ctrl.u64TSCOffset, u64CurTSC + pVMCB->ctrl.u64TSCOffset, TMCpuTickGetLastSeen(pVCpu), TMCpuTickGetLastSeen(pVCpu) - u64CurTSC - pVMCB->ctrl.u64TSCOffset, TMCpuTickGet(pVCpu))); 973 pVMCB->ctrl.u64TSCOffset, u64CurTSC + pVMCB->ctrl.u64TSCOffset, TMCpuTickGetLastSeen(pVCpu), 974 TMCpuTickGetLastSeen(pVCpu) - u64CurTSC - pVMCB->ctrl.u64TSCOffset, TMCpuTickGet(pVCpu))); 974 975 pVMCB->ctrl.u32InterceptCtrl1 |= SVM_CTRL1_INTERCEPT_RDTSC; 975 976 pVMCB->ctrl.u32InterceptCtrl2 |= SVM_CTRL2_INTERCEPT_RDTSCP; … … 1362 1363 else 1363 1364 { 1364 pVMCB->ctrl.IntCtrl.n.u8VTPR = (u8LastTPR >> 4); /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 1365 /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 1366 pVMCB->ctrl.IntCtrl.n.u8VTPR = (u8LastTPR >> 4); 1365 1367 1366 1368 if (fPending) … … 1392 1394 { 1393 1395 if (pVCpu->hwaccm.s.idLastCpu != pCpu->idCpu) 1394 LogFlow(("Force TLB flush due to rescheduling to a different cpu (%d vs %d)\n", pVCpu->hwaccm.s.idLastCpu, pCpu->idCpu)); 1396 { 1397 LogFlow(("Force TLB flush due to rescheduling to a different cpu (%d vs %d)\n", pVCpu->hwaccm.s.idLastCpu, 1398 pCpu->idCpu)); 1399 } 1395 1400 else 1396 LogFlow(("Force TLB flush due to changed TLB flush count (%x vs %x)\n", pVCpu->hwaccm.s.cTLBFlushes, pCpu->cTLBFlushes)); 1401 { 1402 LogFlow(("Force TLB flush due to changed TLB flush count (%x vs %x)\n", pVCpu->hwaccm.s.cTLBFlushes, 1403 pCpu->cTLBFlushes)); 1404 } 1397 1405 } 1398 1406 else if (VMCPU_FF_ISSET(pVCpu, VMCPU_FF_TLB_FLUSH)) … … 1447 1455 TMNotifyStartOfExecution(pVCpu); 1448 1456 #ifdef VBOX_WITH_KERNEL_USING_XMM 1449 hwaccmR0SVMRunWrapXMM(pVCpu->hwaccm.s.svm.pVMCBHostPhys, pVCpu->hwaccm.s.svm.pVMCBPhys, pCtx, pVM, pVCpu, pVCpu->hwaccm.s.svm.pfnVMRun); 1457 hwaccmR0SVMRunWrapXMM(pVCpu->hwaccm.s.svm.pVMCBHostPhys, pVCpu->hwaccm.s.svm.pVMCBPhys, pCtx, pVM, pVCpu, 1458 pVCpu->hwaccm.s.svm.pfnVMRun); 1450 1459 #else 1451 1460 pVCpu->hwaccm.s.svm.pfnVMRun(pVCpu->hwaccm.s.svm.pVMCBHostPhys, pVCpu->hwaccm.s.svm.pVMCBPhys, pCtx, pVM, pVCpu); … … 1455 1464 /* Possibly the last TSC value seen by the guest (too high) (only when we're in TSC offset mode). */ 1456 1465 if (!(pVMCB->ctrl.u32InterceptCtrl1 & SVM_CTRL1_INTERCEPT_RDTSC)) 1457 TMCpuTickSetLastSeen(pVCpu, ASMReadTSC() + pVMCB->ctrl.u64TSCOffset - 0x400 /* guestimate of world switch overhead in clock ticks */); 1466 { 1467 TMCpuTickSetLastSeen(pVCpu, ASMReadTSC() + 1468 pVMCB->ctrl.u64TSCOffset - 0x400 /* guestimate of world switch overhead in clock ticks */); 1469 } 1458 1470 TMNotifyEndOfExecution(pVCpu); 1459 1471 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED); … … 1466 1478 /* 1467 1479 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1468 * IMPORTANT: WE CAN'T DO ANY LOGGING OR OPERATIONS THAT CAN DO A LONGJMP BACK TO RING 1480 * IMPORTANT: WE CAN'T DO ANY LOGGING OR OPERATIONS THAT CAN DO A LONGJMP BACK TO RING-3 *BEFORE* WE'VE SYNCED BACK (MOST OF) THE GUEST STATE 1469 1481 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1470 1482 */ … … 2521 2533 goto ResumeExecution; 2522 2534 } 2523 Log2(("EM status from IO at %RGv %x size %d: %Rrc\n", (RTGCPTR)pCtx->rip, IoExitInfo.n.u16Port, uIOSize, VBOXSTRICTRC_VAL(rc))); 2535 Log2(("EM status from IO at %RGv %x size %d: %Rrc\n", (RTGCPTR)pCtx->rip, IoExitInfo.n.u16Port, uIOSize, 2536 VBOXSTRICTRC_VAL(rc))); 2524 2537 break; 2525 2538 } … … 2531 2544 Assert(IoExitInfo.n.u1Type == 0); 2532 2545 else 2533 AssertMsg(RT_FAILURE(rc) || rc == VINF_EM_RAW_EMULATE_INSTR || rc == VINF_EM_RAW_GUEST_TRAP || rc == VINF_TRPM_XCPT_DISPATCHED, ("%Rrc\n", VBOXSTRICTRC_VAL(rc))); 2546 { 2547 AssertMsg( RT_FAILURE(rc) 2548 || rc == VINF_EM_RAW_EMULATE_INSTR 2549 || rc == VINF_EM_RAW_GUEST_TRAP 2550 || rc == VINF_TRPM_XCPT_DISPATCHED, ("%Rrc\n", VBOXSTRICTRC_VAL(rc))); 2551 } 2534 2552 #endif 2535 2553 Log2(("Failed IO at %RGv %x size %d\n", (RTGCPTR)pCtx->rip, IoExitInfo.n.u16Port, uIOSize)); … … 2650 2668 goto ResumeExecution; 2651 2669 } 2652 AssertMsg(rc == VERR_EM_INTERPRETER, ("EMU: %s failed with %Rrc\n", (pVMCB->ctrl.u64ExitInfo1 == 0) ? "rdmsr" : "wrmsr", VBOXSTRICTRC_VAL(rc))); 2670 AssertMsg(rc == VERR_EM_INTERPRETER, ("EMU: %s failed with %Rrc\n", (pVMCB->ctrl.u64ExitInfo1 == 0) ? "rdmsr" : "wrmsr", 2671 VBOXSTRICTRC_VAL(rc))); 2653 2672 break; 2654 2673 } … … 3072 3091 * @param paParam Array of 32-bit parameters. 3073 3092 */ 3074 VMMR0DECL(int) SVMR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTRCPTR pfnHandler, uint32_t cbParam, uint32_t *paParam) 3093 VMMR0DECL(int) SVMR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTRCPTR pfnHandler, uint32_t cbParam, 3094 uint32_t *paParam) 3075 3095 { 3076 3096 int rc;
Note:
See TracChangeset
for help on using the changeset viewer.