Changeset 72262 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- May 18, 2018 2:10:08 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r72255 r72262 1422 1422 1423 1423 /* 1424 * Whatever we do, we must clear pending event ejection upon resume.1424 * Whatever we do, we must clear pending event injection upon resume. 1425 1425 */ 1426 1426 if (pMsg->Header.ExecutionState.InterruptionPending) … … 1562 1562 1563 1563 /** 1564 * Deals with CPUID intercept message. 1565 * 1566 * @returns Strict VBox status code. 1567 * @param pVCpu The cross context per CPU structure. 1568 * @param pMsg The message. 1569 * @param pCtx The register context. 1570 */ 1571 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageCpuId(PVMCPU pVCpu, HV_X64_CPUID_INTERCEPT_MESSAGE const *pMsg, PCPUMCTX pCtx) 1572 { 1573 //Assert( pMsg->AccessInfo.AccessSize == 1 1574 // || pMsg->AccessInfo.AccessSize == 2 1575 // || pMsg->AccessInfo.AccessSize == 4); 1576 //Assert( pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_READ 1577 // || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE); 1578 AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength)); 1579 1580 /* 1581 * Soak up state and execute the instruction. 1582 * 1583 * Note! If this grows slightly more complicated, combine into an IEMExecDecodedCpuId 1584 * function and make everyone use it. 1585 */ 1586 /** @todo Combine implementations into IEMExecDecodedCpuId as this will 1587 * only get weirder with nested VT-x and AMD-V support. */ 1588 nemHCWinCopyStateFromX64Header(pVCpu, pCtx, &pMsg->Header); 1589 1590 /* Copy in the low register values (top is always cleared). */ 1591 pCtx->rax = (uint32_t)pMsg->Rax; 1592 pCtx->rcx = (uint32_t)pMsg->Rcx; 1593 pCtx->rdx = (uint32_t)pMsg->Rdx; 1594 pCtx->rbx = (uint32_t)pMsg->Rbx; 1595 pCtx->fExtrn &= ~(CPUMCTX_EXTRN_RAX | CPUMCTX_EXTRN_RCX | CPUMCTX_EXTRN_RDX | CPUMCTX_EXTRN_RBX); 1596 1597 /* Get the correct values. */ 1598 CPUMGetGuestCpuId(pVCpu, pCtx->eax, pCtx->ecx, &pCtx->eax, &pCtx->ebx, &pCtx->ecx, &pCtx->edx); 1599 1600 Log4(("CpuIdExit/%u: %04x:%08RX64: rax=%08RX64 / rcx=%08RX64 / rdx=%08RX64 / rbx=%08RX64 -> %08RX32 / %08RX32 / %08RX32 / %08RX32 (hv: %08RX64 / %08RX64 / %08RX64 / %08RX64)\n", 1601 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, 1602 pMsg->Rax, pMsg->Rcx, pMsg->Rdx, pMsg->Rbx, 1603 pCtx->eax, pCtx->ecx, pCtx->edx, pCtx->ebx, 1604 pMsg->DefaultResultRax, pMsg->DefaultResultRcx, pMsg->DefaultResultRdx, pMsg->DefaultResultRbx)); 1605 1606 /* Move RIP and we're done. */ 1607 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header); 1608 1609 return VINF_SUCCESS; 1610 } 1611 1612 1613 1614 1615 /** 1564 1616 * Deals with unrecoverable exception (triple fault). 1565 1617 * … … 1635 1687 return nemHCWinHandleMessageInterruptWindow(pVM, pVCpu, &pMsg->X64InterruptWindow, pCtx, pGVCpu); 1636 1688 1689 case HvMessageTypeX64CpuidIntercept: 1690 Assert(pMsg->Header.PayloadSize == sizeof(pMsg->X64CpuIdIntercept)); 1691 return nemHCWinHandleMessageCpuId(pVCpu, &pMsg->X64CpuIdIntercept, pCtx); 1692 1637 1693 case HvMessageTypeUnrecoverableException: 1638 1694 Assert(pMsg->Header.PayloadSize == sizeof(pMsg->X64InterceptHeader)); … … 1647 1703 1648 1704 case HvMessageTypeX64MsrIntercept: 1649 case HvMessageTypeX64CpuidIntercept:1650 1705 case HvMessageTypeX64ExceptionIntercept: 1651 1706 case HvMessageTypeX64ApicEoi: … … 1657 1712 case HvMessageTimerExpired: 1658 1713 LogRel(("Unexpected msg:\n%.*Rhxd\n", (int)sizeof(*pMsg), pMsg)); 1659 AssertLogRelMsgFailedReturn(("Unexpected message on CPU #%u: #x\n", pVCpu->idCpu, pMsg->Header.MessageType),1714 AssertLogRelMsgFailedReturn(("Unexpected message on CPU #%u: %#x\n", pVCpu->idCpu, pMsg->Header.MessageType), 1660 1715 VERR_INTERNAL_ERROR_2); 1661 1716 1662 1717 default: 1663 1718 LogRel(("Unknown msg:\n%.*Rhxd\n", (int)sizeof(*pMsg), pMsg)); 1664 AssertLogRelMsgFailedReturn(("Unknown message on CPU #%u: #x\n", pVCpu->idCpu, pMsg->Header.MessageType),1719 AssertLogRelMsgFailedReturn(("Unknown message on CPU #%u: %#x\n", pVCpu->idCpu, pMsg->Header.MessageType), 1665 1720 VERR_INTERNAL_ERROR_2); 1666 1721 }
Note:
See TracChangeset
for help on using the changeset viewer.