Changeset 72684 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 26, 2018 12:34:57 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123201
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r72655 r72684 30 30 } while (0) 31 31 32 /** @def NEMWIN_ASSERT_MSG_REG_VAL 33 * Asserts the correctness of a register value in a message/context. 34 */ 35 #if 0 36 # define NEMWIN_NEED_GET_REGISTER 37 # if defined(IN_RING0) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) 38 # define NEMWIN_ASSERT_MSG_REG_VAL(a_pVCpu, a_pGVCpu, a_enmReg, a_Expr, a_Msg) \ 39 do { \ 40 HV_REGISTER_VALUE TmpVal; \ 41 nemHCWinGetRegister(a_pVCpu, a_pGVCpu, a_enmReg, &TmpVal); \ 42 AssertMsg(a_Expr, a_Msg); \ 43 } while (0) 44 # else 45 # define NEMWIN_ASSERT_MSG_REG_VAL(a_pVCpu, a_pGVCpu, a_enmReg, a_Expr, a_Msg) \ 46 do { \ 47 WHV_REGISTER_VALUE TmpVal; \ 48 nemR3WinGetRegister(a_pVCpu, a_enmReg, &TmpVal); \ 49 AssertMsg(a_Expr, a_Msg); \ 50 } while (0) 51 # endif 52 #else 53 # define NEMWIN_ASSERT_MSG_REG_VAL(a_pVCpu, a_pGVCpu, a_enmReg, a_Expr, a_Msg) do { } while (0) 54 #endif 55 56 /** @def NEMWIN_ASSERT_MSG_REG_VAL 57 * Asserts the correctness of a 64-bit register value in a message/context. 58 */ 59 #define NEMWIN_ASSERT_MSG_REG_VAL64(a_pVCpu, a_pGVCpu, a_enmReg, a_u64Val) \ 60 NEMWIN_ASSERT_MSG_REG_VAL(a_pVCpu, a_pGVCpu, a_enmReg, (a_u64Val) == TmpVal.Reg64, \ 61 (#a_u64Val "=%#RX64, expected %#RX64\n", (a_u64Val), TmpVal.Reg64)) 62 /** @def NEMWIN_ASSERT_MSG_REG_VAL 63 * Asserts the correctness of a segment register value in a message/context. 64 */ 65 #define NEMWIN_ASSERT_MSG_REG_SEG(a_pVCpu, a_pGVCpu, a_enmReg, a_SReg) \ 66 NEMWIN_ASSERT_MSG_REG_VAL(a_pVCpu, a_pGVCpu, a_enmReg, \ 67 (a_SReg).Base == TmpVal.Segment.Base \ 68 && (a_SReg).Limit == TmpVal.Segment.Limit \ 69 && (a_SReg).Selector == TmpVal.Segment.Selector \ 70 && (a_SReg).Attributes == TmpVal.Segment.Attributes, \ 71 ( #a_SReg "=%#RX16 {%#RX64 LB %#RX32,%#RX16} expected %#RX16 {%#RX64 LB %#RX32,%#RX16}\n", \ 72 (a_SReg).Selector, (a_SReg).Base, (a_SReg).Limit, (a_SReg).Attributes, \ 73 TmpVal.Segment.Selector, TmpVal.Segment.Base, TmpVal.Segment.Limit, TmpVal.Segment.Attributes)) 74 32 75 33 76 /********************************************************************************************************************************* … … 46 89 NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, 47 90 uint32_t fPageProt, uint8_t *pu2State, bool fBackingChanged); 91 48 92 49 93 … … 1219 1263 } 1220 1264 1265 #ifdef NEMWIN_NEED_GET_REGISTER 1266 # if defined(IN_RING0) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) 1267 /** Worker for assertion macro. */ 1268 NEM_TMPL_STATIC int nemHCWinGetRegister(PVMCPU pVCpu, PGVMCPU pGVCpu, uint32_t enmReg, HV_REGISTER_VALUE *pRetValue) 1269 { 1270 RT_ZERO(*pRetValue); 1271 # ifdef IN_RING3 1272 RT_NOREF(pVCpu, pGVCpu, enmReg); 1273 return VERR_NOT_IMPLEMENTED; 1274 # else 1275 NOREF(pVCpu); 1276 1277 /* 1278 * Hypercall parameters. 1279 */ 1280 HV_INPUT_GET_VP_REGISTERS *pInput = (HV_INPUT_GET_VP_REGISTERS *)pGVCpu->nem.s.HypercallData.pbPage; 1281 AssertPtrReturn(pInput, VERR_INTERNAL_ERROR_3); 1282 AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API); 1283 1284 pInput->PartitionId = pGVCpu->pGVM->nem.s.idHvPartition; 1285 pInput->VpIndex = pGVCpu->idCpu; 1286 pInput->fFlags = 0; 1287 pInput->Names[0] = (HV_REGISTER_NAME)enmReg; 1288 1289 size_t const cbInput = RT_ALIGN_Z(RT_OFFSETOF(HV_INPUT_GET_VP_REGISTERS, Names[1]), 32); 1290 HV_REGISTER_VALUE *paValues = (HV_REGISTER_VALUE *)((uint8_t *)pInput + cbInput); 1291 RT_BZERO(paValues, sizeof(paValues[0]) * 1); 1292 1293 /* 1294 * Make the hypercall and copy out the value. 1295 */ 1296 uint64_t uResult = g_pfnHvlInvokeHypercall(HV_MAKE_CALL_INFO(HvCallGetVpRegisters, 1), 1297 pGVCpu->nem.s.HypercallData.HCPhysPage, 1298 pGVCpu->nem.s.HypercallData.HCPhysPage + cbInput); 1299 AssertLogRelMsgReturn(uResult == HV_MAKE_CALL_REP_RET(1), ("uResult=%RX64 cRegs=%#x\n", uResult, 1), 1300 VERR_NEM_GET_REGISTERS_FAILED); 1301 1302 *pRetValue = paValues[0]; 1303 return VINF_SUCCESS; 1304 # endif 1305 } 1306 # else 1307 /** Worker for assertion macro. */ 1308 NEM_TMPL_STATIC int nemR3WinGetRegister(PVMCPU a_pVCpu, uint32_t a_enmReg, WHV_REGISTER_VALUE pValue) 1309 { 1310 RT_ZERO(*pRetValue); 1311 RT_NOREF(pVCpu, pGVCpu, enmReg); 1312 return VERR_NOT_IMPLEMENTED; 1313 } 1314 # endif 1315 #endif 1316 1221 1317 1222 1318 #ifdef LOG_ENABLED … … 1322 1418 if (LogIs3Enabled()) 1323 1419 { 1324 # if def IN_RING31420 # if 0 // def IN_RING3 - causes lazy state import assertions all over CPUM. 1325 1421 char szRegs[4096]; 1326 1422 DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs), … … 1433 1529 * @param pCtx The CPU context to update. 1434 1530 * @param pExitCtx The exit context. 1531 * @param cbMinInstr The minimum instruction length, or 1 if not unknown. 1435 1532 */ 1436 DECLINLINE(void) nemHCWinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, PCPUMCTX pCtx, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr) 1533 DECLINLINE(void) nemHCWinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, PCPUMCTX pCtx, 1534 HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, uint8_t cbMinInstr) 1437 1535 { 1438 1536 Assert(!(pCtx->fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS))); 1439 1537 1440 1538 /* Advance the RIP. */ 1441 Assert(pMsgHdr->InstructionLength > 0 && pMsgHdr->InstructionLength < 16);1539 Assert(pMsgHdr->InstructionLength >= cbMinInstr); 1442 1540 pCtx->rip += pMsgHdr->InstructionLength; 1443 1541 pCtx->rflags.Bits.u1RF = 0; … … 1458 1556 * @param pCtx The CPU context to update. 1459 1557 * @param pExitCtx The exit context. 1558 * @param cbMinInstr The minimum instruction length, or 1 if not unknown. 1460 1559 */ 1461 DECLINLINE(void) nemR3WinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, PCPUMCTX pCtx, WHV_VP_EXIT_CONTEXT const *pExitCtx) 1560 DECLINLINE(void) nemR3WinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, PCPUMCTX pCtx, 1561 WHV_VP_EXIT_CONTEXT const *pExitCtx, uint8_t cbMinInstr) 1462 1562 { 1463 1563 Assert(!(pCtx->fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS))); 1464 1564 1465 1565 /* Advance the RIP. */ 1466 Assert(pExitCtx->InstructionLength > 0 && pExitCtx->InstructionLength < 16);1566 Assert(pExitCtx->InstructionLength > cbMinInstr); 1467 1567 pCtx->rip += pExitCtx->InstructionLength; 1468 1568 pCtx->rflags.Bits.u1RF = 0; … … 1846 1946 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE 1847 1947 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_EXECUTE); 1848 AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength));1849 1948 1850 1949 /* … … 1854 1953 pCtx->fExtrn &= ~CPUMCTX_EXTRN_NEM_WIN_EVENT_INJECT; 1855 1954 1856 # if 0 /* Experiment: 20K -> 34K exit/s. */1955 # if 0 /* Experiment: 20K -> 34K exit/s. */ 1857 1956 if ( pMsg->Header.ExecutionState.EferLma 1858 1957 && pMsg->Header.CsSegment.Long … … 1870 1969 } 1871 1970 } 1872 # endif1971 # endif 1873 1972 1874 1973 /* … … 1972 2071 uint64_t const uHostTsc = ASMReadTSC(); 1973 2072 Assert(pExit->MemoryAccess.AccessInfo.AccessType != 3); 1974 AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));1975 2073 1976 2074 /* … … 2070 2168 nemHCWinHandleMessageIoPort(PVM pVM, PVMCPU pVCpu, HV_X64_IO_PORT_INTERCEPT_MESSAGE const *pMsg, PCPUMCTX pCtx, PGVMCPU pGVCpu) 2071 2169 { 2170 /* 2171 * Assert message sanity. 2172 */ 2072 2173 Assert( pMsg->AccessInfo.AccessSize == 1 2073 2174 || pMsg->AccessInfo.AccessSize == 2 … … 2075 2176 Assert( pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_READ 2076 2177 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE); 2077 AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength)); 2178 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterCs, pMsg->Header.CsSegment); 2179 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRip, pMsg->Header.Rip); 2180 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRflags, pMsg->Header.Rflags); 2181 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterCr8, (uint64_t)pMsg->Header.Cr8); 2182 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRax, pMsg->Rax); 2183 if (pMsg->AccessInfo.StringOp) 2184 { 2185 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterDs, pMsg->DsSegment); 2186 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterEs, pMsg->EsSegment); 2187 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRcx, pMsg->Rcx); 2188 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRsi, pMsg->Rsi); 2189 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRdi, pMsg->Rdi); 2190 } 2078 2191 2079 2192 /* … … 2115 2228 pMsg->PortNumber, (uint32_t)pMsg->Rax & fAndMask, pMsg->AccessInfo.AccessSize, VBOXSTRICTRC_VAL(rcStrict) )); 2116 2229 if (IOM_SUCCESS(rcStrict)) 2117 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header );2230 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header, 1); 2118 2231 # ifdef IN_RING0 2119 2232 else if ( rcStrict == VINF_IOM_R3_IOPORT_WRITE … … 2144 2257 pCtx->fExtrn &= ~CPUMCTX_EXTRN_RAX; 2145 2258 Log4(("IOExit/%u: RAX %#RX64 -> %#RX64\n", pVCpu->idCpu, pMsg->Rax, pCtx->rax)); 2146 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header );2259 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header, 1); 2147 2260 } 2148 2261 else … … 2275 2388 || pExit->IoPortAccess.AccessInfo.AccessSize == 2 2276 2389 || pExit->IoPortAccess.AccessInfo.AccessSize == 4); 2277 AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));2278 2390 2279 2391 /* … … 2318 2430 { 2319 2431 nemR3WinCopyStateFromX64Header(pVCpu, pCtx, &pExit->VpContext); 2320 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext );2432 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext, 1); 2321 2433 } 2322 2434 } … … 2338 2450 Log4(("IOExit/%u: RAX %#RX64 -> %#RX64\n", pVCpu->idCpu, pExit->IoPortAccess.Rax, pCtx->rax)); 2339 2451 nemR3WinCopyStateFromX64Header(pVCpu, pCtx, &pExit->VpContext); 2340 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext );2452 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext, 1); 2341 2453 } 2342 2454 } … … 2449 2561 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_READ // READ & WRITE are probably not used here 2450 2562 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE); 2451 AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength));2452 2563 AssertMsg(pMsg->Type == HvX64PendingInterrupt || pMsg->Type == HvX64PendingNmi, ("%#x\n", pMsg->Type)); 2453 2564 … … 2484 2595 * Assert message sanity. 2485 2596 */ 2486 AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));2487 2597 AssertMsg( pExit->InterruptWindow.DeliverableType == WHvX64PendingInterrupt 2488 2598 || pExit->InterruptWindow.DeliverableType == WHvX64PendingNmi, … … 2522 2632 PGVMCPU pGVCpu) 2523 2633 { 2524 AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength)); 2634 /* Check message register value sanity. */ 2635 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterCs, pMsg->Header.CsSegment); 2636 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRip, pMsg->Header.Rip); 2637 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRflags, pMsg->Header.Rflags); 2638 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterCr8, (uint64_t)pMsg->Header.Cr8); 2639 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRax, pMsg->Rax); 2640 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRcx, pMsg->Rcx); 2641 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRdx, pMsg->Rdx); 2642 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRbx, pMsg->Rbx); 2643 2644 /* Do exit history. */ 2525 2645 PCEMEXITREC pExitRec = EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FT(EMEXIT_F_KIND_EM, EMEXITTYPE_CPUID), 2526 2646 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); … … 2555 2675 2556 2676 /* Move RIP and we're done. */ 2557 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, &pVCpu->cpum.GstCtx, &pMsg->Header );2677 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, &pVCpu->cpum.GstCtx, &pMsg->Header, 2); 2558 2678 2559 2679 return VINF_SUCCESS; … … 2603 2723 nemR3WinHandleExitCpuId(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 2604 2724 { 2605 AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));2606 2725 PCEMEXITREC pExitRec = EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FT(EMEXIT_F_KIND_EM, EMEXITTYPE_CPUID), 2607 2726 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); … … 2636 2755 2637 2756 /* Move RIP and we're done. */ 2638 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, &pVCpu->cpum.GstCtx, &pExit->VpContext );2757 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, &pVCpu->cpum.GstCtx, &pExit->VpContext, 2); 2639 2758 2640 2759 RT_NOREF_PV(pVM); … … 2684 2803 * A wee bit of sanity first. 2685 2804 */ 2686 AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength));2687 2805 Assert( pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_READ 2688 2806 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE); 2807 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterCs, pMsg->Header.CsSegment); 2808 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRip, pMsg->Header.Rip); 2809 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRflags, pMsg->Header.Rflags); 2810 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterCr8, (uint64_t)pMsg->Header.Cr8); 2811 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRax, pMsg->Rax); 2812 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRdx, pMsg->Rdx); 2689 2813 2690 2814 /* … … 2725 2849 if (rcStrict == VINF_SUCCESS) 2726 2850 { 2727 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header );2851 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header, 2); 2728 2852 return VINF_SUCCESS; 2729 2853 } … … 2754 2878 pCtx->rdx = uValue >> 32; 2755 2879 pCtx->fExtrn &= ~(CPUMCTX_EXTRN_RAX | CPUMCTX_EXTRN_RDX); 2756 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header );2880 nemHCWinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pMsg->Header, 2); 2757 2881 return VINF_SUCCESS; 2758 2882 } … … 2831 2955 nemR3WinHandleExitMsr(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit, PCPUMCTX pCtx) 2832 2956 { 2833 AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));2834 2835 2957 /* 2836 2958 * Check CPL as that's common to both RDMSR and WRMSR. … … 2870 2992 if (rcStrict == VINF_SUCCESS) 2871 2993 { 2872 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext );2994 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext, 2); 2873 2995 return VINF_SUCCESS; 2874 2996 } … … 2893 3015 pCtx->rdx = uValue >> 32; 2894 3016 pCtx->fExtrn &= ~(CPUMCTX_EXTRN_RAX | CPUMCTX_EXTRN_RDX); 2895 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext );3017 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pExit->VpContext, 2); 2896 3018 return VINF_SUCCESS; 2897 3019 } … … 3088 3210 * Assert sanity. 3089 3211 */ 3090 AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength));3091 3212 Assert( pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_READ 3092 3213 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE 3093 3214 || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_EXECUTE); 3215 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterCs, pMsg->Header.CsSegment); 3216 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRip, pMsg->Header.Rip); 3217 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRflags, pMsg->Header.Rflags); 3218 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterCr8, (uint64_t)pMsg->Header.Cr8); 3219 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterDs, pMsg->DsSegment); 3220 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterSs, pMsg->SsSegment); 3221 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRax, pMsg->Rax); 3222 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRcx, pMsg->Rcx); 3223 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRdx, pMsg->Rdx); 3224 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRbx, pMsg->Rbx); 3225 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRsp, pMsg->Rsp); 3226 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRbp, pMsg->Rbp); 3227 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRsi, pMsg->Rsi); 3228 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRdi, pMsg->Rdi); 3229 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR8, pMsg->R8); 3230 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR9, pMsg->R9); 3231 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR10, pMsg->R10); 3232 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR11, pMsg->R11); 3233 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR12, pMsg->R12); 3234 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR13, pMsg->R13); 3235 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR14, pMsg->R14); 3236 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterR15, pMsg->R15); 3094 3237 3095 3238 /* … … 3193 3336 nemR3WinHandleExitException(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit, PCPUMCTX pCtx) 3194 3337 { 3195 /*3196 * Assert sanity.3197 */3198 AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));3199 3200 3338 /* 3201 3339 * Get most of the register state since we'll end up making IEM inject the … … 3309 3447 PCPUMCTX pCtx, PGVMCPU pGVCpu) 3310 3448 { 3311 AssertMsg(pMsgHdr->InstructionLength < 0x10, ("%#x\n", pMsgHdr->InstructionLength)); 3449 /* Check message register value sanity. */ 3450 NEMWIN_ASSERT_MSG_REG_SEG( pVCpu, pGVCpu, HvX64RegisterCs, pMsgHdr->CsSegment); 3451 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRip, pMsgHdr->Rip); 3452 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterRflags, pMsgHdr->Rflags); 3453 NEMWIN_ASSERT_MSG_REG_VAL64(pVCpu, pGVCpu, HvX64RegisterCr8, (uint64_t)pMsgHdr->Cr8); 3312 3454 3313 3455 # if 0 … … 3365 3507 nemR3WinHandleExitUnrecoverableException(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit, PCPUMCTX pCtx) 3366 3508 { 3367 AssertMsg(pExit->VpContext.InstructionLength < 0x10, ("%#x\n", pExit->VpContext.InstructionLength));3368 3369 3509 # if 0 3370 3510 /*
Note:
See TracChangeset
for help on using the changeset viewer.