Changeset 107113 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Nov 22, 2024 10:48:00 AM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 166080
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/APIC.cpp
r106518 r107113 33 33 #include <VBox/log.h> 34 34 #include "APICInternal.h" 35 #include <VBox/vmm/apic.h>36 35 #include <VBox/vmm/cpum.h> 37 36 #include <VBox/vmm/hm.h> … … 217 216 218 217 /** 219 * Receives an INIT IPI. 220 * 221 * @param pVCpu The cross context virtual CPU structure. 222 */ 223 VMMR3_INT_DECL(void) APICR3InitIpi(PVMCPU pVCpu) 224 { 225 VMCPU_ASSERT_EMT(pVCpu); 226 LogFlow(("APIC%u: APICR3InitIpi\n", pVCpu->idCpu)); 227 apicInitIpi(pVCpu); 228 } 229 230 231 /** 232 * Sets whether Hyper-V compatibility mode (MSR interface) is enabled or not. 233 * 234 * This mode is a hybrid of xAPIC and x2APIC modes, some caveats: 235 * 1. MSRs are used even ones that are missing (illegal) in x2APIC like DFR. 236 * 2. A single ICR is used by the guest to send IPIs rather than 2 ICR writes. 237 * 3. It is unclear what the behaviour will be when invalid bits are set, 238 * currently we follow x2APIC behaviour of causing a \#GP. 239 * 240 * @param pVM The cross context VM structure. 241 * @param fHyperVCompatMode Whether the compatibility mode is enabled. 242 */ 243 VMMR3_INT_DECL(void) APICR3HvSetCompatMode(PVM pVM, bool fHyperVCompatMode) 244 { 245 Assert(pVM); 218 * @interface_method_impl{PDMAPICBACKEND,pfnHvSetCompatMode} 219 */ 220 DECLCALLBACK(int) apicR3HvSetCompatMode(PVM pVM, bool fHyperVCompatMode) 221 { 246 222 PAPIC pApic = VM_TO_APIC(pVM); 223 if (pApic->fHyperVCompatMode ^ fHyperVCompatMode) 224 LogRel(("APIC: %s Hyper-V x2APIC compatibility mode\n", fHyperVCompatMode ? "Enabling" : "Disabling")); 225 247 226 pApic->fHyperVCompatMode = fHyperVCompatMode; 248 249 if (fHyperVCompatMode)250 LogRel(("APIC: Enabling Hyper-V x2APIC compatibility mode\n"));251 252 227 int rc = CPUMR3MsrRangesInsert(pVM, &g_MsrRange_x2Apic); 253 228 AssertLogRelRC(rc); 229 return rc; 254 230 } 255 231 … … 977 953 978 954 /* Update interrupts from the pending-interrupts bitmaps to the IRR. */ 979 APICUpdatePendingInterrupts(pVCpu);955 PDMApicUpdatePendingInterrupts(pVCpu); 980 956 981 957 /* Save the auxiliary data. */ … … 1139 1115 uint8_t uVector = XAPIC_LVT_GET_VECTOR(uLvtTimer); 1140 1116 Log2(("APIC%u: apicR3TimerCallback: Raising timer interrupt. uVector=%#x\n", pVCpu->idCpu, uVector)); 1141 apicPostInterrupt(pVCpu, uVector, XAPICTRIGGERMODE_EDGE, 0 /* uSrcTag */);1117 apicPostInterrupt(pVCpu, uVector, XAPICTRIGGERMODE_EDGE, false /* fAutoEoi */, 0 /* uSrcTag */); 1142 1118 } 1143 1119 … … 1471 1447 */ 1472 1448 rc = PDMDevHlpApicRegister(pDevIns); 1449 AssertLogRelRCReturn(rc, rc); 1450 1451 rc = PDMApicRegisterBackend(pVM, PDMAPICBACKENDTYPE_VBOX, &g_ApicBackend); 1473 1452 AssertLogRelRCReturn(rc, rc); 1474 1453 … … 1586 1565 1587 1566 APIC_PROF_COUNTER(&pApicCpu->StatUpdatePendingIntrs, 1588 "/PROF/CPU%u/APIC/UpdatePendingInterrupts", "Profiling of APICUpdatePendingInterrupts");1567 "/PROF/CPU%u/APIC/UpdatePendingInterrupts", "Profiling of apicUpdatePendingInterrupts"); 1589 1568 APIC_PROF_COUNTER(&pApicCpu->StatPostIntr, "/PROF/CPU%u/APIC/PostInterrupt", "Profiling of APICPostInterrupt"); 1590 1569 #endif -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r106061 r107113 122 122 #include <VBox/vmm/cpumctx-v1_6.h> 123 123 #include <VBox/vmm/pgm.h> 124 #include <VBox/vmm/ apic.h>124 #include <VBox/vmm/pdmapic.h> 125 125 #include <VBox/vmm/mm.h> 126 126 #include <VBox/vmm/em.h> -
trunk/src/VBox/VMM/VMMR3/CPUMDbg-armv8.cpp
r106365 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 "CPUMInternal-armv8.h" 37 37 #include <VBox/vmm/vm.h> -
trunk/src/VBox/VMM/VMMR3/CPUMDbg.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 "CPUMInternal.h" 37 37 #include <VBox/vmm/vm.h> … … 501 501 case 3: rc = CPUMSetGuestCR3(pVCpu, u64Value); break; 502 502 case 4: rc = CPUMSetGuestCR4(pVCpu, u64Value); break; 503 case 8: rc = APICSetTpr(pVCpu, (uint8_t)(u64Value << 4)); break;503 case 8: rc = PDMApicSetTpr(pVCpu, (uint8_t)(u64Value << 4)); break; 504 504 default: 505 505 AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE); -
trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp
r106061 r107113 69 69 #include <VBox/vmm/cpum.h> 70 70 #include <VBox/vmm/pgm.h> 71 #include <VBox/vmm/ apic.h>71 #include <VBox/vmm/pdmapic.h> 72 72 #include <VBox/vmm/dbgf.h> 73 73 #include <VBox/vmm/dbgfcorefmt.h> … … 390 390 pDbgfCpu->msrSFMASK = pCtx->msrSFMASK; 391 391 pDbgfCpu->msrKernelGSBase = pCtx->msrKERNELGSBASE; 392 pDbgfCpu->msrApicBase = APICGetBaseMsrNoCheck(pVCpu);392 pDbgfCpu->msrApicBase = PDMApicGetBaseMsrNoCheck(pVCpu); 393 393 pDbgfCpu->msrTscAux = CPUMGetGuestTscAux(pVCpu); 394 394 pDbgfCpu->aXcr[0] = pCtx->aXcr[0]; -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r106375 r107113 57 57 #include <VBox/vmm/dbgf.h> 58 58 #include <VBox/vmm/pgm.h> 59 #include <VBox/vmm/ apic.h>59 #include <VBox/vmm/pdmapic.h> 60 60 #include <VBox/vmm/tm.h> 61 61 #include <VBox/vmm/mm.h> … … 1659 1659 */ 1660 1660 if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_UPDATE_APIC)) 1661 APICUpdatePendingInterrupts(pVCpu);1661 PDMApicUpdatePendingInterrupts(pVCpu); 1662 1662 1663 1663 /* … … 2624 2624 { 2625 2625 if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_UPDATE_APIC)) 2626 APICUpdatePendingInterrupts(pVCpu);2626 PDMApicUpdatePendingInterrupts(pVCpu); 2627 2627 2628 2628 if (VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r106061 r107113 31 31 *********************************************************************************************************************************/ 32 32 #define LOG_GROUP LOG_GROUP_GIM 33 #include <VBox/vmm/ apic.h>33 #include <VBox/vmm/pdmapic.h> 34 34 #include <VBox/vmm/gim.h> 35 35 #include <VBox/vmm/cpum.h> … … 598 598 */ 599 599 if (pHv->uHyperHints & GIM_HV_HINT_X2APIC_MSRS) 600 APICR3HvSetCompatMode(pVM, true);600 PDMR3ApicHvSetCompatMode(pVM, true); 601 601 602 602 return rc; … … 1121 1121 uint8_t const uVector = MSR_GIM_HV_SINT_GET_VECTOR(uSint); 1122 1122 bool const fAutoEoi = MSR_GIM_HV_SINT_IS_AUTOEOI(uSint); 1123 APICHvSendInterrupt(pVCpu, uVector, fAutoEoi, XAPICTRIGGERMODE_EDGE);1123 PDMApicHvSendInterrupt(pVCpu, uVector, fAutoEoi, XAPICTRIGGERMODE_EDGE); 1124 1124 } 1125 1125 } -
trunk/src/VBox/VMM/VMMR3/GIMMinimal.cpp
r106061 r107113 34 34 #include <VBox/vmm/cpum.h> 35 35 #include <VBox/vmm/tm.h> 36 #include <VBox/vmm/ apic.h>36 #include <VBox/vmm/pdmapic.h> 37 37 #include "GIMInternal.h" 38 38 #include <VBox/vmm/vm.h> … … 106 106 * 107 107 * This is done in the init. completed routine as we need PDM to be 108 * initialized (otherwise APICGetTimerFreq() would fail).108 * initialized (otherwise PDMApicGetTimerFreq() would fail). 109 109 */ 110 110 CPUMCPUIDLEAF HyperLeaf; … … 123 123 */ 124 124 uint64_t uApicFreq; 125 rc = APICGetTimerFreq(pVM, &uApicFreq);125 rc = PDMApicGetTimerFreq(pVM, &uApicFreq); 126 126 AssertLogRelRCReturn(rc, rc); 127 127 -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-darwin.cpp
r106362 r107113 40 40 #include <VBox/vmm/iem.h> 41 41 #include <VBox/vmm/em.h> 42 #include <VBox/vmm/ apic.h>42 #include <VBox/vmm/pdmapic.h> 43 43 #include <VBox/vmm/pdm.h> 44 44 #include <VBox/vmm/hm.h> … … 1859 1859 vmxHCExportGuestApicTpr(pVCpu, pVmxTransient); 1860 1860 1861 rc = APICGetTpr(pVCpu, &pVmxTransient->u8GuestTpr, NULL /*pfPending*/, NULL /*pu8PendingIntr*/);1861 rc = PDMApicGetTpr(pVCpu, &pVmxTransient->u8GuestTpr, NULL /*pfPending*/, NULL /*pu8PendingIntr*/); 1862 1862 AssertRC(rc); 1863 1863 -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-linux.cpp
r106061 r107113 35 35 #include <VBox/vmm/iem.h> 36 36 #include <VBox/vmm/em.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/trpm.h> … … 704 704 * VBox always has the right base register value, so it's one directional. 705 705 */ 706 uint64_t const uApicBase = APICGetBaseMsrNoCheck(pVCpu);706 uint64_t const uApicBase = PDMApicGetBaseMsrNoCheck(pVCpu); 707 707 if ( (fExtrn & ( CPUMCTX_EXTRN_SREG_MASK | CPUMCTX_EXTRN_TABLE_MASK | CPUMCTX_EXTRN_CR_MASK 708 708 | CPUMCTX_EXTRN_EFER | CPUMCTX_EXTRN_APIC_TPR)) … … 1082 1082 if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_UPDATE_APIC)) 1083 1083 { 1084 APICUpdatePendingInterrupts(pVCpu);1084 PDMApicUpdatePendingInterrupts(pVCpu); 1085 1085 if (!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC 1086 1086 | VMCPU_FF_INTERRUPT_NMI | VMCPU_FF_INTERRUPT_SMI)) … … 1157 1157 */ 1158 1158 if (pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_APIC_TPR) 1159 APICSetTpr(pVCpu, (uint8_t)pRun->cr8 << 4);1159 PDMApicSetTpr(pVCpu, (uint8_t)pRun->cr8 << 4); 1160 1160 1161 1161 uint8_t bInterrupt; -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win-armv8.cpp
r107033 r107113 58 58 #include <VBox/vmm/iem.h> 59 59 #include <VBox/vmm/em.h> 60 #include <VBox/vmm/ apic.h>60 #include <VBox/vmm/pdmapic.h> 61 61 #include <VBox/vmm/pdm.h> 62 62 #include <VBox/vmm/dbgftrace.h> -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp
r106520 r107113 58 58 #include <VBox/vmm/iem.h> 59 59 #include <VBox/vmm/em.h> 60 #include <VBox/vmm/ apic.h>60 #include <VBox/vmm/pdmapic.h> 61 61 #include <VBox/vmm/pdm.h> 62 62 #include <VBox/vmm/dbgftrace.h> -
trunk/src/VBox/VMM/VMMR3/PDM.cpp
r106061 r107113 605 605 * The registered APIC. 606 606 */ 607 if (pVM->pdm.s. Apic.pDevInsRC)608 pVM->pdm.s. Apic.pDevInsRC+= offDelta;607 if (pVM->pdm.s.Ic.pDevInsRC) 608 pVM->pdm.s.Ic.pDevInsRC += offDelta; 609 609 610 610 /* -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r106061 r107113 4193 4193 * as they need to communicate and share state easily. 4194 4194 */ 4195 AssertMsgReturnStmt(pVM->pdm.s. Apic.pDevInsR3 == NULL,4195 AssertMsgReturnStmt(pVM->pdm.s.Ic.pDevInsR3 == NULL, 4196 4196 ("%s/%u: Only one APIC device is supported!\n", pDevIns->pReg->szName, pDevIns->iInstance), 4197 4197 RTCritSectRwLeaveExcl(&pVM->pdm.s.CoreListCritSectRw), … … 4201 4201 * Set the ring-3 and raw-mode bits, leave the ring-0 to ring-0 setup. 4202 4202 */ 4203 pVM->pdm.s. Apic.pDevInsR3 = pDevIns;4203 pVM->pdm.s.Ic.pDevInsR3 = pDevIns; 4204 4204 #ifdef VBOX_WITH_RAW_MODE_KEEP 4205 pVM->pdm.s. Apic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);4206 Assert(pVM->pdm.s. Apic.pDevInsRC || !VM_IS_RAW_MODE_ENABLED(pVM));4205 pVM->pdm.s.Ic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 4206 Assert(pVM->pdm.s.Ic.pDevInsRC || !VM_IS_RAW_MODE_ENABLED(pVM)); 4207 4207 #endif 4208 4208 … … 4245 4245 * If the I/O APIC does GC stuff so must the APIC. 4246 4246 */ 4247 AssertMsgReturnStmt(pVM->pdm.s. Apic.pDevInsR3 != NULL,4247 AssertMsgReturnStmt(pVM->pdm.s.Ic.pDevInsR3 != NULL, 4248 4248 ("Configuration error / Init order error! No APIC!\n"), 4249 4249 RTCritSectRwLeaveExcl(&pVM->pdm.s.CoreListCritSectRw), -
trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
r106061 r107113 36 36 #include <VBox/vmm/hm.h> 37 37 #ifndef VBOX_VMM_TARGET_ARMV8 38 # include <VBox/vmm/ apic.h>38 # include <VBox/vmm/pdmapic.h> 39 39 #endif 40 40 #include <VBox/vmm/vm.h> … … 72 72 #else 73 73 PVMCPU pVCpu = pVM->apCpusR3[0]; /* for PIC we always deliver to CPU 0, SMP uses APIC */ 74 APICLocalInterrupt(pVCpu, 0 /* u8Pin */, 1 /* u8Level */, VINF_SUCCESS /* rcRZ */);74 PDMApicSetLocalInterrupt(pVCpu, 0 /* u8Pin */, 1 /* u8Level */, VINF_SUCCESS /* rcRZ */); 75 75 #endif 76 76 } … … 91 91 #else 92 92 PVMCPU pVCpu = pVM->apCpusR3[0]; /* for PIC we always deliver to CPU 0, SMP uses APIC */ 93 APICLocalInterrupt(pVCpu, 0 /* u8Pin */, 0 /* u8Level */, VINF_SUCCESS /* rcRZ */);93 PDMApicSetLocalInterrupt(pVCpu, 0 /* u8Pin */, 0 /* u8Level */, VINF_SUCCESS /* rcRZ */); 94 94 #endif 95 95 } … … 146 146 #else 147 147 PVM pVM = pDevIns->Internal.s.pVMR3; 148 return APICBusDeliver(pVM, u8Dest, u8DestMode, u8DeliveryMode, uVector, u8Polarity, u8TriggerMode, uTagSrc);148 return PDMApicBusDeliver(pVM, u8Dest, u8DestMode, u8DeliveryMode, uVector, u8Polarity, u8TriggerMode, uTagSrc); 149 149 #endif 150 150 } -
trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp
r106476 r107113 38 38 # include <VBox/vmm/pmu.h> 39 39 #else 40 # include <VBox/vmm/ apic.h>40 # include <VBox/vmm/pdmapic.h> 41 41 #endif 42 42 #include <VBox/vmm/cfgm.h> -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r106061 r107113 69 69 #include <VBox/vmm/iem.h> 70 70 #include <VBox/vmm/nem.h> 71 #include <VBox/vmm/ apic.h>71 #include <VBox/vmm/pdmapic.h> 72 72 #include <VBox/vmm/tm.h> 73 73 #include <VBox/vmm/stam.h> -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r106061 r107113 133 133 # include <VBox/vmm/gic.h> 134 134 #else 135 # include <VBox/vmm/ apic.h>135 # include <VBox/vmm/pdmapic.h> 136 136 #endif 137 137 #include <VBox/vmm/ssm.h> … … 1435 1435 PDMR3ResetCpu(pVCpu); /* Only clears pending interrupts force flags */ 1436 1436 # if !defined(VBOX_VMM_TARGET_ARMV8) 1437 APICR3InitIpi(pVCpu);1437 PDMR3ApicInitIpi(pVCpu); 1438 1438 # endif 1439 1439 TRPMR3ResetCpu(pVCpu);
Note:
See TracChangeset
for help on using the changeset viewer.