Changeset 10661 in vbox for trunk/src/VBox
- Timestamp:
- Jul 15, 2008 2:21:04 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r10473 r10661 1726 1726 { 1727 1727 val64 = 0; 1728 rc = PDMApicGetTPR(pVM, (uint8_t *)&val64 );1728 rc = PDMApicGetTPR(pVM, (uint8_t *)&val64, NULL); 1729 1729 AssertMsgRCReturn(rc, ("PDMApicGetTPR failed\n"), VERR_EM_INTERPRETER); 1730 1730 } -
trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
r10520 r10661 230 230 231 231 /** 232 * Get the TPR (task priority register ?).232 * Get the TPR (task priority register). 233 233 * 234 234 * @returns The current TPR. 235 235 * @param pVM VM handle. 236 236 * @param pu8TPR Where to store the TRP. 237 */ 238 PDMDECL(int) PDMApicGetTPR(PVM pVM, uint8_t *pu8TPR) 237 * @param pfPending Pending interrupt state (out). 238 */ 239 PDMDECL(int) PDMApicGetTPR(PVM pVM, uint8_t *pu8TPR, bool *pfPending) 239 240 { 240 241 if (pVM->pdm.s.Apic.CTXALLSUFF(pDevIns)) … … 243 244 pdmLock(pVM); 244 245 *pu8TPR = pVM->pdm.s.Apic.CTXALLSUFF(pfnGetTPR)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns)); 246 if (pfPending) 247 *pfPending = pVM->pdm.s.Apic.CTXALLSUFF(pfnHasPendingIrq)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns)); 245 248 pdmUnlock(pVM); 246 249 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r10647 r10661 269 269 */ 270 270 if (!pVM->hwaccm.s.fNestedPaging) 271 pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(3) | RT_BIT(4) | RT_BIT(8);271 pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(3) | RT_BIT(4); 272 272 else 273 273 pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(4) | RT_BIT(8); … … 861 861 if (pCtx->msrEFER & MSR_K6_EFER_LMA) 862 862 { 863 bool fPending; 864 863 865 /* TPR caching in CR8 */ 864 int rc = PDMApicGetTPR(pVM, &u8LastVTPR );866 int rc = PDMApicGetTPR(pVM, &u8LastVTPR, &fPending); 865 867 AssertRC(rc); 866 868 pVMCB->ctrl.IntCtrl.n.u8VTPR = u8LastVTPR; 869 870 if (fPending) 871 { 872 /* A TPR change could activate a pending interrupt, so catch cr8 writes. */ 873 pVMCB->ctrl.u16InterceptWrCRx |= RT_BIT(8); 874 } 875 else 876 /* No interrupts are pending, so we don't need to be explicitely notified. 877 * There are enough world switches for detecting pending interrupts. 878 */ 879 pVMCB->ctrl.u16InterceptWrCRx &= ~RT_BIT(8); 867 880 } 868 881 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r10647 r10661 1182 1182 /* TPR caching in CR8 */ 1183 1183 uint8_t u8TPR; 1184 int rc = PDMApicGetTPR(pVM, &u8TPR); 1184 bool fPending; 1185 1186 int rc = PDMApicGetTPR(pVM, &u8TPR, &fPending); 1185 1187 AssertRC(rc); 1186 1188 /* The TPR can be found at offset 0x80 in the APIC mmio page. */ 1187 1189 pVM->hwaccm.s.vmx.pAPIC[0x80] = u8TPR << 4; /* bits 7-4 contain the task priority */ 1188 1190 1189 /* CR8 updates that lower the TPR value to below the current value should cause an exit. */ 1190 rc = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, u8TPR); 1191 /* Two options here: 1192 * - external interrupt pending, but masked by the TPR value. 1193 * -> CR8 updates that lower the TPR value to below the current value should cause an exit 1194 * - no pending interrupts 1195 * -> We don't need to be explicitely notified. There are enough world switches for detecting pending interrupts. 1196 */ 1197 rc = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, (fPending) ? u8TPR : 0); 1191 1198 AssertRC(rc); 1192 1199 }
Note:
See TracChangeset
for help on using the changeset viewer.