Changeset 72689 in vbox
- Timestamp:
- Jun 26, 2018 2:37:40 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123206
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r72676 r72689 1571 1571 { 1572 1572 pVCpu->cpum.s.Guest.dr[6] = uDr6; 1573 pVCpu->cpum.s.Guest.fExtrn &= ~CPUMCTX_EXTRN_DR6; 1573 1574 return VINF_SUCCESS; /* No need to recalc. */ 1574 1575 } … … 1578 1579 { 1579 1580 pVCpu->cpum.s.Guest.dr[7] = uDr7; 1581 pVCpu->cpum.s.Guest.fExtrn &= ~CPUMCTX_EXTRN_DR7; 1580 1582 return CPUMRecalcHyperDRx(pVCpu, 7, false); 1581 1583 } -
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r72687 r72689 3723 3723 3724 3724 3725 #ifdef IN_RING0 3726 /** 3727 * Perform an I/O control operation on the partition handle (VID.SYS), 3728 * restarting on alert-like behaviour. 3729 * 3730 * @returns NT status code. 3731 * @param pGVM The ring-0 VM structure. 3732 * @param pGVCpu The ring-0 CPU structure. 3733 * @param pVCpu The calling cross context CPU structure. 3734 * @param fFlags The wait flags. 3735 * @param cMillies The timeout in milliseconds 3736 */ 3737 static NTSTATUS nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(PGVM pGVM, PGVMCPU pGVCpu, PVMCPU pVCpu, 3738 uint32_t fFlags, uint32_t cMillies) 3739 { 3740 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu = pGVCpu->idCpu; 3741 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = fFlags; 3742 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies; 3743 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nem.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 3744 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 3745 sizeof(pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext), 3746 NULL, 0); 3747 if (rcNt == STATUS_SUCCESS) 3748 { /* likely */ } 3749 /* 3750 * Generally, if we get down here, we have been interrupted between ACK'ing 3751 * a message and waiting for the next due to a NtAlertThread call. So, we 3752 * should stop ACK'ing the previous message and get on waiting on the next. 3753 * See similar stuff in nemHCWinRunGC(). 3754 */ 3755 else if ( rcNt == STATUS_TIMEOUT 3756 || rcNt == STATUS_ALERTED /* just in case */ 3757 || rcNt == STATUS_KERNEL_APC /* just in case */ 3758 || rcNt == STATUS_USER_APC /* just in case */) 3759 { 3760 DBGFTRACE_CUSTOM(pVCpu->CTX_SUFF(pVM), "IoCtlMessageSlotHandleAndGetNextRestart/1 %#x (f=%#x)", rcNt, fFlags); 3761 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatStopCpuPendingOdd); 3762 Assert(fFlags & VID_MSHAGN_F_GET_NEXT_MESSAGE); 3763 3764 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu = pVCpu->idCpu; 3765 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = fFlags & ~VID_MSHAGN_F_HANDLE_MESSAGE; 3766 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies; 3767 rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nem.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 3768 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 3769 sizeof(pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext), 3770 NULL, 0); 3771 DBGFTRACE_CUSTOM(pVCpu->CTX_SUFF(pVM), "IoCtlMessageSlotHandleAndGetNextRestart/2 %#x", rcNt); 3772 } 3773 return rcNt; 3774 } 3775 3776 #endif /* IN_RING0 */ 3777 3778 3725 3779 #ifdef NEM_WIN_USE_OUR_OWN_RUN_API 3726 3780 /** … … 3799 3853 */ 3800 3854 # ifdef IN_RING0 3801 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu = pGVCpu->idCpu; 3802 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = VID_MSHAGN_F_GET_NEXT_MESSAGE; 3803 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = 30000; /*ms*/ 3804 rcNt = nemR0NtPerformIoControlRestart(pGVM, pGVM->nem.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 3805 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 3806 sizeof(pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext)); 3855 rcNt = nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(pGVM, pGVCpu, pVCpu, VID_MSHAGN_F_GET_NEXT_MESSAGE, 30000 /*ms*/); 3807 3856 DBGFTRACE_CUSTOM(pVM, "nemStop#1: %#x / %#x %#x %#x", rcNt, pMappingHeader->enmVidMsgType, pMappingHeader->cbMessage, 3808 3857 pMsgForTrace->Header.MessageType); … … 3832 3881 */ 3833 3882 # ifdef IN_RING0 3834 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu = pGVCpu->idCpu; 3835 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = VID_MSHAGN_F_HANDLE_MESSAGE | VID_MSHAGN_F_GET_NEXT_MESSAGE; 3836 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = 30000; /*ms*/ 3837 rcNt = nemR0NtPerformIoControlRestart(pGVM, pGVM->nem.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 3838 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 3839 sizeof(pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext)); 3883 rcNt = nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(pGVM, pGVCpu, pVCpu, 3884 VID_MSHAGN_F_HANDLE_MESSAGE | VID_MSHAGN_F_GET_NEXT_MESSAGE, 3885 30000 /*ms*/); 3840 3886 DBGFTRACE_CUSTOM(pVM, "nemStop#2: %#x / %#x %#x %#x", rcNt, pMappingHeader->enmVidMsgType, pMappingHeader->cbMessage, 3841 3887 pMsgForTrace->Header.MessageType); … … 3863 3909 */ 3864 3910 # ifdef IN_RING0 3865 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu = pGVCpu->idCpu; 3866 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = VID_MSHAGN_F_HANDLE_MESSAGE; 3867 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = 30000; /*ms*/ 3868 rcNt = nemR0NtPerformIoControlRestart(pGVM, pGVM->nem.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 3869 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 3870 sizeof(pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext)); 3911 rcNt = nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(pGVM, pGVCpu, pVCpu, VID_MSHAGN_F_HANDLE_MESSAGE, 30000 /*ms*/); 3871 3912 DBGFTRACE_CUSTOM(pVM, "nemStop#3: %#x / %#x %#x %#x", rcNt, pMappingHeader->enmVidMsgType, 3872 3913 pMsgForTrace->Header.MessageType, pMappingHeader->cbMessage, pMsgForTrace->Header.MessageType); … … 4214 4255 LogFlow(("NEM/%u: VidMessageSlotHandleAndGetNext -> %#x\n", pVCpu->idCpu, rcNt)); 4215 4256 AssertLogRelMsgReturn( rcNt == STATUS_TIMEOUT 4216 || rcNt == STATUS_ALERTED /* just in case */ 4217 || rcNt == STATUS_USER_APC /* ditto */ 4257 || rcNt == STATUS_ALERTED /* just in case */ 4258 || rcNt == STATUS_USER_APC /* ditto */ 4259 || rcNt == STATUS_KERNEL_APC /* ditto */ 4218 4260 , ("VidMessageSlotHandleAndGetNext failed for CPU #%u: %#x (%u)\n", 4219 4261 pVCpu->idCpu, rcNt, rcNt), … … 4225 4267 pVCpu->idCpu, hrc, GetLastError()), 4226 4268 VERR_NEM_IPE_0); 4227 4228 4269 # endif 4229 4270 } -
trunk/src/VBox/VMM/VMMR0/NEMR0Native-win.cpp
r72687 r72689 88 88 DECLINLINE(NTSTATUS) nemR0NtPerformIoControl(PGVM pGVM, uint32_t uFunction, void *pvInput, uint32_t cbInput, 89 89 void *pvOutput, uint32_t cbOutput); 90 DECLINLINE(NTSTATUS) nemR0NtPerformIoControlRestart(PGVM pGVM, uint32_t uFunction, void *pvInput, uint32_t cbInput);91 90 92 91 … … 271 270 272 271 /** 273 * Perform an I/O control operation on the partition handle (VID.SYS),274 * restarting on alert-like behaviour.275 *276 * @returns NT status code.277 * @param pGVM The ring-0 VM structure.278 * @param uFunction The function to perform.279 * @param pvInput The input buffer. This must point within the VM280 * structure so we can easily convert to a ring-3281 * pointer if necessary.282 * @param cbInput The size of the input. @a pvInput must be NULL when283 * zero.284 */285 DECLINLINE(NTSTATUS) nemR0NtPerformIoControlRestart(PGVM pGVM, uint32_t uFunction, void *pvInput, uint32_t cbInput)286 {287 #ifdef RT_STRICT288 /*289 * Input and output parameters are part of the VM CPU structure.290 */291 PVM pVM = pGVM->pVM;292 size_t const cbVM = RT_UOFFSETOF(VM, aCpus[pGVM->cCpus]);293 if (pvInput)294 AssertReturn(((uintptr_t)pvInput + cbInput) - (uintptr_t)pVM <= cbVM, VERR_INVALID_PARAMETER);295 #endif296 297 int32_t rcNt = STATUS_UNSUCCESSFUL;298 int rc = SUPR0IoCtlPerform(pGVM->nem.s.pIoCtlCtx, uFunction,299 pvInput,300 pvInput ? (uintptr_t)pvInput + pGVM->nem.s.offRing3ConversionDelta : NIL_RTR3PTR,301 cbInput,302 NULL,303 NIL_RTR3PTR,304 0,305 &rcNt);306 if (RT_SUCCESS(rc) || !NT_SUCCESS((NTSTATUS)rcNt))307 {308 if (RT_LIKELY(rcNt == STATUS_SUCCESS))309 return rcNt;310 311 if ( rcNt == STATUS_TIMEOUT312 || rcNt == STATUS_ALERTED)313 {314 DBGFTRACE_CUSTOM(pVM, "nemR0NtPerformIoControlRestart/1 %#x", rcNt);315 rcNt = STATUS_UNSUCCESSFUL;316 rc = SUPR0IoCtlPerform(pGVM->nem.s.pIoCtlCtx, uFunction,317 pvInput,318 pvInput ? (uintptr_t)pvInput + pGVM->nem.s.offRing3ConversionDelta : NIL_RTR3PTR,319 cbInput,320 NULL,321 NIL_RTR3PTR,322 0,323 &rcNt);324 if (!RT_SUCCESS(rc) && NT_SUCCESS((NTSTATUS)rcNt))325 rcNt = STATUS_UNSUCCESSFUL;326 DBGFTRACE_CUSTOM(pVM, "nemR0NtPerformIoControlRestart/2 %#x", rcNt);327 }328 return (NTSTATUS)rcNt;329 }330 return STATUS_UNSUCCESSFUL;331 }332 333 334 /**335 272 * 2nd part of the initialization, after we've got a partition handle. 336 273 * … … 1810 1747 /* Debug registers. */ 1811 1748 /** @todo fixme */ 1749 /** @todo There are recalc issues here. Recalc will get register content and 1750 * that may assert since we doesn't clear CPUMCTX_EXTRN_ until the end. */ 1812 1751 if (fWhat & CPUMCTX_EXTRN_DR0_DR3) 1813 1752 {
Note:
See TracChangeset
for help on using the changeset viewer.