Changeset 107227 in vbox for trunk/src/VBox/VMM/VMMR3/EM.cpp
- Timestamp:
- Dec 4, 2024 3:20:14 PM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/EM.cpp
r107194 r107227 116 116 117 117 int rc = CFGMR3QueryBoolDef(pCfgEM, "IemExecutesAll", &pVM->em.s.fIemExecutesAll, 118 #if defined(RT_ARCH_ARM64) && defined(RT_OS_DARWIN) && !defined(VBOX_VMM_TARGET_ARMV8) 118 #if (defined(VBOX_VMM_TARGET_X86) && !defined(RT_ARCH_X86) && !defined(RT_ARCH_AMD64)) \ 119 || (defined(VBOX_VMM_TARGET_ARMV8) && !defined(RT_ARCH_ARM64)) /** @todo not main exec engine = iem/recomp would be better... */ 119 120 true 120 121 #else … … 706 707 #endif /* LOG_ENABLED || VBOX_STRICT */ 707 708 708 #if !defined(VBOX_VMM_TARGET_ARMV8)709 #ifdef VBOX_VMM_TARGET_X86 709 710 710 711 /** … … 852 853 } 853 854 854 #endif /* VBOX_VMM_TARGET_ ARMV8*/855 #endif /* VBOX_VMM_TARGET_X86 */ 855 856 856 857 /** … … 885 886 rc = EMR3HmSingleInstruction(pVM, pVCpu, 0 /*fFlags*/); 886 887 #endif 887 #if !defined(VBOX_VMM_TARGET_ARMV8)888 888 else if (pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_NEM) 889 889 rc = VBOXSTRICTRC_TODO(emR3NemSingleInstruction(pVM, pVCpu, 0 /*fFlags*/)); 890 890 else 891 891 { 892 #if defined(VBOX_VMM_TARGET_X86) /** @todo IEM/arm64 */ 892 893 rc = IEMExecOne(pVCpu); /** @todo add dedicated interface... */ 893 894 if (rc == VINF_SUCCESS || rc == VINF_EM_RESCHEDULE) 894 895 rc = VINF_EM_DBG_STEPPED; 896 #else 897 AssertFailed(); 898 rc = VBOXSTRICTRC_TODO(emR3NemSingleInstruction(pVM, pVCpu, 0 /*fFlags*/)); 899 #endif 895 900 } 896 901 902 #ifdef VBOX_VMM_TARGET_X86 897 903 if (rc != VINF_EM_EMULATE_SPLIT_LOCK) 898 904 { /* likely */ } … … 903 909 rc = VINF_EM_DBG_STEPPED; 904 910 } 905 #else906 AssertMsg(pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_NEM,907 ("%u\n", pVCpu->em.s.enmState));908 rc = VBOXSTRICTRC_TODO(emR3NemSingleInstruction(pVM, pVCpu, 0 /*fFlags*/));909 911 #endif 910 912 break; … … 1072 1074 #ifdef VBOX_VMM_TARGET_ARMV8 1073 1075 LogFlow(("emR3RecompilerExecute/%u: (pc=%RGv)\n", pVCpu->idCpu, (RTGCPTR)pVCpu->cpum.GstCtx.Pc.u64)); 1076 #elif defined(VBOX_VMM_TARGET_X86) 1077 LogFlow(("emR3RecompilerExecute/%u: (cs:eip=%04x:%RGv)\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.cs.Sel, (RTGCPTR)pVCpu->cpum.GstCtx.rip)); 1074 1078 #else 1075 LogFlow(("emR3RecompilerExecute/%u: (cs:eip=%04x:%RGv)\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.cs.Sel, (RTGCPTR)pVCpu->cpum.GstCtx.rip)); 1079 # error "port me" 1076 1080 #endif 1077 1081 … … 1085 1089 #ifdef LOG_ENABLED 1086 1090 # if defined(VBOX_VMM_TARGET_ARMV8) 1087 Log3(("EM: pc=%08 x\n", CPUMGetGuestFlatPC(pVCpu)));1088 # el se1091 Log3(("EM: pc=%08RX64\n", CPUMGetGuestFlatPC(pVCpu))); 1092 # elif defined(VBOX_VMM_TARGET_X86) 1089 1093 if (!pVCpu->cpum.GstCtx.eflags.Bits.u1VM) 1090 1094 Log(("EMR%d: %04X:%08RX64 RSP=%08RX64 IF=%d CR0=%x eflags=%x\n", CPUMGetGuestCPL(pVCpu), pVCpu->cpum.GstCtx.cs.Sel, … … 1093 1097 else 1094 1098 Log(("EMV86: %04X:%08X IF=%d\n", pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.eip, pVCpu->cpum.GstCtx.eflags.Bits.u1IF)); 1099 # else 1100 # error "port me" 1095 1101 # endif 1096 1102 #endif … … 1174 1180 * Check if we can switch back to the main execution engine now. 1175 1181 */ 1176 #if !defined(VBOX_VMM_TARGET_ARMV8)1182 #ifdef VBOX_WITH_HWVIRT 1177 1183 if (VM_IS_HM_ENABLED(pVM)) 1178 1184 { … … 1274 1280 PDMCritSectBothFF(pVM, pVCpu); 1275 1281 1276 #if !defined(VBOX_VMM_TARGET_ARMV8)1282 #ifdef VBOX_VMM_TARGET_X86 1277 1283 /* Update CR3 (Nested Paging case for HM). */ 1278 1284 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_CR3)) … … 1312 1318 } 1313 1319 1314 1315 #if !defined(VBOX_VMM_TARGET_ARMV8) 1320 #ifdef VBOX_VMM_TARGET_X86 1321 1316 1322 /** 1317 1323 * Helper for emR3ForcedActions() for VMX external interrupt VM-exit. … … 1323 1329 static int emR3VmxNstGstIntrIntercept(PVMCPU pVCpu) 1324 1330 { 1325 # ifdef VBOX_WITH_NESTED_HWVIRT_VMX1331 # ifdef VBOX_WITH_NESTED_HWVIRT_VMX 1326 1332 /* Handle the "external interrupt" VM-exit intercept. */ 1327 1333 if ( CPUMIsGuestVmxPinCtlsSet(&pVCpu->cpum.GstCtx, VMX_PIN_CTLS_EXT_INT_EXIT) … … 1334 1340 return VBOXSTRICTRC_VAL(rcStrict); 1335 1341 } 1336 # else1342 # else 1337 1343 RT_NOREF(pVCpu); 1338 # endif1344 # endif 1339 1345 return VINF_NO_CHANGE; 1340 1346 } … … 1350 1356 static int emR3SvmNstGstIntrIntercept(PVMCPU pVCpu) 1351 1357 { 1352 # ifdef VBOX_WITH_NESTED_HWVIRT_SVM1358 # ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1353 1359 /* Handle the physical interrupt intercept (can be masked by the nested hypervisor). */ 1354 1360 if (CPUMIsGuestSvmCtrlInterceptSet(pVCpu, &pVCpu->cpum.GstCtx, SVM_CTRL_INTERCEPT_INTR)) … … 1366 1372 return VINF_EM_TRIPLE_FAULT; 1367 1373 } 1368 # else1374 # else 1369 1375 NOREF(pVCpu); 1370 # endif1376 # endif 1371 1377 return VINF_NO_CHANGE; 1372 1378 } … … 1382 1388 static int emR3SvmNstGstVirtIntrIntercept(PVMCPU pVCpu) 1383 1389 { 1384 # ifdef VBOX_WITH_NESTED_HWVIRT_SVM1390 # ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1385 1391 if (CPUMIsGuestSvmCtrlInterceptSet(pVCpu, &pVCpu->cpum.GstCtx, SVM_CTRL_INTERCEPT_VINTR)) 1386 1392 { … … 1395 1401 return VINF_EM_TRIPLE_FAULT; 1396 1402 } 1397 # else1403 # else 1398 1404 NOREF(pVCpu); 1399 # endif1405 # endif 1400 1406 return VINF_NO_CHANGE; 1401 1407 } 1402 #endif 1403 1408 1409 #endif /* VBOX_VMM_TARGET_X86 */ 1404 1410 1405 1411 /** … … 1658 1664 TMR3TimerQueuesDo(pVM); 1659 1665 1660 #if !defined(VBOX_VMM_TARGET_ARMV8)1666 #ifdef VBOX_VMM_TARGET_X86 1661 1667 /* 1662 1668 * Pick up asynchronously posted interrupts into the APIC. … … 1803 1809 Assert(!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE | VMCPU_FF_VMX_MTF | VMCPU_FF_VMX_PREEMPT_TIMER)); 1804 1810 } 1805 # endif 1811 # endif /* VBOX_WITH_NESTED_HWVIRT_VMX */ 1806 1812 1807 1813 /* … … 1959 1965 } 1960 1966 1961 #else /* VBOX_VMM_TARGET_ARMV8 */1967 #else /* VBOX_VMM_TARGET_ARMV8 */ 1962 1968 bool fWakeupPending = false; 1963 1964 1969 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VTIMER_ACTIVATED)) 1965 1970 { … … 2081 2086 /* check that we got them all */ 2082 2087 AssertCompile(VM_FF_HIGH_PRIORITY_PRE_MASK == (VM_FF_TM_VIRTUAL_SYNC | VM_FF_DBGF | VM_FF_CHECK_VM_STATE | VM_FF_DEBUG_SUSPEND | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS)); 2083 #if defined(VBOX_VMM_TARGET_ARMV8)2088 #ifdef VBOX_VMM_TARGET_ARMV8 2084 2089 AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_IRQ | VMCPU_FF_INTERRUPT_FIQ | VMCPU_FF_DBGF)); 2090 #elif defined(VBOX_VMM_TARGET_X86) 2091 AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_DBGF | VMCPU_FF_INTERRUPT_NESTED_GUEST | VMCPU_FF_VMX_MTF | VMCPU_FF_VMX_APIC_WRITE | VMCPU_FF_VMX_PREEMPT_TIMER | VMCPU_FF_VMX_INT_WINDOW | VMCPU_FF_VMX_NMI_WINDOW)); 2085 2092 #else 2086 AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_DBGF | VMCPU_FF_INTERRUPT_NESTED_GUEST | VMCPU_FF_VMX_MTF | VMCPU_FF_VMX_APIC_WRITE | VMCPU_FF_VMX_PREEMPT_TIMER | VMCPU_FF_VMX_INT_WINDOW | VMCPU_FF_VMX_NMI_WINDOW)); 2093 # error "port me" 2087 2094 #endif 2088 2095 } … … 2209 2216 fFFDone = false; 2210 2217 2211 #if defined(VBOX_STRICT) && !defined(VBOX_VMM_TARGET_ARMV8)2218 #if defined(VBOX_STRICT) && defined(VBOX_VMM_TARGET_X86) 2212 2219 CPUMAssertGuestRFlagsCookie(pVM, pVCpu); 2213 2220 #endif … … 2233 2240 if (!pVM->em.s.fIemExecutesAll) 2234 2241 { 2235 #if !defined(VBOX_VMM_TARGET_ARMV8)2242 #ifdef VBOX_WITH_HWVIRT 2236 2243 if (VM_IS_HM_ENABLED(pVM)) 2237 2244 { … … 2597 2604 else if (rc == VINF_SUCCESS) 2598 2605 rc = VINF_EM_RESCHEDULE; /* Need to check whether we can run in HM or NEM again. */ 2599 #if ndef VBOX_VMM_TARGET_ARMV82606 #ifdef VBOX_VMM_TARGET_X86 2600 2607 if (rc != VINF_EM_EMULATE_SPLIT_LOCK) 2601 2608 { /* likely */ } … … 2624 2631 if (TRPMHasTrap(pVCpu)) 2625 2632 rc = VINF_EM_RESCHEDULE; 2626 #if !defined(VBOX_VMM_TARGET_ARMV8)2633 #ifdef VBOX_VMM_TARGET_X86 2627 2634 /* MWAIT has a special extension where it's woken up when 2628 2635 an interrupt is pending even when IF=0. */ … … 2649 2656 else 2650 2657 { 2651 #if defined(VBOX_VMM_TARGET_ARMV8)2658 #ifdef VBOX_VMM_TARGET_ARMV8 2652 2659 const uint32_t fWaitHalted = 0; /* WFI/WFE always return when an interrupt happens. */ 2653 #el se2660 #elif defined(VBOX_VMM_TARGET_X86) 2654 2661 const uint32_t fWaitHalted = (CPUMGetGuestEFlags(pVCpu) & X86_EFL_IF) ? 0 : VMWAITHALTED_F_IGNORE_IRQS; 2655 2662 #endif 2656 2663 rc = VMR3WaitHalted(pVM, pVCpu, fWaitHalted); 2664 2657 2665 /* We're only interested in NMI/SMIs here which have their own FFs, so we don't need to 2658 2666 check VMCPU_FF_UPDATE_APIC here. */ 2659 2667 if ( rc == VINF_SUCCESS 2660 #if defined(VBOX_VMM_TARGET_ARMV8) 2661 && VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI | VMCPU_FF_INTERRUPT_SMI | VMCPU_FF_VTIMER_ACTIVATED 2662 | VMCPU_FF_INTERRUPT_FIQ | VMCPU_FF_INTERRUPT_IRQ) 2668 #ifdef VBOX_VMM_TARGET_ARMV8 2669 && VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI | VMCPU_FF_INTERRUPT_SMI 2670 | VMCPU_FF_INTERRUPT_FIQ | VMCPU_FF_INTERRUPT_IRQ 2671 | VMCPU_FF_VTIMER_ACTIVATED) 2672 #elif defined(VBOX_VMM_TARGET_X86) 2673 && VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI | VMCPU_FF_INTERRUPT_SMI | VMCPU_FF_UNHALT) 2663 2674 #else 2664 && VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI | VMCPU_FF_INTERRUPT_SMI | VMCPU_FF_UNHALT) 2675 # error "port me" 2665 2676 #endif 2666 2677 )
Note:
See TracChangeset
for help on using the changeset viewer.