Changeset 72392 in vbox for trunk/src/VBox
- Timestamp:
- May 30, 2018 12:27:17 PM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r71266 r72392 2174 2174 * 2175 2175 * @returns Strict VBox status code. 2176 * @retval VINF_SUCCESS 2177 * @retval VINF_CPUM_R3_MSR_WRITE 2178 * @retval VERR_CPUM_RAISE_GP_0 2179 * 2176 2180 * @param pVCpu The cross context virtual CPU structure. 2177 2181 * @param u64BaseMsr The value to set. -
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r72387 r72392 1256 1256 } 1257 1257 1258 if (rc == VERR_NEM_CHANGE_PGM_MODE || rc == VERR_NEM_FLUSH_TLB )1258 if (rc == VERR_NEM_CHANGE_PGM_MODE || rc == VERR_NEM_FLUSH_TLB || rc == VERR_NEM_UPDATE_APIC_BASE) 1259 1259 { 1260 1260 Log4(("%s/%u: nemR0WinImportState -> %Rrc\n", pszCaller, pGVCpu->idCpu, -rc)); … … 1796 1796 Log(("UnrecovExit/%u: %04x:%08RX64/%s: RFL=%#RX64 -> VINF_SUCCESS\n", pVCpu->idCpu, pMsgHdr->CsSegment.Selector, 1797 1797 pMsgHdr->Rip, nemHCWinExecStateToLogStr(pMsgHdr), pMsgHdr->Rflags )); 1798 pCtx->fExtrn &= ~CPUMCTX_EXTRN_NEM_WIN_EVENT_INJECT; /* Make sure to reset pending #DB(0). */ 1798 1799 return VINF_SUCCESS; 1799 1800 } … … 2367 2368 if (RT_SUCCESS(rc2)) 2368 2369 pCtx->fExtrn = 0; 2369 else if (rc2 == VERR_NEM_CHANGE_PGM_MODE || rc2 == VERR_NEM_FLUSH_TLB )2370 else if (rc2 == VERR_NEM_CHANGE_PGM_MODE || rc2 == VERR_NEM_FLUSH_TLB || rc2 == VERR_NEM_UPDATE_APIC_BASE) 2370 2371 { 2371 2372 pCtx->fExtrn = 0; … … 2374 2375 else 2375 2376 { 2376 pVCpu->nem.s.rcP gmPending = -rc2;2377 LogFlow(("NEM/%u: rcP gmPending=%Rrc (rcStrict=%Rrc)\n", pVCpu->idCpu, rc2, VBOXSTRICTRC_VAL(rcStrict) ));2377 pVCpu->nem.s.rcPending = -rc2; 2378 LogFlow(("NEM/%u: rcPending=%Rrc (rcStrict=%Rrc)\n", pVCpu->idCpu, rc2, VBOXSTRICTRC_VAL(rcStrict) )); 2378 2379 } 2379 2380 } -
trunk/src/VBox/VMM/VMMR0/NEMR0Native-win.cpp
r72386 r72392 1153 1153 pInput->Elements[iReg].Value.Reg64 = pCtxMsrs->msr.MtrrFix4K_F8000; 1154 1154 iReg++; 1155 HV_REGISTER_ASSOC_ZERO_PADDING_AND_HI64(&pInput->Elements[iReg]); 1156 pInput->Elements[iReg].Name = HvX64RegisterTscAux; 1157 pInput->Elements[iReg].Value.Reg64 = pCtxMsrs->msr.TscAux; 1158 iReg++; 1155 1159 1156 1160 #if 0 /** @todo Why can't we write these on Intel systems? Not that we really care... */ … … 1480 1484 pInput->Names[iReg++] = HvX64RegisterMtrrFix4kF0000; 1481 1485 pInput->Names[iReg++] = HvX64RegisterMtrrFix4kF8000; 1486 pInput->Names[iReg++] = HvX64RegisterTscAux; 1482 1487 #if 0 /** @todo why can't we read HvX64RegisterIa32MiscEnable? */ 1483 1488 if (enmCpuVendor != CPUMCPUVENDOR_AMD) … … 1947 1952 iReg++; 1948 1953 } 1954 bool fUpdateApicBase = false; 1949 1955 if (fWhat & CPUMCTX_EXTRN_OTHER_MSRS) 1950 1956 { … … 1956 1962 pVCpu->idCpu, uOldBase, paValues[iReg].Reg64, paValues[iReg].Reg64 ^ uOldBase)); 1957 1963 VBOXSTRICTRC rc2 = APICSetBaseMsr(pVCpu, paValues[iReg].Reg64); 1958 Assert(rc2 == VINF_SUCCESS); NOREF(rc2); 1964 if (rc2 == VINF_CPUM_R3_MSR_WRITE) 1965 { 1966 pVCpu->nem.s.uPendingApicBase = paValues[iReg].Reg64; 1967 fUpdateApicBase = true; 1968 } 1969 else 1970 AssertLogRelMsg(rc2 == VINF_SUCCESS, ("rc2=%Rrc [%#RX64]\n", VBOXSTRICTRC_VAL(rc2), paValues[iReg].Reg64)); 1959 1971 } 1960 1972 iReg++; … … 2046 2058 Log7(("NEM/%u: MSR MTRR_FIX16K_F8000 changed %RX64 -> %RX64\n", pVCpu->idCpu, pCtxMsrs->msr.MtrrFix4K_F8000, paValues[iReg].Reg64)); 2047 2059 pCtxMsrs->msr.MtrrFix4K_F8000 = paValues[iReg].Reg64; 2060 iReg++; 2061 2062 Assert(pInput->Names[iReg] == HvX64RegisterTscAux); 2063 if (paValues[iReg].Reg64 != pCtxMsrs->msr.TscAux ) 2064 Log7(("NEM/%u: MSR TSC_AUX changed %RX64 -> %RX64\n", pVCpu->idCpu, pCtxMsrs->msr.TscAux, paValues[iReg].Reg64)); 2065 pCtxMsrs->msr.TscAux = paValues[iReg].Reg64; 2048 2066 iReg++; 2049 2067 … … 2119 2137 2120 2138 /* Typical. */ 2121 if (!fMaybeChangedMode && !fFlushTlb )2139 if (!fMaybeChangedMode && !fFlushTlb && !fUpdateApicBase) 2122 2140 return VINF_SUCCESS; 2123 2141 … … 2141 2159 LogFlow(("nemR0WinImportState: -> VERR_NEM_FLUSH_TLB!\n")); 2142 2160 rc = VERR_NEM_FLUSH_TLB; /* Calling PGMFlushTLB w/o long jump setup doesn't work, ring-3 does it. */ 2161 } 2162 2163 if (fUpdateApicBase && rc == VINF_SUCCESS) 2164 { 2165 LogFlow(("nemR0WinImportState: -> VERR_NEM_UPDATE_APIC_BASE!\n")); 2166 rc = VERR_NEM_UPDATE_APIC_BASE; 2143 2167 } 2144 2168 -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp
r72358 r72392 1101 1101 1102 1102 /* 1103 * Some state init. 1104 */ 1105 for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++) 1106 { 1107 PNEMCPU pNemCpu = &pVM->aCpus[iCpu].nem.s; 1108 pNemCpu->uPendingApicBase = UINT64_MAX; 1109 } 1110 1111 /* 1103 1112 * Error state. 1104 1113 * The error message will be non-empty on failure and 'rc' will be set too. … … 2037 2046 if (RT_SUCCESS(rcStrict)) 2038 2047 { 2039 /* We deal with VINF_NEM_CHANGE_PGM_MODE and VINF_NEM_FLUSH_TLB here, since we're running 2040 the risk of getting these while we already got another RC (I/O ports). */ 2041 VBOXSTRICTRC rcPgmPending = pVCpu->nem.s.rcPgmPending; 2042 pVCpu->nem.s.rcPgmPending = VINF_SUCCESS; 2048 /* 2049 * We deal with VINF_NEM_CHANGE_PGM_MODE, VINF_NEM_FLUSH_TLB and 2050 * VINF_NEM_UPDATE_APIC_BASE here, since we're running the risk of 2051 * getting these while we already got another RC (I/O ports). 2052 * 2053 * The APIC base update and a PGM update can happen at the same time, so 2054 * we don't depend on the status code for that and always checks it first. 2055 */ 2056 /* APIC base: */ 2057 if (pVCpu->nem.s.uPendingApicBase != UINT64_MAX) 2058 { 2059 LogFlow(("nemR3NativeRunGC: calling APICSetBaseMsr(,%RX64)...\n", pVCpu->nem.s.uPendingApicBase)); 2060 VBOXSTRICTRC rc2 = APICSetBaseMsr(pVCpu, pVCpu->nem.s.uPendingApicBase); 2061 AssertLogRelMsg(rc2 == VINF_SUCCESS, ("rc2=%Rrc [%#RX64]\n", VBOXSTRICTRC_VAL(rc2), pVCpu->nem.s.uPendingApicBase)); 2062 pVCpu->nem.s.uPendingApicBase = UINT64_MAX; 2063 } 2064 2065 /* Status codes: */ 2066 VBOXSTRICTRC rcPending = pVCpu->nem.s.rcPending; 2067 pVCpu->nem.s.rcPending = VINF_SUCCESS; 2043 2068 if ( rcStrict == VINF_NEM_CHANGE_PGM_MODE 2044 2069 || rcStrict == VINF_PGM_CHANGE_MODE 2045 || rcP gmPending == VINF_NEM_CHANGE_PGM_MODE )2070 || rcPending == VINF_NEM_CHANGE_PGM_MODE ) 2046 2071 { 2047 2072 LogFlow(("nemR3NativeRunGC: calling PGMChangeMode...\n")); … … 2060 2085 } 2061 2086 } 2062 else if (rcStrict == VINF_NEM_FLUSH_TLB || rcP gmPending == VINF_NEM_FLUSH_TLB)2087 else if (rcStrict == VINF_NEM_FLUSH_TLB || rcPending == VINF_NEM_FLUSH_TLB) 2063 2088 { 2064 2089 LogFlow(("nemR3NativeRunGC: calling PGMFlushTLB...\n")); … … 2077 2102 } 2078 2103 } 2104 else if (rcStrict == VINF_NEM_UPDATE_APIC_BASE || rcPending == VERR_NEM_UPDATE_APIC_BASE) 2105 continue; 2079 2106 else 2080 AssertMsg(rcP gmPending == VINF_SUCCESS, ("rcPgmPending=%Rrc\n", VBOXSTRICTRC_VAL(rcPgmPending) ));2107 AssertMsg(rcPending == VINF_SUCCESS, ("rcPending=%Rrc\n", VBOXSTRICTRC_VAL(rcPending) )); 2081 2108 } 2082 2109 LogFlow(("nemR3NativeRunGC: returns %Rrc\n", VBOXSTRICTRC_VAL(rcStrict) )); -
trunk/src/VBox/VMM/include/NEMInternal.h
r72358 r72392 195 195 bool fLastInterruptShadow : 1; 196 196 bool afPadding[1]; 197 /** Pending APIC base value. 198 * This is set to UINT64_MAX when not pending */ 199 uint64_t uPendingApicBase; 197 200 # ifdef NEM_WIN_USE_OUR_OWN_RUN_API 198 /** Pending V ERR_NEM_CHANGE_PGM_MODE or VERR_NEM_FLUSH_TLB. */199 int32_t rcP gmPending;201 /** Pending VINF_NEM_CHANGE_PGM_MODE, VINF_NEM_FLUSH_TLB or VINF_NEM_UPDATE_APIC_BASE. */ 202 int32_t rcPending; 200 203 /** The VID_MSHAGN_F_XXX flags. 201 204 * Either VID_MSHAGN_F_HANDLE_MESSAGE | VID_MSHAGN_F_GET_NEXT_MESSAGE or zero. */
Note:
See TracChangeset
for help on using the changeset viewer.