Changeset 20666 in vbox
- Timestamp:
- Jun 17, 2009 1:01:56 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r20572 r20666 681 681 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 682 682 APICState *s = getLapicById(dev, idCpu); 683 LogFlow(("apicSetTPR: val=%#x (trp %#x -> %#x)\n", val, s->tpr, (val & 0x0f) << 4));684 apic_update_tpr(dev, s, (val & 0x0f) << 4);683 LogFlow(("apicSetTPR: val=%#x (trp %#x -> %#x)\n", val, s->tpr, val)); 684 apic_update_tpr(dev, s, val); 685 685 } 686 686 … … 689 689 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 690 690 APICState *s = getLapicById(dev, idCpu); 691 Log2(("apicGetTPR: returns %#x\n", s->tpr >> 4));692 return s->tpr >> 4;691 Log2(("apicGetTPR: returns %#x\n", s->tpr)); 692 return s->tpr; 693 693 } 694 694 -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r20588 r20666 1995 1995 rc = PDMApicGetTPR(pVCpu, (uint8_t *)&val64, NULL); 1996 1996 AssertMsgRCReturn(rc, ("PDMApicGetTPR failed\n"), VERR_EM_INTERPRETER); 1997 val64 >>= 4; /* bits 7-4 contain the task priority that go in cr8, bits 3-0*/ 1997 1998 } 1998 1999 else … … 2170 2171 2171 2172 case USE_REG_CR8: 2172 return PDMApicSetTPR(pVCpu, val );2173 return PDMApicSetTPR(pVCpu, val << 4); /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 2173 2174 2174 2175 default: -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r20660 r20666 986 986 int rc = PDMApicGetTPR(pVCpu, &u8LastTPR, &fPending); 987 987 AssertRC(rc); 988 pVMCB->ctrl.IntCtrl.n.u8VTPR = u8LastTPR;988 pVMCB->ctrl.IntCtrl.n.u8VTPR = (u8LastTPR >> 4); /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 989 989 990 990 if (fPending) … … 1380 1380 /* Sync back the TPR if it was changed. */ 1381 1381 if ( fSyncTPR 1382 && u8LastTPR!= pVMCB->ctrl.IntCtrl.n.u8VTPR)1383 { 1384 rc = PDMApicSetTPR(pVCpu, pVMCB->ctrl.IntCtrl.n.u8VTPR );1382 && (u8LastTPR >> 4) != pVMCB->ctrl.IntCtrl.n.u8VTPR) 1383 { 1384 rc = PDMApicSetTPR(pVCpu, pVMCB->ctrl.IntCtrl.n.u8VTPR << 4); /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 1385 1385 AssertRC(rc); 1386 1386 } … … 2364 2364 rc = DISFetchReg32(CPUMCTX2CORE(pCtx), pDis->param2.base.reg_gen, &val); 2365 2365 AssertRC(rc); 2366 u8Tpr = val >> 4;2366 u8Tpr = val; 2367 2367 } 2368 2368 else 2369 2369 if (pDis->param2.flags == USE_IMMEDIATE32) 2370 2370 { 2371 u8Tpr = (uint8_t)pDis->param2.parval >> 4;2371 u8Tpr = (uint8_t)pDis->param2.parval; 2372 2372 } 2373 2373 else … … 2392 2392 AssertRC(rc); 2393 2393 2394 rc = DISWriteReg32(CPUMCTX2CORE(pCtx), pDis->param1.base.reg_gen, u8Tpr << 4);2394 rc = DISWriteReg32(CPUMCTX2CORE(pCtx), pDis->param1.base.reg_gen, u8Tpr); 2395 2395 AssertRC(rc); 2396 2396 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r20660 r20666 2218 2218 { 2219 2219 /* TPR caching in CR8 */ 2220 uint8_t u8TPR;2221 2220 bool fPending; 2222 2221 2223 int rc = PDMApicGetTPR(pVCpu, &u8 TPR, &fPending);2222 int rc = PDMApicGetTPR(pVCpu, &u8LastTPR, &fPending); 2224 2223 AssertRC(rc); 2225 2224 /* The TPR can be found at offset 0x80 in the APIC mmio page. */ 2226 u8LastTPR = pVCpu->hwaccm.s.vmx.pVAPIC[0x80] = u8TPR << 4; /* bits 7-4 contain the task priority */2225 pVCpu->hwaccm.s.vmx.pVAPIC[0x80] = u8LastTPR; 2227 2226 2228 2227 /* Two options here: … … 2232 2231 * -> We don't need to be explicitely notified. There are enough world switches for detecting pending interrupts. 2233 2232 */ 2234 rc = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, (fPending) ? u8TPR : 0);2233 rc = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, (fPending) ? (u8LastTPR >> 4) : 0); /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 2235 2234 AssertRC(rc); 2236 2235 } … … 2427 2426 && u8LastTPR != pVCpu->hwaccm.s.vmx.pVAPIC[0x80]) 2428 2427 { 2429 rc = PDMApicSetTPR(pVCpu, pVCpu->hwaccm.s.vmx.pVAPIC[0x80] >> 4);2428 rc = PDMApicSetTPR(pVCpu, pVCpu->hwaccm.s.vmx.pVAPIC[0x80]); 2430 2429 AssertRC(rc); 2431 2430 }
Note:
See TracChangeset
for help on using the changeset viewer.