Changeset 72555 in vbox for trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
- Timestamp:
- Jun 14, 2018 9:28:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r72551 r72555 1909 1909 * Emulate the memory access, either access handler or special memory. 1910 1910 */ 1911 EMHistoryAddExit(pVCpu, 1912 pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE 1913 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MMIO_WRITE) 1914 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MMIO_READ), 1915 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 1911 1916 nemHCWinCopyStateFromX64Header(pVCpu, pCtx, &pMsg->Header); 1912 1917 VBOXSTRICTRC rcStrict; … … 1998 2003 * Emulate the memory access, either access handler or special memory. 1999 2004 */ 2005 EMHistoryAddExit(pVCpu, 2006 pExit->MemoryAccess.AccessInfo.AccessType == WHvMemoryAccessWrite 2007 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MMIO_WRITE) 2008 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MMIO_READ), 2009 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2010 2000 2011 nemR3WinCopyStateFromX64Header(pVCpu, pCtx, &pExit->VpContext); 2001 2012 rc = nemHCWinCopyStateFromHyperV(pVM, pVCpu, pCtx, NEM_WIN_CPUMCTX_EXTRN_MASK_FOR_IEM | CPUMCTX_EXTRN_DS | CPUMCTX_EXTRN_ES); … … 2052 2063 * Simple port I/O. 2053 2064 */ 2065 EMHistoryAddExit(pVCpu, 2066 pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE 2067 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_WRITE) 2068 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_READ), 2069 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2070 2054 2071 static uint32_t const s_fAndMask[8] = 2055 2072 { UINT32_MAX, UINT32_C(0xff), UINT32_C(0xffff), UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX }; … … 2125 2142 * the opcode bytes for possible evil prefixes. 2126 2143 */ 2144 EMHistoryAddExit(pVCpu, 2145 pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE 2146 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_STR_WRITE) 2147 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_STR_READ), 2148 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2149 2127 2150 nemHCWinCopyStateFromX64Header(pVCpu, pCtx, &pMsg->Header); 2128 2151 pCtx->fExtrn &= ~( CPUMCTX_EXTRN_RAX | CPUMCTX_EXTRN_RCX | CPUMCTX_EXTRN_RDI | CPUMCTX_EXTRN_RSI … … 2196 2219 * Simple port I/O. 2197 2220 */ 2221 EMHistoryAddExit(pVCpu, 2222 pExit->MemoryAccess.AccessInfo.AccessType == WHvMemoryAccessWrite 2223 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_WRITE) 2224 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_READ), 2225 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2226 2198 2227 static uint32_t const s_fAndMask[8] = 2199 2228 { UINT32_MAX, UINT32_C(0xff), UINT32_C(0xffff), UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX }; … … 2249 2278 * the opcode bytes for possible evil prefixes. 2250 2279 */ 2280 EMHistoryAddExit(pVCpu, 2281 pExit->MemoryAccess.AccessInfo.AccessType == WHvMemoryAccessWrite 2282 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_STR_WRITE) 2283 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_IO_PORT_STR_READ), 2284 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2285 2251 2286 nemR3WinCopyStateFromX64Header(pVCpu, pCtx, &pExit->VpContext); 2252 2287 pCtx->fExtrn &= ~( CPUMCTX_EXTRN_RAX | CPUMCTX_EXTRN_RCX | CPUMCTX_EXTRN_RDI | CPUMCTX_EXTRN_RSI … … 2320 2355 * Just copy the state we've got and handle it in the loop for now. 2321 2356 */ 2357 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_INTTERRUPT_WINDOW), 2358 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2359 2322 2360 nemHCWinCopyStateFromX64Header(pVCpu, pCtx, &pMsg->Header); 2323 2361 Log4(("IntWinExit/%u: %04x:%08RX64/%s: %u IF=%d InterruptShadow=%d\n", … … 2354 2392 * Just copy the state we've got and handle it in the loop for now. 2355 2393 */ 2394 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_INTTERRUPT_WINDOW), 2395 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2396 2356 2397 nemR3WinCopyStateFromX64Header(pVCpu, pCtx, &pExit->VpContext); 2357 2398 Log4(("IntWinExit/%u: %04x:%08RX64/%s: %u IF=%d InterruptShadow=%d\n", … … 2374 2415 * @param pMsg The message. 2375 2416 * @param pCtx The register context. 2417 * @sa nemR3WinHandleExitCpuId 2376 2418 */ 2377 2419 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageCpuId(PVMCPU pVCpu, HV_X64_CPUID_INTERCEPT_MESSAGE const *pMsg, PCPUMCTX pCtx) … … 2385 2427 * function and make everyone use it. 2386 2428 */ 2429 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_CPUID), 2430 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2431 2387 2432 /** @todo Combine implementations into IEMExecDecodedCpuId as this will 2388 2433 * only get weirder with nested VT-x and AMD-V support. */ … … 2419 2464 * @param pExit The VM exit information to handle. 2420 2465 * @param pCtx The register context. 2421 * @sa nemHCWinHandleMessage InterruptWindow2466 * @sa nemHCWinHandleMessageCpuId 2422 2467 */ 2423 2468 NEM_TMPL_STATIC VBOXSTRICTRC … … 2432 2477 * function and make everyone use it. 2433 2478 */ 2479 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_CPUID), 2480 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2481 2434 2482 /** @todo Combine implementations into IEMExecDecodedCpuId as this will 2435 2483 * only get weirder with nested VT-x and AMD-V support. */ … … 2487 2535 if (pMsg->Header.ExecutionState.Cpl == 0) 2488 2536 { 2537 EMHistoryAddExit(pVCpu, 2538 pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE 2539 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MSR_WRITE) 2540 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MSR_READ), 2541 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2542 2489 2543 /* 2490 2544 * Get all the MSR state. Since we're getting EFER, we also need to … … 2613 2667 * get CR0, CR4 and CR3. 2614 2668 */ 2669 EMHistoryAddExit(pVCpu, 2670 pExit->MsrAccess.AccessInfo.IsWrite 2671 ? EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MSR_WRITE) 2672 : EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_EM, EMEXITTYPE_MSR_READ), 2673 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2674 2615 2675 nemR3WinCopyStateFromX64Header(pVCpu, pCtx, &pExit->VpContext); 2616 2676 rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, NULL, pCtx, … … 2873 2933 case X86_XCPT_UD: 2874 2934 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionUd); 2935 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_XCPT_UD), 2936 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2937 2875 2938 if (nemHcWinIsInterestingUndefinedOpcode(pMsg->InstructionByteCount, pMsg->InstructionBytes, 2876 2939 pMsg->Header.ExecutionState.EferLma && pMsg->Header.CsSegment.Long )) … … 2893 2956 case X86_XCPT_DB: 2894 2957 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionDb); 2958 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_XCPT_DB), 2959 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2895 2960 Log4(("XcptExit/%u: %04x:%08RX64/%s: #DB - TODO\n", 2896 2961 pVCpu->idCpu, pMsg->Header.CsSegment.Selector, pMsg->Header.Rip, nemHCWinExecStateToLogStr(&pMsg->Header) )); … … 2899 2964 case X86_XCPT_BP: 2900 2965 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionBp); 2966 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_XCPT_BP), 2967 pMsg->Header.Rip + pMsg->Header.CsSegment.Base, ASMReadTSC()); 2901 2968 Log4(("XcptExit/%u: %04x:%08RX64/%s: #BP - TODO - %u\n", pVCpu->idCpu, pMsg->Header.CsSegment.Selector, 2902 2969 pMsg->Header.Rip, nemHCWinExecStateToLogStr(&pMsg->Header), pMsg->Header.InstructionLength)); … … 2971 3038 case X86_XCPT_UD: 2972 3039 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionUd); 3040 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_XCPT_UD), 3041 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2973 3042 if (nemHcWinIsInterestingUndefinedOpcode(pExit->VpException.InstructionByteCount, pExit->VpException.InstructionBytes, 2974 3043 pExit->VpContext.ExecutionState.EferLma && pExit->VpContext.Cs.Long )) … … 2994 3063 case X86_XCPT_DB: 2995 3064 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionDb); 3065 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_XCPT_DB), 3066 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 2996 3067 Log4(("XcptExit/%u: %04x:%08RX64/%s: #DB - TODO\n", 2997 3068 pVCpu->idCpu, pExit->VpContext.Cs.Selector, pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext) )); … … 3000 3071 case X86_XCPT_BP: 3001 3072 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitExceptionBp); 3073 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_XCPT_BP), 3074 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 3002 3075 Log4(("XcptExit/%u: %04x:%08RX64/%s: #BP - TODO - %u\n", pVCpu->idCpu, pExit->VpContext.Cs.Selector, 3003 3076 pExit->VpContext.Rip, nemR3WinExecStateToLogStr(&pExit->VpContext), pExit->VpContext.InstructionLength)); … … 3057 3130 * Let IEM decide whether this is really it. 3058 3131 */ 3132 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_UNRECOVERABLE_EXCEPTION), 3133 pMsgHdr->Rip + pMsgHdr->CsSegment.Base, ASMReadTSC()); 3059 3134 nemHCWinCopyStateFromX64Header(pVCpu, pCtx, pMsgHdr); 3060 3135 VBOXSTRICTRC rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, pGVCpu, pCtx, … … 3112 3187 * Let IEM decide whether this is really it. 3113 3188 */ 3189 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_UNRECOVERABLE_EXCEPTION), 3190 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 3114 3191 nemR3WinCopyStateFromX64Header(pVCpu, pCtx, &pExit->VpContext); 3115 3192 VBOXSTRICTRC rcStrict = nemHCWinImportStateIfNeededStrict(pVCpu, NULL, pCtx, … … 3181 3258 case HvMessageTypeX64Halt: 3182 3259 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitHalt); 3260 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_HALT), 3261 pMsg->X64InterceptHeader.Rip + pMsg->X64InterceptHeader.CsSegment.Base, ASMReadTSC()); 3183 3262 Log4(("HaltExit\n")); 3184 3263 return VINF_EM_HALT; … … 3263 3342 case WHvRunVpExitReasonX64Halt: 3264 3343 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatExitHalt); 3344 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_NEM, NEMEXITTYPE_HALT), 3345 pExit->VpContext.Rip + pExit->VpContext.Cs.Base, ASMReadTSC()); 3265 3346 Log4(("HaltExit\n")); 3266 3347 return VINF_EM_HALT;
Note:
See TracChangeset
for help on using the changeset viewer.