Changeset 107113 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Nov 22, 2024 10:48:00 AM (3 months ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 1 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r106061 r107113 33 33 #define VMCPU_INCL_CPUM_GST_CTX /* for macOS hack */ 34 34 #include "APICInternal.h" 35 #include <VBox/vmm/apic.h>36 35 #include <VBox/vmm/pdmdev.h> 37 36 #include <VBox/vmm/pdmapi.h> … … 418 417 419 418 /** 420 * Returns whether the APIC is hardware enabled or not. 421 * 422 * @returns true if enabled, false otherwise. 423 * @param pVCpu The cross context virtual CPU structure. 424 */ 425 VMM_INT_DECL(bool) APICIsEnabled(PCVMCPUCC pVCpu) 419 * @interface_method_impl{PDMAPICBACKEND,pfnisEnabled} 420 */ 421 static DECLCALLBACK(bool) apicIsEnabled(PCVMCPUCC pVCpu) 426 422 { 427 423 PCAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu); … … 464 460 * @param offReg The offset of the register being read. 465 461 */ 466 DECLINLINE(uint32_t) apicReadRaw32(PCXAPICPAGE pXApicPage, uint16_t offReg) 467 { 468 Assert(offReg < sizeof(*pXApicPage) - sizeof(uint32_t)); 469 uint8_t const *pbXApic = (const uint8_t *)pXApicPage; 462 static DECLCALLBACK(uint32_t) apicReadRaw32(PCVMCPUCC pVCpu, uint16_t offReg) 463 { 464 PCXAPICPAGE pcXApicPage = VMCPU_TO_CXAPICPAGE(pVCpu); 465 Assert(offReg < sizeof(*pcXApicPage) - sizeof(uint32_t)); 466 uint8_t const *pbXApic = (const uint8_t *)pcXApicPage; 470 467 uint32_t const uValue = *(const uint32_t *)(pbXApic + offReg); 471 468 return uValue; … … 638 635 { 639 636 PVMCPUCC pItVCpu = pVM->CTX_SUFF(apCpus)[idCpu]; 640 if ( APICIsEnabled(pItVCpu))641 fAccepted = apicPostInterrupt(pItVCpu, uVector, enmTriggerMode, uSrcTag);637 if (apicIsEnabled(pItVCpu)) 638 fAccepted = apicPostInterrupt(pItVCpu, uVector, enmTriggerMode, false /* fAutoEoi */, uSrcTag); 642 639 } 643 640 break; … … 649 646 AssertMsgBreak(idCpu < pVM->cCpus, ("APIC: apicSendIntr: No CPU found for lowest-priority delivery mode! idCpu=%u\n", idCpu)); 650 647 PVMCPUCC pVCpuDst = pVM->CTX_SUFF(apCpus)[idCpu]; 651 if ( APICIsEnabled(pVCpuDst))652 fAccepted = apicPostInterrupt(pVCpuDst, uVector, enmTriggerMode, uSrcTag);648 if (apicIsEnabled(pVCpuDst)) 649 fAccepted = apicPostInterrupt(pVCpuDst, uVector, enmTriggerMode, false /* fAutoEoi */, uSrcTag); 653 650 else 654 651 AssertMsgFailed(("APIC: apicSendIntr: Target APIC not enabled in lowest-priority delivery mode! idCpu=%u\n", idCpu)); … … 674 671 { 675 672 PVMCPUCC pItVCpu = pVM->CTX_SUFF(apCpus)[idCpu]; 676 if ( APICIsEnabled(pItVCpu))673 if (apicIsEnabled(pItVCpu)) 677 674 { 678 675 Log2(("APIC: apicSendIntr: Raising NMI on VCPU%u\n", idCpu)); … … 1114 1111 * 1115 1112 * @remarks This function is used by both x2APIC interface and the Hyper-V 1116 * interface, see APICHvSetIcr. The Hyper-V spec isn't clear what1117 * happens when invalid bits are set. For the time being, it will 1118 * \#GP likea regular x2APIC access.1119 */ 1120 static VBOXSTRICTRCapicSetIcr(PVMCPUCC pVCpu, uint64_t u64Icr, int rcRZ)1113 * interface, see PDMApicHvSetIcr. The Hyper-V spec isn't clear what 1114 * happens when invalid bits are set. For the time being, it will \#GP like 1115 * a regular x2APIC access. 1116 */ 1117 static DECLCALLBACK(VBOXSTRICTRC) apicSetIcr(PVMCPUCC pVCpu, uint64_t u64Icr, int rcRZ) 1121 1118 { 1122 1119 VMCPU_ASSERT_EMT(pVCpu); … … 1201 1198 * 1202 1199 * In all other instances, whenever the TPR or ISR changes, we need to update the PPR 1203 * as well (e.g. like we do manually in apic R3InitIpi and by calling apicUpdatePpr).1200 * as well (e.g. like we do manually in apicInitIpi and by calling apicUpdatePpr). 1204 1201 */ 1205 1202 PCAPIC pApic = VM_TO_APIC(pVCpu->CTX_SUFF(pVM)); … … 1249 1246 * this write. 1250 1247 */ 1251 static VBOXSTRICTRCapicSetEoi(PVMCPUCC pVCpu, uint32_t uEoi, bool fForceX2ApicBehaviour)1248 static DECLCALLBACK(VBOXSTRICTRC) apicSetEoi(PVMCPUCC pVCpu, uint32_t uEoi, bool fForceX2ApicBehaviour) 1252 1249 { 1253 1250 VMCPU_ASSERT_EMT(pVCpu); … … 1283 1280 * 1284 1281 * The broadcast to I/O APIC can re-trigger new interrupts to arrive via the bus. However, 1285 * APICUpdatePendingInterrupts() which updates TMR can only be done from EMT which we1282 * apicUpdatePendingInterrupts() which updates TMR can only be done from EMT which we 1286 1283 * currently are on, so no possibility of concurrent updates. 1287 1284 */ … … 1647 1644 * @param pVCpu The cross context virtual CPU structure. 1648 1645 */ 1649 DECLINLINE(uint64_t) apicGetIcrNoCheck(PVMCPUCC pVCpu)1646 static DECLCALLBACK(uint64_t) apicGetIcrNoCheck(PVMCPUCC pVCpu) 1650 1647 { 1651 1648 PCX2APICPAGE pX2ApicPage = VMCPU_TO_CX2APICPAGE(pVCpu); … … 1671 1668 Assert(offReg <= XAPIC_OFF_MAX_VALID); 1672 1669 1673 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu);1674 1670 uint32_t uValue = 0; 1675 1671 VBOXSTRICTRC rc = VINF_SUCCESS; … … 1708 1704 && offReg != XAPIC_OFF_ICR_HI 1709 1705 && offReg != XAPIC_OFF_EOI)); 1710 uValue = apicReadRaw32(p XApicPage, offReg);1706 uValue = apicReadRaw32(pVCpu, offReg); 1711 1707 Log2(("APIC%u: apicReadRegister: offReg=%#x uValue=%#x\n", pVCpu->idCpu, offReg, uValue)); 1712 1708 break; … … 1882 1878 1883 1879 /** 1884 * Reads an APIC MSR. 1885 * 1886 * @returns Strict VBox status code. 1887 * @param pVCpu The cross context virtual CPU structure. 1888 * @param u32Reg The MSR being read. 1889 * @param pu64Value Where to store the read value. 1890 */ 1891 VMM_INT_DECL(VBOXSTRICTRC) APICReadMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t *pu64Value) 1880 * @interface_method_impl{PDMAPICBACKEND,pfnReadMsr} 1881 */ 1882 static DECLCALLBACK(VBOXSTRICTRC) apicReadMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t *pu64Value) 1892 1883 { 1893 1884 /* … … 1902 1893 */ 1903 1894 PCAPIC pApic = VM_TO_APIC(pVCpu->CTX_SUFF(pVM)); 1904 if ( APICIsEnabled(pVCpu))1895 if (apicIsEnabled(pVCpu)) 1905 1896 { /* likely */ } 1906 1897 else … … 1985 1976 case MSR_IA32_X2APIC_TIMER_DCR: 1986 1977 { 1987 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu);1988 1978 uint16_t const offReg = X2APIC_GET_XAPIC_OFF(u32Reg); 1989 *pu64Value = apicReadRaw32(p XApicPage, offReg);1979 *pu64Value = apicReadRaw32(pVCpu, offReg); 1990 1980 break; 1991 1981 } … … 2030 2020 2031 2021 /** 2032 * Writes an APIC MSR. 2033 * 2034 * @returns Strict VBox status code. 2035 * @param pVCpu The cross context virtual CPU structure. 2036 * @param u32Reg The MSR being written. 2037 * @param u64Value The value to write. 2038 */ 2039 VMM_INT_DECL(VBOXSTRICTRC) APICWriteMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t u64Value) 2022 * @interface_method_impl{PDMAPICBACKEND,pfnWriteMsr} 2023 */ 2024 static DECLCALLBACK(VBOXSTRICTRC) apicWriteMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t u64Value) 2040 2025 { 2041 2026 /* … … 2049 2034 */ 2050 2035 PCAPIC pApic = VM_TO_APIC(pVCpu->CTX_SUFF(pVM)); 2051 if ( APICIsEnabled(pVCpu))2036 if (apicIsEnabled(pVCpu)) 2052 2037 { /* likely */ } 2053 2038 else … … 2135 2120 { 2136 2121 uint8_t const uVector = XAPIC_SELF_IPI_GET_VECTOR(u32Value); 2137 apicPostInterrupt(pVCpu, uVector, XAPICTRIGGERMODE_EDGE, 0 /* uSrcTag */);2122 apicPostInterrupt(pVCpu, uVector, XAPICTRIGGERMODE_EDGE, false /* fAutoEoi */, 0 /* uSrcTag */); 2138 2123 rcStrict = VINF_SUCCESS; 2139 2124 break; … … 2248 2233 2249 2234 /** 2250 * Initializes per-VCPU APIC to the state following an INIT reset 2251 * ("Wait-for-SIPI" state). 2252 * 2253 * @param pVCpu The cross context virtual CPU structure. 2254 */ 2255 void apicInitIpi(PVMCPUCC pVCpu) 2235 * @interface_method_impl{PDMAPICBACKEND,pfnInitIpi} 2236 */ 2237 static DECLCALLBACK(void) apicInitIpi(PVMCPUCC pVCpu) 2256 2238 { 2257 2239 VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu); … … 2377 2359 2378 2360 /** 2379 * Sets the APIC base MSR. 2380 * 2381 * @returns VBox status code - no informational ones, esp. not 2382 * VINF_CPUM_R3_MSR_WRITE. Only the following two: 2383 * @retval VINF_SUCCESS 2384 * @retval VERR_CPUM_RAISE_GP_0 2385 * 2386 * @param pVCpu The cross context virtual CPU structure. 2387 * @param u64BaseMsr The value to set. 2388 */ 2389 VMM_INT_DECL(int) APICSetBaseMsr(PVMCPUCC pVCpu, uint64_t u64BaseMsr) 2361 * @interface_method_impl{PDMAPICBACKEND,pfnSetBaseMsr} 2362 */ 2363 static DECLCALLBACK(int) apicSetBaseMsr(PVMCPUCC pVCpu, uint64_t u64BaseMsr) 2390 2364 { 2391 2365 Assert(pVCpu); … … 2397 2371 uint64_t uBaseMsr = pApicCpu->uApicBaseMsr; 2398 2372 2399 Log2(("APIC%u: ApicSetBaseMsr: u64BaseMsr=%#RX64 enmNewMode=%s enmOldMode=%s\n", pVCpu->idCpu, u64BaseMsr,2373 Log2(("APIC%u: apicSetBaseMsr: u64BaseMsr=%#RX64 enmNewMode=%s enmOldMode=%s\n", pVCpu->idCpu, u64BaseMsr, 2400 2374 apicGetModeName(enmNewMode), apicGetModeName(enmOldMode))); 2401 2375 … … 2517 2491 2518 2492 /** 2519 * Gets the APIC base MSR (no checks are performed wrt APIC hardware or its 2520 * state). 2521 * 2522 * @returns The base MSR value. 2523 * @param pVCpu The cross context virtual CPU structure. 2524 */ 2525 VMM_INT_DECL(uint64_t) APICGetBaseMsrNoCheck(PCVMCPUCC pVCpu) 2493 * @interface_method_impl{PDMAPICBACKEND,pfnGetBaseMsrNoCheck} 2494 */ 2495 static DECLCALLBACK(uint64_t) apicGetBaseMsrNoCheck(PCVMCPUCC pVCpu) 2526 2496 { 2527 2497 VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu); … … 2532 2502 2533 2503 /** 2534 * Gets the APIC base MSR. 2535 * 2536 * @returns Strict VBox status code. 2537 * @param pVCpu The cross context virtual CPU structure. 2538 * @param pu64Value Where to store the MSR value. 2539 */ 2540 VMM_INT_DECL(VBOXSTRICTRC) APICGetBaseMsr(PVMCPUCC pVCpu, uint64_t *pu64Value) 2504 * @interface_method_impl{PDMAPICBACKEND,pfnGetBaseMsr} 2505 */ 2506 static DECLCALLBACK(VBOXSTRICTRC) apicGetBaseMsr(PVMCPUCC pVCpu, uint64_t *pu64Value) 2541 2507 { 2542 2508 VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu); … … 2545 2511 if (pApic->enmMaxMode != PDMAPICMODE_NONE) 2546 2512 { 2547 *pu64Value = APICGetBaseMsrNoCheck(pVCpu);2513 *pu64Value = apicGetBaseMsrNoCheck(pVCpu); 2548 2514 return VINF_SUCCESS; 2549 2515 } … … 2556 2522 2557 2523 /** 2558 * Sets the TPR (Task Priority Register). 2559 * 2560 * @retval VINF_SUCCESS 2561 * @retval VERR_CPUM_RAISE_GP_0 2562 * @retval VERR_PDM_NO_APIC_INSTANCE 2563 * 2564 * @param pVCpu The cross context virtual CPU structure. 2565 * @param u8Tpr The TPR value to set. 2566 */ 2567 VMMDECL(int) APICSetTpr(PVMCPUCC pVCpu, uint8_t u8Tpr) 2568 { 2569 if (APICIsEnabled(pVCpu)) 2570 return apicSetTprEx(pVCpu, u8Tpr, false /* fForceX2ApicBehaviour */); 2524 * @interface_method_impl{PDMAPICBACKEND,pfnSetTpr} 2525 */ 2526 static DECLCALLBACK(int) apicSetTpr(PVMCPUCC pVCpu, uint8_t u8Tpr, bool fForceX2ApicBehaviour) 2527 { 2528 if (apicIsEnabled(pVCpu)) 2529 return apicSetTprEx(pVCpu, u8Tpr, fForceX2ApicBehaviour); 2571 2530 return VERR_PDM_NO_APIC_INSTANCE; 2572 2531 } … … 2597 2556 2598 2557 /** 2599 * Gets the APIC TPR (Task Priority Register). 2600 * 2601 * @returns VBox status code. 2602 * @param pVCpu The cross context virtual CPU structure. 2603 * @param pu8Tpr Where to store the TPR. 2604 * @param pfPending Where to store whether there is a pending interrupt 2605 * (optional, can be NULL). 2606 * @param pu8PendingIntr Where to store the highest-priority pending 2607 * interrupt (optional, can be NULL). 2608 */ 2609 VMMDECL(int) APICGetTpr(PCVMCPUCC pVCpu, uint8_t *pu8Tpr, bool *pfPending, uint8_t *pu8PendingIntr) 2558 * @interface_method_impl{PDMAPICBACKEND,pfnGetTpr} 2559 */ 2560 static DECLCALLBACK(int) apicGetTpr(PCVMCPUCC pVCpu, uint8_t *pu8Tpr, bool *pfPending, uint8_t *pu8PendingIntr) 2610 2561 { 2611 2562 VMCPU_ASSERT_EMT(pVCpu); 2612 if ( APICIsEnabled(pVCpu))2563 if (apicIsEnabled(pVCpu)) 2613 2564 { 2614 2565 PCXAPICPAGE pXApicPage = VMCPU_TO_CXAPICPAGE(pVCpu); … … 2632 2583 2633 2584 /** 2634 * Gets the APIC timer frequency. 2635 * 2636 * @returns Strict VBox status code. 2637 * @param pVM The cross context VM structure. 2638 * @param pu64Value Where to store the timer frequency. 2639 */ 2640 VMM_INT_DECL(int) APICGetTimerFreq(PVMCC pVM, uint64_t *pu64Value) 2585 * @interface_method_impl{PDMAPICBACKEND,pfnGetTimerFreq} 2586 */ 2587 static DECLCALLBACK(int) apicGetTimerFreq(PVMCC pVM, uint64_t *pu64Value) 2641 2588 { 2642 2589 /* … … 2647 2594 2648 2595 PVMCPUCC pVCpu = pVM->CTX_SUFF(apCpus)[0]; 2649 if ( APICIsEnabled(pVCpu))2596 if (apicIsEnabled(pVCpu)) 2650 2597 { 2651 2598 PCAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu); … … 2658 2605 2659 2606 /** 2660 * Delivers an interrupt message via the system bus. 2661 * 2662 * @returns VBox status code. 2663 * @param pVM The cross context VM structure. 2664 * @param uDest The destination mask. 2665 * @param uDestMode The destination mode. 2666 * @param uDeliveryMode The delivery mode. 2667 * @param uVector The interrupt vector. 2668 * @param uPolarity The interrupt line polarity. 2669 * @param uTriggerMode The trigger mode. 2670 * @param uSrcTag The interrupt source tag (debugging). 2671 */ 2672 VMM_INT_DECL(int) APICBusDeliver(PVMCC pVM, uint8_t uDest, uint8_t uDestMode, uint8_t uDeliveryMode, uint8_t uVector, 2673 uint8_t uPolarity, uint8_t uTriggerMode, uint32_t uSrcTag) 2607 * @interface_method_impl{PDMAPICBACKEND,pfnBusDeliver} 2608 */ 2609 static DECLCALLBACK(int) apicBusDeliver(PVMCC pVM, uint8_t uDest, uint8_t uDestMode, uint8_t uDeliveryMode, uint8_t uVector, 2610 uint8_t uPolarity, uint8_t uTriggerMode, uint32_t uSrcTag) 2674 2611 { 2675 2612 NOREF(uPolarity); … … 2678 2615 * If the APIC isn't enabled, do nothing and pretend success. 2679 2616 */ 2680 if ( APICIsEnabled(pVM->CTX_SUFF(apCpus)[0]))2617 if (apicIsEnabled(pVM->CTX_SUFF(apCpus)[0])) 2681 2618 { /* likely */ } 2682 2619 else … … 2710 2647 2711 2648 /** 2712 * Assert/de-assert the local APIC's LINT0/LINT1 interrupt pins. 2713 * 2714 * @returns Strict VBox status code. 2715 * @param pVCpu The cross context virtual CPU structure. 2716 * @param u8Pin The interrupt pin (0 for LINT0 or 1 for LINT1). 2717 * @param u8Level The level (0 for low or 1 for high). 2718 * @param rcRZ The return code if the operation cannot be performed in 2719 * the current context. 2720 * 2721 * @note All callers totally ignores the status code! 2722 */ 2723 VMM_INT_DECL(VBOXSTRICTRC) APICLocalInterrupt(PVMCPUCC pVCpu, uint8_t u8Pin, uint8_t u8Level, int rcRZ) 2649 * @interface_method_impl{PDMAPICBACKEND,pfnSetLocalInterrupt} 2650 */ 2651 static DECLCALLBACK(VBOXSTRICTRC) apicSetLocalInterrupt(PVMCPUCC pVCpu, uint8_t u8Pin, uint8_t u8Level, int rcRZ) 2724 2652 { 2725 2653 AssertReturn(u8Pin <= 1, VERR_INVALID_PARAMETER); … … 2729 2657 2730 2658 /* If the APIC is enabled, the interrupt is subject to LVT programming. */ 2731 if ( APICIsEnabled(pVCpu))2659 if (apicIsEnabled(pVCpu)) 2732 2660 { 2733 2661 PCXAPICPAGE pXApicPage = VMCPU_TO_CXAPICPAGE(pVCpu); … … 2741 2669 Assert(u8Pin < RT_ELEMENTS(s_au16LvtOffsets)); 2742 2670 uint16_t const offLvt = s_au16LvtOffsets[u8Pin]; 2743 uint32_t const uLvt = apicReadRaw32(p XApicPage, offLvt);2671 uint32_t const uLvt = apicReadRaw32(pVCpu, offLvt); 2744 2672 2745 2673 /* If software hasn't masked the interrupt in the LVT entry, proceed interrupt processing. */ … … 2831 2759 case XAPICDELIVERYMODE_EXTINT: 2832 2760 { 2833 Log2(("APIC%u: apic LocalInterrupt: %s ExtINT through LINT%u\n", pVCpu->idCpu,2761 Log2(("APIC%u: apicSetLocalInterrupt: %s ExtINT through LINT%u\n", pVCpu->idCpu, 2834 2762 u8Level ? "Raising" : "Lowering", u8Pin)); 2835 2763 if (u8Level) … … 2859 2787 { 2860 2788 /* LINT0 behaves as an external interrupt pin. */ 2861 Log2(("APIC%u: apic LocalInterrupt: APIC hardware-disabled, %s INTR\n", pVCpu->idCpu,2789 Log2(("APIC%u: apicSetLocalInterrupt: APIC hardware-disabled, %s INTR\n", pVCpu->idCpu, 2862 2790 u8Level ? "raising" : "lowering")); 2863 2791 if (u8Level) … … 2869 2797 { 2870 2798 /* LINT1 behaves as NMI. */ 2871 Log2(("APIC%u: apic LocalInterrupt: APIC hardware-disabled, raising NMI\n", pVCpu->idCpu));2799 Log2(("APIC%u: apicSetLocalInterrupt: APIC hardware-disabled, raising NMI\n", pVCpu->idCpu)); 2872 2800 apicSetInterruptFF(pVCpu, PDMAPICIRQ_NMI); 2873 2801 } … … 2879 2807 2880 2808 /** 2881 * Gets the next highest-priority interrupt from the APIC, marking it as an 2882 * "in-service" interrupt. 2883 * 2884 * @returns VBox status code. 2885 * @param pVCpu The cross context virtual CPU structure. 2886 * @param pu8Vector Where to store the vector. 2887 * @param puSrcTag Where to store the interrupt source tag (debugging). 2888 */ 2889 VMM_INT_DECL(int) APICGetInterrupt(PVMCPUCC pVCpu, uint8_t *pu8Vector, uint32_t *puSrcTag) 2809 * @interface_method_impl{PDMAPICBACKEND,pfnGetInterrupt} 2810 */ 2811 static DECLCALLBACK(int) apicGetInterrupt(PVMCPUCC pVCpu, uint8_t *pu8Vector, uint32_t *puSrcTag) 2890 2812 { 2891 2813 VMCPU_ASSERT_EMT(pVCpu); … … 2895 2817 2896 2818 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu); 2897 bool const fApicHwEnabled = APICIsEnabled(pVCpu);2819 bool const fApicHwEnabled = apicIsEnabled(pVCpu); 2898 2820 if ( fApicHwEnabled 2899 2821 && pXApicPage->svr.u.fApicSoftwareEnable) … … 3112 3034 * @param uVector The vector of the interrupt to be posted. 3113 3035 * @param enmTriggerMode The trigger mode of the interrupt. 3036 * @param fAutoEoi Whether this interrupt has automatic EOI 3037 * treatment. 3114 3038 * @param uSrcTag The interrupt source tag (debugging). 3115 3039 * 3116 3040 * @thread Any. 3117 3041 */ 3118 bool apicPostInterrupt(PVMCPUCC pVCpu, uint8_t uVector, XAPICTRIGGERMODE enmTriggerMode, uint32_t uSrcTag) 3042 DECLCALLBACK(bool) apicPostInterrupt(PVMCPUCC pVCpu, uint8_t uVector, XAPICTRIGGERMODE enmTriggerMode, bool fAutoEoi, 3043 uint32_t uSrcTag) 3119 3044 { 3120 3045 Assert(pVCpu); 3121 3046 Assert(uVector > XAPIC_ILLEGAL_VECTOR_END); 3047 RT_NOREF(fAutoEoi); 3122 3048 3123 3049 PVMCC pVM = pVCpu->CTX_SUFF(pVM); … … 3254 3180 3255 3181 3182 #if 0 3256 3183 /** 3257 3184 * Queues a pending interrupt as in-service. … … 3322 3249 } 3323 3250 } 3324 3325 3326 /** 3327 * Updates pending interrupts from the pending-interrupt bitmaps to the IRR. 3328 * 3329 * @param pVCpu The cross context virtual CPU structure. 3330 * 3331 * @note NEM/win is ASSUMING the an up to date TPR is not required here. 3332 */ 3333 VMMDECL(void) APICUpdatePendingInterrupts(PVMCPUCC pVCpu) 3251 #endif 3252 3253 3254 /** 3255 * @interface_method_impl{PDMAPICBACKEND,pfnUpdatePendingInterrupts} 3256 */ 3257 static DECLCALLBACK(void) apicUpdatePendingInterrupts(PVMCPUCC pVCpu) 3334 3258 { 3335 3259 VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu); … … 3339 3263 bool fHasPendingIntrs = false; 3340 3264 3341 Log3(("APIC%u: APICUpdatePendingInterrupts:\n", pVCpu->idCpu));3265 Log3(("APIC%u: apicUpdatePendingInterrupts:\n", pVCpu->idCpu)); 3342 3266 STAM_PROFILE_START(&pApicCpu->StatUpdatePendingIntrs, a); 3343 3267 … … 3403 3327 3404 3328 STAM_PROFILE_STOP(&pApicCpu->StatUpdatePendingIntrs, a); 3405 Log3(("APIC%u: APICUpdatePendingInterrupts: fHasPendingIntrs=%RTbool\n", pVCpu->idCpu, fHasPendingIntrs));3329 Log3(("APIC%u: apicUpdatePendingInterrupts: fHasPendingIntrs=%RTbool\n", pVCpu->idCpu, fHasPendingIntrs)); 3406 3330 3407 3331 if ( fHasPendingIntrs … … 3411 3335 3412 3336 3413 /** 3414 * Gets the highest priority pending interrupt. 3415 * 3416 * @returns true if any interrupt is pending, false otherwise. 3417 * @param pVCpu The cross context virtual CPU structure. 3418 * @param pu8PendingIntr Where to store the interrupt vector if the 3419 * interrupt is pending. 3420 */ 3421 VMM_INT_DECL(bool) APICGetHighestPendingInterrupt(PVMCPUCC pVCpu, uint8_t *pu8PendingIntr) 3422 { 3423 VMCPU_ASSERT_EMT(pVCpu); 3424 return apicGetHighestPendingInterrupt(pVCpu, pu8PendingIntr); 3425 } 3426 3427 3428 /** 3429 * Posts an interrupt to a target APIC, Hyper-V interface. 3430 * 3431 * @param pVCpu The cross context virtual CPU structure. 3432 * @param uVector The vector of the interrupt to be posted. 3433 * @param fAutoEoi Whether this interrupt has automatic EOI 3434 * treatment. 3435 * @param enmTriggerMode The trigger mode of the interrupt. 3436 * 3437 * @thread Any. 3438 */ 3439 VMM_INT_DECL(void) APICHvSendInterrupt(PVMCPUCC pVCpu, uint8_t uVector, bool fAutoEoi, XAPICTRIGGERMODE enmTriggerMode) 3440 { 3441 Assert(pVCpu); 3442 Assert(!fAutoEoi); /** @todo AutoEOI. */ 3443 RT_NOREF(fAutoEoi); 3444 apicPostInterrupt(pVCpu, uVector, enmTriggerMode, 0 /* uSrcTag */); 3445 } 3446 3447 3448 /** 3449 * Sets the Task Priority Register (TPR), Hyper-V interface. 3450 * 3451 * @returns Strict VBox status code. 3452 * @param pVCpu The cross context virtual CPU structure. 3453 * @param uTpr The TPR value to set. 3454 * 3455 * @remarks Validates like in x2APIC mode. 3456 */ 3457 VMM_INT_DECL(VBOXSTRICTRC) APICHvSetTpr(PVMCPUCC pVCpu, uint8_t uTpr) 3458 { 3459 Assert(pVCpu); 3460 VMCPU_ASSERT_EMT(pVCpu); 3461 return apicSetTprEx(pVCpu, uTpr, true /* fForceX2ApicBehaviour */); 3462 } 3463 3464 3465 /** 3466 * Gets the Task Priority Register (TPR), Hyper-V interface. 3467 * 3468 * @returns The TPR value. 3469 * @param pVCpu The cross context virtual CPU structure. 3470 */ 3471 VMM_INT_DECL(uint8_t) APICHvGetTpr(PVMCPUCC pVCpu) 3472 { 3473 Assert(pVCpu); 3474 VMCPU_ASSERT_EMT(pVCpu); 3475 3476 /* 3477 * The APIC could be operating in xAPIC mode and thus we should not use the apicReadMsr() 3478 * interface which validates the APIC mode and will throw a #GP(0) if not in x2APIC mode. 3479 * We could use the apicReadRegister() MMIO interface, but why bother getting the PDMDEVINS 3480 * pointer, so just directly read the APIC page. 3481 */ 3482 PCXAPICPAGE pXApicPage = VMCPU_TO_CXAPICPAGE(pVCpu); 3483 return apicReadRaw32(pXApicPage, XAPIC_OFF_TPR); 3484 } 3485 3486 3487 /** 3488 * Sets the Interrupt Command Register (ICR), Hyper-V interface. 3489 * 3490 * @returns Strict VBox status code. 3491 * @param pVCpu The cross context virtual CPU structure. 3492 * @param uIcr The ICR value to set. 3493 */ 3494 VMM_INT_DECL(VBOXSTRICTRC) APICHvSetIcr(PVMCPUCC pVCpu, uint64_t uIcr) 3495 { 3496 Assert(pVCpu); 3497 VMCPU_ASSERT_EMT(pVCpu); 3498 return apicSetIcr(pVCpu, uIcr, VINF_CPUM_R3_MSR_WRITE); 3499 } 3500 3501 3502 /** 3503 * Gets the Interrupt Command Register (ICR), Hyper-V interface. 3504 * 3505 * @returns The ICR value. 3506 * @param pVCpu The cross context virtual CPU structure. 3507 */ 3508 VMM_INT_DECL(uint64_t) APICHvGetIcr(PVMCPUCC pVCpu) 3509 { 3510 Assert(pVCpu); 3511 VMCPU_ASSERT_EMT(pVCpu); 3512 return apicGetIcrNoCheck(pVCpu); 3513 } 3514 3515 3516 /** 3517 * Sets the End-Of-Interrupt (EOI) register, Hyper-V interface. 3518 * 3519 * @returns Strict VBox status code. 3520 * @param pVCpu The cross context virtual CPU structure. 3521 * @param uEoi The EOI value. 3522 */ 3523 VMM_INT_DECL(VBOXSTRICTRC) APICHvSetEoi(PVMCPUCC pVCpu, uint32_t uEoi) 3524 { 3525 Assert(pVCpu); 3526 VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu); 3527 return apicSetEoi(pVCpu, uEoi, true /* fForceX2ApicBehaviour */); 3528 } 3529 3530 3531 /** 3532 * Gets the APIC page pointers for the specified VCPU. 3533 * 3534 * @returns VBox status code. 3535 * @param pVCpu The cross context virtual CPU structure. 3536 * @param pHCPhys Where to store the host-context physical address. 3537 * @param pR0Ptr Where to store the ring-0 address. 3538 * @param pR3Ptr Where to store the ring-3 address (optional). 3539 */ 3540 VMM_INT_DECL(int) APICGetApicPageForCpu(PCVMCPUCC pVCpu, PRTHCPHYS pHCPhys, PRTR0PTR pR0Ptr, PRTR3PTR pR3Ptr) 3337 #ifdef IN_RING0 3338 /** 3339 * @interface_method_impl{PDMAPICBACKEND,pfnGetApicPageForCpu} 3340 */ 3341 static DECLCALLBACK(int) apicR0VBoxGetApicPageForCpu(PCVMCPUCC pVCpu, PRTHCPHYS pHCPhys, PRTR0PTR pR0Ptr, PRTR3PTR pR3Ptr) 3541 3342 { 3542 3343 AssertReturn(pVCpu, VERR_INVALID_PARAMETER); … … 3553 3354 return VINF_SUCCESS; 3554 3355 } 3356 #endif /* IN_RING0 */ 3555 3357 3556 3358 #ifndef IN_RING3 … … 3572 3374 rc = PDMDevHlpApicSetUpContext(pDevIns); 3573 3375 AssertRCReturn(rc, rc); 3376 3377 rc = PDMApicRegisterBackend(pVM, PDMAPICBACKENDTYPE_VBOX, &g_ApicBackend); 3378 AssertLogRelRCReturn(rc, rc); 3574 3379 3575 3380 rc = PDMDevHlpMmioSetUpContext(pDevIns, pThis->hMmio, apicWriteMmio, apicReadMmio, NULL /*pvUser*/); … … 3654 3459 }; 3655 3460 3461 /** 3462 * The VirtualBox APIC backend. 3463 */ 3464 const PDMAPICBACKEND g_ApicBackend = 3465 { 3466 /* .pfnIsEnabled = */ apicIsEnabled, 3467 /* .pfnInitIpi = */ apicInitIpi, 3468 /* .pfnGetBaseMsrNoCheck = */ apicGetBaseMsrNoCheck, 3469 /* .pfnGetBaseMsr = */ apicGetBaseMsr, 3470 /* .pfnSetBaseMsr = */ apicSetBaseMsr, 3471 /* .pfnReadRaw32 = */ apicReadRaw32, 3472 /* .pfnReadMsr = */ apicReadMsr, 3473 /* .pfnWriteMsr = */ apicWriteMsr, 3474 /* .pfnGetTpr = */ apicGetTpr, 3475 /* .pfnSetTpr = */ apicSetTpr, 3476 /* .pfnGetIcrNoCheck = */ apicGetIcrNoCheck, 3477 /* .pfnSetIcr = */ apicSetIcr, 3478 /* .pfnGetTimerFreq = */ apicGetTimerFreq, 3479 /* .pfnSetLocalInterrupt = */ apicSetLocalInterrupt, 3480 /* .pfnGetInterrupt = */ apicGetInterrupt, 3481 /* .pfnPostInterrupt = */ apicPostInterrupt, 3482 /* .pfnUpdatePendingInterrupts = */ apicUpdatePendingInterrupts, 3483 /* .pfnBusDeliver = */ apicBusDeliver, 3484 /* .pfnSetEoi = */ apicSetEoi, 3485 #if defined(IN_RING3) 3486 /* .pfnHvSetCompatMode = */ apicR3HvSetCompatMode, 3487 #elif defined(IN_RING0) 3488 /* .pfnGetApicPageForCpu = */ apicR0VBoxGetApicPageForCpu, 3489 #endif 3490 }; 3491 -
trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
r106061 r107113 32 32 #define LOG_GROUP LOG_GROUP_CPUM 33 33 #include <VBox/vmm/cpum.h> 34 #include <VBox/vmm/ apic.h>34 #include <VBox/vmm/pdmapic.h> 35 35 #include <VBox/vmm/hm.h> 36 36 #include <VBox/vmm/hm_vmx.h> … … 235 235 { 236 236 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 237 return APICGetBaseMsr(pVCpu, puValue);237 return PDMApicGetBaseMsr(pVCpu, puValue); 238 238 } 239 239 … … 243 243 { 244 244 RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); RT_NOREF_PV(uValue); RT_NOREF_PV(uRawValue); 245 return APICSetBaseMsr(pVCpu, uValue);245 return PDMApicSetBaseMsr(pVCpu, uValue); 246 246 } 247 247 … … 1347 1347 } 1348 1348 #endif 1349 return APICReadMsr(pVCpu, idMsr, puValue);1349 return PDMApicReadMsr(pVCpu, idMsr, puValue); 1350 1350 } 1351 1351 … … 1367 1367 } 1368 1368 #endif 1369 return APICWriteMsr(pVCpu, idMsr, uValue);1369 return PDMApicWriteMsr(pVCpu, idMsr, uValue); 1370 1370 } 1371 1371 -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs-armv8.cpp
r106381 r107113 33 33 #include <VBox/vmm/cpum.h> 34 34 #include <VBox/vmm/dbgf.h> 35 #include <VBox/vmm/ apic.h>35 #include <VBox/vmm/pdmapic.h> 36 36 #include <VBox/vmm/pgm.h> 37 37 #include <VBox/vmm/mm.h> -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r106061 r107113 33 33 #include <VBox/vmm/cpum.h> 34 34 #include <VBox/vmm/dbgf.h> 35 #include <VBox/vmm/ apic.h>35 #include <VBox/vmm/pdmapic.h> 36 36 #include <VBox/vmm/pgm.h> 37 37 #include <VBox/vmm/mm.h> … … 716 716 CPUM_INT_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_APIC_TPR); 717 717 uint8_t u8Tpr; 718 int rc = APICGetTpr(pVCpu, &u8Tpr, NULL /* pfPending */, NULL /* pu8PendingIrq */);718 int rc = PDMApicGetTpr(pVCpu, &u8Tpr, NULL /* pfPending */, NULL /* pu8PendingIrq */); 719 719 if (RT_FAILURE(rc)) 720 720 { -
trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp
r106061 r107113 39 39 #include <VBox/vmm/pdmapi.h> 40 40 #include <VBox/vmm/pgm.h> 41 #include <VBox/vmm/ apic.h>41 #include <VBox/vmm/pdmapic.h> 42 42 #include <VBox/vmm/em.h> 43 43 #include "GIMHvInternal.h" … … 605 605 606 606 case MSR_GIM_HV_TPR: 607 *puValue = APICHvGetTpr(pVCpu);607 *puValue = PDMApicHvGetTpr(pVCpu); 608 608 return VINF_SUCCESS; 609 609 610 610 case MSR_GIM_HV_ICR: 611 *puValue = APICHvGetIcr(pVCpu);611 *puValue = PDMApicHvGetIcr(pVCpu); 612 612 return VINF_SUCCESS; 613 613 … … 630 630 case MSR_GIM_HV_APIC_FREQ: 631 631 { 632 int rc = APICGetTimerFreq(pVM, puValue);632 int rc = PDMApicGetTimerFreq(pVM, puValue); 633 633 if (RT_FAILURE(rc)) 634 634 return VERR_CPUM_RAISE_GP_0; … … 772 772 { 773 773 case MSR_GIM_HV_TPR: 774 return APICHvSetTpr(pVCpu, uRawValue);774 return PDMApicHvSetTpr(pVCpu, uRawValue); 775 775 776 776 case MSR_GIM_HV_EOI: 777 return APICHvSetEoi(pVCpu, uRawValue);777 return PDMApicHvSetEoi(pVCpu, uRawValue); 778 778 779 779 case MSR_GIM_HV_ICR: 780 return APICHvSetIcr(pVCpu, uRawValue);780 return PDMApicHvSetIcr(pVCpu, uRawValue); 781 781 782 782 case MSR_GIM_HV_GUEST_OS_ID: -
trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp
r106061 r107113 33 33 #define VMCPU_INCL_CPUM_GST_CTX 34 34 #include "HMInternal.h" 35 #include <VBox/vmm/ apic.h>35 #include <VBox/vmm/pdmapic.h> 36 36 #include <VBox/vmm/gim.h> 37 37 #include <VBox/vmm/iem.h> … … 103 103 { 104 104 bool fPending; 105 int rc = APICGetTpr(pVCpu, &u8Tpr, &fPending, NULL /* pu8PendingIrq */);105 int rc = PDMApicGetTpr(pVCpu, &u8Tpr, &fPending, NULL /* pu8PendingIrq */); 106 106 AssertRC(rc); 107 107 … … 126 126 u8Tpr = (uint8_t)pPatch->uSrcOperand; 127 127 128 int rc2 = APICSetTpr(pVCpu, u8Tpr);128 int rc2 = PDMApicSetTpr(pVCpu, u8Tpr); 129 129 AssertRC(rc2); 130 130 pCtx->rip += pPatch->cbOp; -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r106061 r107113 124 124 #include <VBox/vmm/iem.h> 125 125 #include <VBox/vmm/cpum.h> 126 #include <VBox/vmm/ apic.h>126 #include <VBox/vmm/pdmapic.h> 127 127 #include <VBox/vmm/pdm.h> 128 128 #include <VBox/vmm/pgm.h> -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp
r106362 r107113 35 35 #include <VBox/vmm/iem.h> 36 36 #include <VBox/vmm/cpum.h> 37 #include <VBox/vmm/ apic.h>37 #include <VBox/vmm/pdmapic.h> 38 38 #include <VBox/vmm/pdm.h> 39 39 #include <VBox/vmm/pgm.h> … … 5699 5699 #endif 5700 5700 uint8_t uTpr; 5701 int rc = APICGetTpr(pVCpu, &uTpr, NULL, NULL);5701 int rc = PDMApicGetTpr(pVCpu, &uTpr, NULL, NULL); 5702 5702 if (RT_SUCCESS(rc)) 5703 5703 crX = uTpr >> 4; … … 6298 6298 #endif 6299 6299 uint8_t const u8Tpr = (uint8_t)uNewCrX << 4; 6300 APICSetTpr(pVCpu, u8Tpr);6300 PDMApicSetTpr(pVCpu, u8Tpr); 6301 6301 rcStrict = VINF_SUCCESS; 6302 6302 break; -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp
r106061 r107113 33 33 #define VMCPU_INCL_CPUM_GST_CTX 34 34 #include <VBox/vmm/iem.h> 35 #include <VBox/vmm/ apic.h>35 #include <VBox/vmm/pdmapic.h> 36 36 #include <VBox/vmm/cpum.h> 37 37 #include <VBox/vmm/dbgf.h> -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp
r106061 r107113 33 33 #define VMCPU_INCL_CPUM_GST_CTX 34 34 #include <VBox/vmm/iem.h> 35 #include <VBox/vmm/apic.h>36 35 #include <VBox/vmm/cpum.h> 37 36 #include <VBox/vmm/dbgf.h> … … 49 48 #include <VBox/err.h> 50 49 #include <VBox/param.h> 50 #include <VBox/apic.h> 51 51 #include <VBox/disopcode-x86-amd64.h> 52 52 #include <iprt/asm-math.h> -
trunk/src/VBox/VMM/VMMAll/IEMAllIntprTables.h
r106061 r107113 42 42 #include <VBox/vmm/iem.h> 43 43 #include <VBox/vmm/cpum.h> 44 #include <VBox/vmm/ apic.h>44 #include <VBox/vmm/pdmapic.h> 45 45 #include <VBox/vmm/pdm.h> 46 46 #include <VBox/vmm/pgm.h> -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdFuncs.cpp
r106427 r107113 37 37 #include <VBox/vmm/iem.h> 38 38 #include <VBox/vmm/cpum.h> 39 #include <VBox/vmm/ apic.h>39 #include <VBox/vmm/pdmapic.h> 40 40 #include <VBox/vmm/pdm.h> 41 41 #include <VBox/vmm/pgm.h> -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdFuncsBltIn.cpp
r106061 r107113 37 37 #include <VBox/vmm/iem.h> 38 38 #include <VBox/vmm/cpum.h> 39 #include <VBox/vmm/ apic.h>39 #include <VBox/vmm/pdmapic.h> 40 40 #include <VBox/vmm/pdm.h> 41 41 #include <VBox/vmm/pgm.h> -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
r106453 r107113 52 52 #include <VBox/vmm/iem.h> 53 53 #include <VBox/vmm/cpum.h> 54 #include <VBox/vmm/ apic.h>54 #include <VBox/vmm/pdmapic.h> 55 55 #include <VBox/vmm/pdm.h> 56 56 #include <VBox/vmm/pgm.h> -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdTables.h
r106401 r107113 43 43 #include <VBox/vmm/iem.h> 44 44 #include <VBox/vmm/cpum.h> 45 #include <VBox/vmm/ apic.h>45 #include <VBox/vmm/pdmapic.h> 46 46 #include <VBox/vmm/pdm.h> 47 47 #include <VBox/vmm/pgm.h> -
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r106519 r107113 330 330 if (fWhat & CPUMCTX_EXTRN_OTHER_MSRS) 331 331 { 332 ADD_REG64(WHvX64RegisterApicBase, APICGetBaseMsrNoCheck(pVCpu));332 ADD_REG64(WHvX64RegisterApicBase, PDMApicGetBaseMsrNoCheck(pVCpu)); 333 333 ADD_REG64(WHvX64RegisterPat, pVCpu->cpum.GstCtx.msrPAT); 334 334 #if 0 /** @todo check if WHvX64RegisterMsrMtrrCap works here... */ … … 815 815 { 816 816 Assert(aenmNames[iReg] == WHvX64RegisterCr8); 817 APICSetTpr(pVCpu, (uint8_t)aValues[iReg].Reg64 << 4);817 PDMApicSetTpr(pVCpu, (uint8_t)aValues[iReg].Reg64 << 4); 818 818 iReg++; 819 819 } … … 950 950 { 951 951 Assert(aenmNames[iReg] == WHvX64RegisterApicBase); 952 const uint64_t uOldBase = APICGetBaseMsrNoCheck(pVCpu);952 const uint64_t uOldBase = PDMApicGetBaseMsrNoCheck(pVCpu); 953 953 if (aValues[iReg].Reg64 != uOldBase) 954 954 { 955 955 Log7(("NEM/%u: MSR APICBase changed %RX64 -> %RX64 (%RX64)\n", 956 956 pVCpu->idCpu, uOldBase, aValues[iReg].Reg64, aValues[iReg].Reg64 ^ uOldBase)); 957 int rc2 = APICSetBaseMsr(pVCpu, aValues[iReg].Reg64);957 int rc2 = PDMApicSetBaseMsr(pVCpu, aValues[iReg].Reg64); 958 958 AssertLogRelMsg(rc2 == VINF_SUCCESS, ("%Rrc %RX64\n", rc2, aValues[iReg].Reg64)); 959 959 } … … 1460 1460 pExitCtx->ExecutionState.InterruptShadow, 1461 1461 pExitCtx->Rip); 1462 APICSetTpr(pVCpu, pExitCtx->Cr8 << 4);1462 PDMApicSetTpr(pVCpu, pExitCtx->Cr8 << 4); 1463 1463 1464 1464 pVCpu->cpum.GstCtx.fExtrn &= ~(CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS | CPUMCTX_EXTRN_CS | CPUMCTX_EXTRN_INHIBIT_INT | CPUMCTX_EXTRN_APIC_TPR); … … 2392 2392 if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_UPDATE_APIC)) 2393 2393 { 2394 APICUpdatePendingInterrupts(pVCpu);2394 PDMApicUpdatePendingInterrupts(pVCpu); 2395 2395 if (!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC 2396 2396 | VMCPU_FF_INTERRUPT_NMI | VMCPU_FF_INTERRUPT_SMI)) … … 2479 2479 uint8_t bTpr = 0; 2480 2480 uint8_t bPendingIntr = 0; 2481 int rc = APICGetTpr(pVCpu, &bTpr, &fPendingIntr, &bPendingIntr);2481 int rc = PDMApicGetTpr(pVCpu, &bTpr, &fPendingIntr, &bPendingIntr); 2482 2482 AssertRC(rc); 2483 2483 *pfInterruptWindows |= ((bPendingIntr >> 4) << NEM_WIN_INTW_F_PRIO_SHIFT) | NEM_WIN_INTW_F_REGULAR; -
trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
r106061 r107113 39 39 # include <VBox/vmm/gic.h> 40 40 #else 41 # include <VBox/vmm/ apic.h>41 # include <VBox/vmm/pdmapic.h> 42 42 #endif 43 43 … … 76 76 77 77 uint32_t uTagSrc; 78 rc = APICGetInterrupt(pVCpu, pu8Interrupt, &uTagSrc);78 rc = PDMApicGetInterrupt(pVCpu, pu8Interrupt, &uTagSrc); 79 79 if (RT_SUCCESS(rc)) 80 80 { … … 326 326 VMM_INT_DECL(bool) PDMHasApic(PVM pVM) 327 327 { 328 return pVM->pdm.s. Apic.pDevInsR3 != NIL_RTR3PTR;328 return pVM->pdm.s.Ic.pDevInsR3 != NIL_RTR3PTR; 329 329 } 330 330 -
trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h
r106362 r107113 1700 1700 { 1701 1701 if ( PDMHasApic(pVCpu->CTX_SUFF(pVM)) 1702 && APICIsEnabled(pVCpu))1702 && PDMApicIsEnabled(pVCpu)) 1703 1703 { 1704 1704 /* … … 1710 1710 uint8_t u8Tpr = 0; 1711 1711 uint8_t u8PendingIntr = 0; 1712 int rc = APICGetTpr(pVCpu, &u8Tpr, &fPendingIntr, &u8PendingIntr);1712 int rc = PDMApicGetTpr(pVCpu, &u8Tpr, &fPendingIntr, &u8PendingIntr); 1713 1713 AssertRC(rc); 1714 1714 … … 4351 4351 */ 4352 4352 if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_UPDATE_APIC)) 4353 APICUpdatePendingInterrupts(pVCpu);4353 PDMApicUpdatePendingInterrupts(pVCpu); 4354 4354 4355 4355 /* … … 4971 4971 /* 4972 4972 * If the CPU doesn't have TPR shadowing, we will always get a VM-exit on TPR changes and 4973 * APICSetTpr() will end up setting the VMCPU_FF_INTERRUPT_APIC if required, so there is no4973 * PDMApicSetTpr() will end up setting the VMCPU_FF_INTERRUPT_APIC if required, so there is no 4974 4974 * need to re-set this force-flag here. 4975 4975 */
Note:
See TracChangeset
for help on using the changeset viewer.