- Timestamp:
- Feb 23, 2022 3:35:26 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
-
include/VBox/vmm/vm.h (modified) (5 diffs)
-
include/VBox/vmm/vmapi.h (modified) (1 diff)
-
src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp (modified) (2 diffs)
-
src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp (modified) (1 diff)
-
src/VBox/Main/idl/VirtualBox.xidl (modified) (2 diffs)
-
src/VBox/Main/src-client/MachineDebuggerImpl.cpp (modified) (1 diff)
-
src/VBox/VMM/Makefile.kmk (modified) (1 diff)
-
src/VBox/VMM/VMMAll/PGMAll.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/DBGF.cpp (modified) (1 diff)
-
src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/EM.cpp (modified) (4 diffs)
-
src/VBox/VMM/VMMR3/HM.cpp (modified) (6 diffs)
-
src/VBox/VMM/VMMR3/PDM.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/PDMDevHlp.cpp (modified) (1 diff)
-
src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/PDMLdr.cpp (modified) (3 diffs)
-
src/VBox/VMM/VMMR3/TM.cpp (modified) (1 diff)
-
src/VBox/VMM/VMMR3/VM.cpp (modified) (3 diffs)
-
src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/vm.h
r93650 r93901 1091 1091 1092 1092 /** 1093 * Checks whether raw-mode is used.1094 * 1095 * @retval true if eitheris used.1096 * @retval false if software virtualization (raw-mode) is used.1093 * Checks whether iem-executes-all-mode is used. 1094 * 1095 * @retval true if IEM is used. 1096 * @retval false if not. 1097 1097 * 1098 1098 * @param a_pVM The cross context VM structure. … … 1100 1100 * @internal 1101 1101 */ 1102 #ifdef VBOX_WITH_RAW_MODE 1103 # define VM_IS_RAW_MODE_ENABLED(a_pVM) ((a_pVM)->bMainExecutionEngine == VM_EXEC_ENGINE_RAW_MODE) 1104 #else 1105 # define VM_IS_RAW_MODE_ENABLED(a_pVM) (false) 1106 #endif 1102 #define VM_IS_EXEC_ENGINE_IEM(a_pVM) ((a_pVM)->bMainExecutionEngine == VM_EXEC_ENGINE_IEM) 1107 1103 1108 1104 /** … … 1113 1109 * 1114 1110 * @param a_pVM The cross context VM structure. 1115 * @sa VM_IS_ RAW_MODE_ENABLED, VM_IS_HM_ENABLED, VM_IS_NEM_ENABLED.1111 * @sa VM_IS_EXEC_ENGINE_IEM, VM_IS_HM_ENABLED, VM_IS_NEM_ENABLED. 1116 1112 * @internal 1117 1113 */ 1118 #define VM_IS_HM_OR_NEM_ENABLED(a_pVM) ((a_pVM)->bMainExecutionEngine != VM_EXEC_ENGINE_ RAW_MODE)1114 #define VM_IS_HM_OR_NEM_ENABLED(a_pVM) ((a_pVM)->bMainExecutionEngine != VM_EXEC_ENGINE_IEM) 1119 1115 1120 1116 /** … … 1125 1121 * 1126 1122 * @param a_pVM The cross context VM structure. 1127 * @sa VM_IS_NEM_ENABLED, VM_IS_ RAW_MODE_ENABLED, VM_IS_HM_OR_NEM_ENABLED.1123 * @sa VM_IS_NEM_ENABLED, VM_IS_EXEC_ENGINE_IEM, VM_IS_HM_OR_NEM_ENABLED. 1128 1124 * @internal 1129 1125 */ … … 1137 1133 * 1138 1134 * @param a_pVM The cross context VM structure. 1139 * @sa VM_IS_HM_ENABLED, VM_IS_ RAW_MODE_ENABLED, VM_IS_HM_OR_NEM_ENABLED.1135 * @sa VM_IS_HM_ENABLED, VM_IS_EXEC_ENGINE_IEM, VM_IS_HM_OR_NEM_ENABLED. 1140 1136 * @internal 1141 1137 */ -
trunk/include/VBox/vmm/vmapi.h
r93444 r93901 48 48 /** Has not yet been set. */ 49 49 #define VM_EXEC_ENGINE_NOT_SET UINT8_C(0) 50 /** Raw-mode. */51 #define VM_EXEC_ENGINE_ RAW_MODEUINT8_C(1)50 /** The interpreter (IEM). */ 51 #define VM_EXEC_ENGINE_IEM UINT8_C(1) 52 52 /** Hardware assisted virtualization thru HM. */ 53 53 #define VM_EXEC_ENGINE_HW_VIRT UINT8_C(2) -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r93460 r93901 4297 4297 " [STEP=%d LOG=%d EXEC=%s", 4298 4298 singlestepEnabled == TRUE, logEnabled == TRUE, 4299 enmExecEngine == VMExecutionEngine_NotSet ? "NotSet"4300 : enmExecEngine == VMExecutionEngine_ RawMode ? "RAW"4301 : enmExecEngine == VMExecutionEngine_HwVirt ? "HM"4299 enmExecEngine == VMExecutionEngine_NotSet ? "NotSet" 4300 : enmExecEngine == VMExecutionEngine_Emulated ? "IEM" 4301 : enmExecEngine == VMExecutionEngine_HwVirt ? "HM" 4302 4302 : enmExecEngine == VMExecutionEngine_NativeApi ? "NEM" : "UNK"); 4303 4303 char *psz = strchr(szTitle, '\0'); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r93115 r93901 1610 1610 } 1611 1611 1612 bool UIMessageCenter::warnAboutVirtExInactiveFor64BitsGuest(bool fHWVirtExSupported) const1613 {1614 if (fHWVirtExSupported)1615 return questionBinary(0, MessageType_Error,1616 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "1617 "Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.</p>"1618 "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),1619 0 /* auto-confirm id */,1620 tr("Close VM"), tr("Continue"));1621 else1622 return questionBinary(0, MessageType_Error,1623 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "1624 "Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot."),1625 0 /* auto-confirm id */,1626 tr("Close VM"), tr("Continue"));1627 }1628 1629 bool UIMessageCenter::warnAboutVirtExInactiveForRecommendedGuest(bool fHWVirtExSupported) const1630 {1631 if (fHWVirtExSupported)1632 return questionBinary(0, MessageType_Error,1633 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "1634 "Certain guests (e.g. OS/2 and QNX) require this feature.</p>"1635 "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"),1636 0 /* auto-confirm id */,1637 tr("Close VM"), tr("Continue"));1638 else1639 return questionBinary(0, MessageType_Error,1640 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "1641 "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"),1642 0 /* auto-confirm id */,1643 tr("Close VM"), tr("Continue"));1644 }1645 1646 1612 void UIMessageCenter::warnAboutVBoxSVCUnavailable() const 1647 1613 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r93115 r93901 404 404 405 405 bool warnAboutNetworkInterfaceNotFound(const QString &strMachineName, const QString &strIfNames) const; 406 bool warnAboutVirtExInactiveFor64BitsGuest(bool fHWVirtExSupported) const;407 bool warnAboutVirtExInactiveForRecommendedGuest(bool fHWVirtExSupported) const;408 406 409 407 void warnAboutVBoxSVCUnavailable() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r93115 r93901 986 986 { 987 987 /* Assign state-icons: */ 988 /** @todo The vtx_amdv_disabled_16px.png icon isn't really approprate anymore (no raw-mode), 989 * might want to get something different for KVMExecutionEngine_Emulated or reuse the 990 * vm_execution_engine_native_api_16px.png one... @bugref{9898} */ 988 991 setStateIcon(KVMExecutionEngine_NotSet, UIIconPool::iconSet(":/vtx_amdv_disabled_16px.png")); 989 setStateIcon(KVMExecutionEngine_ RawMode, UIIconPool::iconSet(":/vtx_amdv_disabled_16px.png"));992 setStateIcon(KVMExecutionEngine_Emulated, UIIconPool::iconSet(":/vtx_amdv_disabled_16px.png")); 990 993 setStateIcon(KVMExecutionEngine_HwVirt, UIIconPool::iconSet(":/vtx_amdv_16px.png")); 991 /** @todo New indicator icon, vm_execution_engine_native_api_16px.png, V inside a turtle / tortoise. @bugref{9044} */992 994 setStateIcon(KVMExecutionEngine_NativeApi, UIIconPool::iconSet(":/vm_execution_engine_native_api_16px.png")); 993 995 … … 1079 1081 strExecutionEngine = "VT-x/AMD-V"; /* no translation */ 1080 1082 break; 1081 case KVMExecutionEngine_ RawMode:1082 strExecutionEngine = " raw-mode";/* no translation */1083 case KVMExecutionEngine_Emulated: 1084 strExecutionEngine = "IEM"; /* no translation */ 1083 1085 break; 1084 1086 case KVMExecutionEngine_NativeApi: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r93460 r93901 1908 1908 bool UISession::postprocessInitialization() 1909 1909 { 1910 /* Check if the required virtualization features are active. We get this info only when the session is active. */ 1911 const bool fIs64BitsGuest = uiCommon().virtualBox().GetGuestOSType(guest().GetOSTypeId()).GetIs64Bit(); 1912 const bool fRecommendVirtEx = uiCommon().virtualBox().GetGuestOSType(guest().GetOSTypeId()).GetRecommendedVirtEx(); 1913 AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n")); 1914 const KVMExecutionEngine enmEngine = debugger().GetExecutionEngine(); 1915 if (fRecommendVirtEx && enmEngine == KVMExecutionEngine_RawMode) 1916 { 1917 /* Check whether vt-x / amd-v supported: */ 1918 bool fVTxAMDVSupported = uiCommon().host().GetProcessorFeature(KProcessorFeature_HWVirtEx); 1919 1920 /* Pause VM: */ 1921 setPause(true); 1922 1923 /* Ask the user about further actions: */ 1924 bool fShouldWeClose; 1925 if (fIs64BitsGuest) 1926 fShouldWeClose = msgCenter().warnAboutVirtExInactiveFor64BitsGuest(fVTxAMDVSupported); 1927 else 1928 fShouldWeClose = msgCenter().warnAboutVirtExInactiveForRecommendedGuest(fVTxAMDVSupported); 1929 1930 /* If user asked to close VM: */ 1931 if (fShouldWeClose) 1932 { 1933 /* Enable 'manual-override', 1934 * preventing automatic Runtime UI closing: */ 1935 setManualOverrideMode(true); 1936 /* Power off VM: */ 1937 LogRel(("GUI: Aborting startup due to postprocess initialization issue detected...\n")); 1938 powerOff(false /* do NOT restore current snapshot */); 1939 return false; 1940 } 1941 1942 /* Resume VM: */ 1943 setPause(false); 1944 } 1945 1946 /* True by default: */ 1910 /* There used to be some raw-mode warnings here for raw-mode incompatible 1911 guests (64-bit ones and OS/2). Nothing to do at present. */ 1947 1912 return true; 1948 1913 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r93115 r93901 348 348 strExecutionEngine = "VT-x/AMD-V"; /* no translation */ 349 349 break; 350 case KVMExecutionEngine_ RawMode:351 strExecutionEngine = " raw-mode";/* no translation */350 case KVMExecutionEngine_Emulated: 351 strExecutionEngine = "IEM"; /* no translation */ 352 352 break; 353 353 case KVMExecutionEngine_NativeApi: -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r93891 r93901 21057 21057 <enum 21058 21058 name="VMExecutionEngine" 21059 uuid=" 56029577-31f7-44d2-3334-7ecbf95294b6"21059 uuid="6e3f78f9-2dfe-4ed7-863d-67cad351e9d8" 21060 21060 > 21061 21061 <desc> … … 21065 21065 <desc>Has not yet been set (try again later).</desc> 21066 21066 </const> 21067 <const name=" RawMode"value="1">21068 <desc> Raw-mode.</desc>21067 <const name="Emulated" value="1"> 21068 <desc>Emulated thru IEM.</desc> 21069 21069 </const> 21070 21070 <const name="HwVirt" value="2"> -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r93485 r93901 425 425 { 426 426 case VM_EXEC_ENGINE_NOT_SET: *apenmEngine = VMExecutionEngine_NotSet; break; 427 case VM_EXEC_ENGINE_ RAW_MODE: *apenmEngine = VMExecutionEngine_RawMode; break;427 case VM_EXEC_ENGINE_IEM: *apenmEngine = VMExecutionEngine_Emulated; break; 428 428 case VM_EXEC_ENGINE_HW_VIRT: *apenmEngine = VMExecutionEngine_HwVirt; break; 429 429 case VM_EXEC_ENGINE_NATIVE_API: *apenmEngine = VMExecutionEngine_NativeApi; break; -
trunk/src/VBox/VMM/Makefile.kmk
r93757 r93901 715 715 # Always optimize the interpreter. 716 716 # 717 if ($(USERNAME) != "bird" && $(USERNAME) != "aeichner") || "$(KBUILD_TYPE)" == "release" #|| "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" 717 #if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "bird" && $(USERNAME) != "aeichner") 718 if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "aeichner") 718 719 if1of ($(KBUILD_TARGET), win) 719 720 # -noover is recognized despite the statement saying otherwise. It silences these warnings: 720 721 # cl : Command line warning D9025 : overriding '/Od' with '/O2' 721 722 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy' 722 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy 723 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy 724 VMMAll/IEMAllAImplC.cpp_CXXFLAGS += -noover -O2xy 723 725 else 724 726 VMMAll/IEMAll.cpp_CXXFLAGS += -O2 727 VMMAll/IEMAllAImplC.cpp_CXXFLAGS += -O2 -fomit-frame-pointer 725 728 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it. 726 729 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind. -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r93824 r93901 1313 1313 * No need to monitor anything in this case. */ 1314 1314 /** @todo r=bird: WTF is hit?!? */ 1315 Assert(VM_IS_RAW_MODE_ENABLED(pVM));1315 /*Assert(VM_IS_RAW_MODE_ENABLED(pVM)); - ??? */ 1316 1316 GCPdPt = uGstPdpe & X86_PDPE_PG_MASK; 1317 1317 enmKind = PGMPOOLKIND_PAE_PD_PHYS; … … 3036 3036 switch (enmGuestMode) 3037 3037 { 3038 /*3039 * When switching to real or protected mode we don't change3040 * anything since it's likely that we'll switch back pretty soon.3041 *3042 * During pgmR3InitPaging we'll end up here with PGMMODE_INVALID3043 * and is supposed to determine which shadow paging and switcher to3044 * use during init.3045 */3046 3038 case PGMMODE_REAL: 3047 3039 case PGMMODE_PROTECTED: 3048 if ( enmShadowMode != PGMMODE_INVALID3049 && VM_IS_RAW_MODE_ENABLED(pVM) /* always switch in hm and nem modes! */)3050 break; /* (no change) */3051 3052 3040 switch (enmHostMode) 3053 3041 { -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r93787 r93901 286 286 #else 287 287 int cWait = RTEnvExist("VBOX_DBGF_NO_WAIT_FOR_ATTACH") 288 || ( !VM_IS_RAW_MODE_ENABLED(pVM) 289 && ( enmEvent == DBGFEVENT_ASSERTION_HYPER 288 || ( ( enmEvent == DBGFEVENT_ASSERTION_HYPER 290 289 || enmEvent == DBGFEVENT_FATAL_ERROR) 291 290 && !RTEnvExist("VBOX_DBGF_WAIT_FOR_ATTACH")) -
trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
r93115 r93901 636 636 if (hAlias == DBGF_AS_R0 && pUVM->pVM) 637 637 PDMR3LdrEnumModules(pUVM->pVM, dbgfR3AsLazyPopulateR0Callback, hDbgAs); 638 #ifdef VBOX_WITH_RAW_MODE_KEEP /* needs fixing */ 638 639 else if (hAlias == DBGF_AS_RC && pUVM->pVM && VM_IS_RAW_MODE_ENABLED(pUVM->pVM)) 639 640 { … … 641 642 PDMR3LdrEnumModules(pUVM->pVM, dbgfR3AsLazyPopulateRCCallback, hDbgAs); 642 643 } 644 #endif 643 645 else if (hAlias == DBGF_AS_PHYS && pUVM->pVM) 644 646 { -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r93718 r93901 108 108 PCFGMNODE pCfgEM = CFGMR3GetChild(pCfgRoot, "EM"); 109 109 110 int rc = CFGMR3QueryBoolDef(pCfgEM, "IemExecutesAll", &pVM->em.s.fIemExecutesAll, false); 110 int rc = CFGMR3QueryBoolDef(pCfgEM, "IemExecutesAll", &pVM->em.s.fIemExecutesAll, 111 #if defined(RT_ARCH_ARM64) && defined(RT_OS_DARWIN) 112 true 113 #else 114 false 115 #endif 116 ); 111 117 AssertLogRelRCReturn(rc, rc); 112 118 … … 1280 1286 * Execute everything in IEM? 1281 1287 */ 1282 if (pVM->em.s.fIemExecutesAll) 1288 if ( pVM->em.s.fIemExecutesAll 1289 || VM_IS_EXEC_ENGINE_IEM(pVM)) 1283 1290 return EMSTATE_IEM; 1284 1291 1285 /* !!! THIS MUST BE IN SYNC WITH remR3CanExecuteRaw !!! */ 1286 /* !!! THIS MUST BE IN SYNC WITH remR3CanExecuteRaw !!! */ 1287 /* !!! THIS MUST BE IN SYNC WITH remR3CanExecuteRaw !!! */ 1288 1289 X86EFLAGS EFlags = pVCpu->cpum.GstCtx.eflags; 1290 if (!VM_IS_RAW_MODE_ENABLED(pVM)) 1291 { 1292 if (VM_IS_HM_ENABLED(pVM)) 1293 { 1294 if (HMCanExecuteGuest(pVM, pVCpu, &pVCpu->cpum.GstCtx)) 1295 return EMSTATE_HM; 1296 } 1297 else if (NEMR3CanExecuteGuest(pVM, pVCpu)) 1298 return EMSTATE_NEM; 1299 1300 /* 1301 * Note! Raw mode and hw accelerated mode are incompatible. The latter 1302 * turns off monitoring features essential for raw mode! 1303 */ 1304 return EMSTATE_IEM_THEN_REM; 1305 } 1292 if (VM_IS_HM_ENABLED(pVM)) 1293 { 1294 if (HMCanExecuteGuest(pVM, pVCpu, &pVCpu->cpum.GstCtx)) 1295 return EMSTATE_HM; 1296 } 1297 else if (NEMR3CanExecuteGuest(pVM, pVCpu)) 1298 return EMSTATE_NEM; 1306 1299 1307 1300 /* 1308 * Standard raw-mode: 1309 * 1310 * Here we only support 16 & 32 bits protected mode ring 3 code that has no IO privileges 1311 * or 32 bits protected mode ring 0 code 1312 * 1313 * The tests are ordered by the likelihood of being true during normal execution. 1301 * Note! Raw mode and hw accelerated mode are incompatible. The latter 1302 * turns off monitoring features essential for raw mode! 1314 1303 */ 1315 if (EFlags.u32 & (X86_EFL_TF /* | HF_INHIBIT_IRQ_MASK*/)) 1316 { 1317 Log2(("raw mode refused: EFlags=%#x\n", EFlags.u32)); 1318 return EMSTATE_REM; 1319 } 1320 1321 # ifndef VBOX_RAW_V86 1322 if (EFlags.u32 & X86_EFL_VM) { 1323 Log2(("raw mode refused: VM_MASK\n")); 1324 return EMSTATE_REM; 1325 } 1326 # endif 1327 1328 /** @todo check up the X86_CR0_AM flag in respect to raw mode!!! We're probably not emulating it right! */ 1329 uint32_t u32CR0 = pVCpu->cpum.GstCtx.cr0; 1330 if ((u32CR0 & (X86_CR0_PG | X86_CR0_PE)) != (X86_CR0_PG | X86_CR0_PE)) 1331 { 1332 //Log2(("raw mode refused: %s%s%s\n", (u32CR0 & X86_CR0_PG) ? "" : " !PG", (u32CR0 & X86_CR0_PE) ? "" : " !PE", (u32CR0 & X86_CR0_AM) ? "" : " !AM")); 1333 return EMSTATE_REM; 1334 } 1335 1336 if (pVCpu->cpum.GstCtx.cr4 & X86_CR4_PAE) 1337 { 1338 uint32_t u32Dummy, u32Features; 1339 1340 CPUMGetGuestCpuId(pVCpu, 1, 0, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features); 1341 if (!(u32Features & X86_CPUID_FEATURE_EDX_PAE)) 1342 return EMSTATE_REM; 1343 } 1344 1345 unsigned uSS = pVCpu->cpum.GstCtx.ss.Sel; 1346 if ( pVCpu->cpum.GstCtx.eflags.Bits.u1VM 1347 || (uSS & X86_SEL_RPL) == 3) 1348 { 1349 if (!(EFlags.u32 & X86_EFL_IF)) 1350 { 1351 Log2(("raw mode refused: IF (RawR3)\n")); 1352 return EMSTATE_REM; 1353 } 1354 1355 if (!(u32CR0 & X86_CR0_WP)) 1356 { 1357 Log2(("raw mode refused: CR0.WP + RawR0\n")); 1358 return EMSTATE_REM; 1359 } 1360 } 1361 else 1362 { 1363 /* Only ring 0 supervisor code. */ 1364 if ((uSS & X86_SEL_RPL) != 0) 1365 { 1366 Log2(("raw r0 mode refused: CPL %d\n", uSS & X86_SEL_RPL)); 1367 return EMSTATE_REM; 1368 } 1369 1370 // Let's start with pure 32 bits ring 0 code first 1371 /** @todo What's pure 32-bit mode? flat? */ 1372 if ( !(pVCpu->cpum.GstCtx.ss.Attr.n.u1DefBig) 1373 || !(pVCpu->cpum.GstCtx.cs.Attr.n.u1DefBig)) 1374 { 1375 Log2(("raw r0 mode refused: SS/CS not 32bit\n")); 1376 return EMSTATE_REM; 1377 } 1378 1379 /* Write protection must be turned on, or else the guest can overwrite our hypervisor code and data. */ 1380 if (!(u32CR0 & X86_CR0_WP)) 1381 { 1382 Log2(("raw r0 mode refused: CR0.WP=0!\n")); 1383 return EMSTATE_REM; 1384 } 1385 1386 # if !defined(VBOX_ALLOW_IF0) && !defined(VBOX_RUN_INTERRUPT_GATE_HANDLERS) 1387 if (!(EFlags.u32 & X86_EFL_IF)) 1388 { 1389 ////Log2(("R0: IF=0 VIF=%d %08X\n", eip, pVMeflags)); 1390 //Log2(("RR0: Interrupts turned off; fall back to emulation\n")); 1391 return EMSTATE_REM; 1392 } 1393 # endif 1394 1395 # ifndef VBOX_WITH_RAW_RING1 1396 /** @todo still necessary??? */ 1397 if (EFlags.Bits.u2IOPL != 0) 1398 { 1399 Log2(("raw r0 mode refused: IOPL %d\n", EFlags.Bits.u2IOPL)); 1400 return EMSTATE_REM; 1401 } 1402 # endif 1403 } 1404 1405 /* 1406 * Stale hidden selectors means raw-mode is unsafe (being very careful). 1407 */ 1408 if (pVCpu->cpum.GstCtx.cs.fFlags & CPUMSELREG_FLAGS_STALE) 1409 { 1410 Log2(("raw mode refused: stale CS\n")); 1411 return EMSTATE_REM; 1412 } 1413 if (pVCpu->cpum.GstCtx.ss.fFlags & CPUMSELREG_FLAGS_STALE) 1414 { 1415 Log2(("raw mode refused: stale SS\n")); 1416 return EMSTATE_REM; 1417 } 1418 if (pVCpu->cpum.GstCtx.ds.fFlags & CPUMSELREG_FLAGS_STALE) 1419 { 1420 Log2(("raw mode refused: stale DS\n")); 1421 return EMSTATE_REM; 1422 } 1423 if (pVCpu->cpum.GstCtx.es.fFlags & CPUMSELREG_FLAGS_STALE) 1424 { 1425 Log2(("raw mode refused: stale ES\n")); 1426 return EMSTATE_REM; 1427 } 1428 if (pVCpu->cpum.GstCtx.fs.fFlags & CPUMSELREG_FLAGS_STALE) 1429 { 1430 Log2(("raw mode refused: stale FS\n")); 1431 return EMSTATE_REM; 1432 } 1433 if (pVCpu->cpum.GstCtx.gs.fFlags & CPUMSELREG_FLAGS_STALE) 1434 { 1435 Log2(("raw mode refused: stale GS\n")); 1436 return EMSTATE_REM; 1437 } 1438 1439 # ifdef VBOX_WITH_SAFE_STR 1440 if (pVCpu->cpum.GstCtx.tr.Sel == 0) 1441 { 1442 Log(("Raw mode refused -> TR=0\n")); 1443 return EMSTATE_REM; 1444 } 1445 # endif 1446 1447 /*Assert(PGMPhysIsA20Enabled(pVCpu));*/ 1448 return EMSTATE_RAW; 1304 return EMSTATE_IEM_THEN_REM; 1449 1305 } 1450 1306 … … 2354 2210 case VINF_EM_RESCHEDULE_RAW: 2355 2211 Assert(!pVM->em.s.fIemExecutesAll || pVCpu->em.s.enmState != EMSTATE_IEM); 2356 if (VM_IS_RAW_MODE_ENABLED(pVM)) 2357 { 2358 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_RAW: %d -> %d (EMSTATE_RAW)\n", enmOldState, EMSTATE_RAW)); 2359 pVCpu->em.s.enmState = EMSTATE_RAW; 2360 } 2361 else 2362 { 2363 AssertLogRelFailed(); 2364 pVCpu->em.s.enmState = EMSTATE_NONE; 2365 } 2212 AssertLogRelFailed(); 2213 pVCpu->em.s.enmState = EMSTATE_NONE; 2366 2214 break; 2367 2215 … … 2393 2241 case VINF_EM_RESCHEDULE_REM: 2394 2242 Assert(!pVM->em.s.fIemExecutesAll || pVCpu->em.s.enmState != EMSTATE_IEM); 2395 if (!VM_IS_RAW_MODE_ENABLED(pVM)) 2396 { 2397 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_IEM_THEN_REM)\n", 2398 enmOldState, EMSTATE_IEM_THEN_REM)); 2399 if (pVCpu->em.s.enmState != EMSTATE_IEM_THEN_REM) 2400 { 2401 pVCpu->em.s.enmState = EMSTATE_IEM_THEN_REM; 2402 pVCpu->em.s.cIemThenRemInstructions = 0; 2403 } 2404 } 2405 else 2406 { 2407 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_REM)\n", enmOldState, EMSTATE_REM)); 2408 pVCpu->em.s.enmState = EMSTATE_REM; 2243 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_IEM_THEN_REM)\n", 2244 enmOldState, EMSTATE_IEM_THEN_REM)); 2245 if (pVCpu->em.s.enmState != EMSTATE_IEM_THEN_REM) 2246 { 2247 pVCpu->em.s.enmState = EMSTATE_IEM_THEN_REM; 2248 pVCpu->em.s.cIemThenRemInstructions = 0; 2409 2249 } 2410 2250 break; -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r93744 r93901 245 245 "|UseNEMInstead" 246 246 "|FallbackToNEM" 247 "|FallbackToIEM" 247 248 "|EnableNestedPaging" 248 249 "|EnableUX" … … 277 278 * Forces hardware virtualization, no falling back on raw-mode. HM must be 278 279 * enabled, i.e. /HMEnabled must be true. */ 279 bool fHMForced; 280 bool const fHMForced = true; 281 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 280 282 AssertRelease(pVM->fHMEnabled); 281 fHMForced = true; 283 #else 284 AssertRelease(!pVM->fHMEnabled); 285 #endif 282 286 283 287 /** @cfgm{/HM/UseNEMInstead, bool, true} … … 296 300 bool fFallbackToNEM = true; 297 301 rc = CFGMR3QueryBoolDef(pCfgHm, "FallbackToNEM", &fFallbackToNEM, true); 302 AssertRCReturn(rc, rc); 303 304 /** @cfgm{/HM/FallbackToIEM, bool, false on AMD64 else true } 305 * Enables fallback on NEM. */ 306 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 307 bool fFallbackToIEM = false; 308 #else 309 bool fFallbackToIEM = true; 310 #endif 311 rc = CFGMR3QueryBoolDef(pCfgHm, "fFallbackToIEM", &fFallbackToIEM, fFallbackToIEM); 298 312 AssertRCReturn(rc, rc); 299 313 … … 613 627 } 614 628 } 629 630 /* 631 * Then try fall back on IEM if NEM isn't available and we're allowed to. 632 */ 615 633 if (RT_FAILURE(rc)) 616 return VM_SET_ERROR(pVM, rc, pszMsg); 634 { 635 if ( fFallbackToIEM 636 && (!fFallbackToNEM || rc == VERR_NEM_NOT_AVAILABLE)) 637 { 638 LogRel(("HM: HMR3Init: Falling back on IEM: %s\n", !fFallbackToNEM ? pszMsg : "NEM not available")); 639 VM_SET_MAIN_EXECUTION_ENGINE(pVM, VM_EXEC_ENGINE_IEM); 640 } 641 else 642 return VM_SET_ERROR(pVM, rc, pszMsg); 643 } 617 644 } 618 645 } … … 622 649 * Disabled HM mean raw-mode, unless NEM is supposed to be used. 623 650 */ 651 rc = VERR_NEM_NOT_AVAILABLE; 624 652 if (fUseNEMInstead) 625 653 { 626 654 rc = NEMR3Init(pVM, false /*fFallback*/, true); 627 655 ASMCompilerBarrier(); /* NEMR3Init may have changed bMainExecutionEngine. */ 628 if (RT_FAILURE(rc)) 656 if (RT_SUCCESS(rc)) 657 { 658 /* For some reason, HM is in charge or large pages. Make sure to enable them: */ 659 PGMSetLargePageUsage(pVM, pVM->hm.s.fLargePages); 660 } 661 else if (!fFallbackToIEM || rc != VERR_NEM_NOT_AVAILABLE) 629 662 return rc; 630 631 /* For some reason, HM is in charge or large pages. Make sure to enable them: */ 632 PGMSetLargePageUsage(pVM, pVM->hm.s.fLargePages); 633 } 663 } 664 665 if (fFallbackToIEM && rc == VERR_NEM_NOT_AVAILABLE) 666 { 667 LogRel(("HM: HMR3Init: Falling back on IEM%s\n", fUseNEMInstead ? ": NEM not available" : "")); 668 VM_SET_MAIN_EXECUTION_ENGINE(pVM, VM_EXEC_ENGINE_IEM); 669 } 670 634 671 if ( pVM->bMainExecutionEngine == VM_EXEC_ENGINE_NOT_SET 635 || pVM->bMainExecutionEngine == VM_EXEC_ENGINE_RAW_MODE636 672 || pVM->bMainExecutionEngine == VM_EXEC_ENGINE_HW_VIRT /* paranoia */) 637 673 return VM_SET_ERROR(pVM, rc, "Misconfigured VM: No guest execution engine available!"); … … 659 695 660 696 Assert(pVM->bMainExecutionEngine != VM_EXEC_ENGINE_NOT_SET); 661 Assert(pVM->bMainExecutionEngine != VM_EXEC_ENGINE_RAW_MODE);662 697 return VINF_SUCCESS; 663 698 } -
trunk/src/VBox/VMM/VMMR3/PDM.cpp
r93115 r93901 577 577 { 578 578 LogFlow(("PDMR3Relocate\n")); 579 579 RT_NOREF(pVM, offDelta); 580 581 #ifdef VBOX_WITH_RAW_MODE_KEEP /* needs fixing */ 580 582 /* 581 583 * The registered PIC. … … 610 612 * Devices & Drivers. 611 613 */ 612 #ifdef VBOX_WITH_RAW_MODE_KEEP /* needs fixing */613 614 int rc; 614 615 PCPDMDEVHLPRC pDevHlpRC = NIL_RTRCPTR; -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r93651 r93901 4106 4106 */ 4107 4107 pVM->pdm.s.Apic.pDevInsR3 = pDevIns; 4108 #ifdef VBOX_WITH_RAW_MODE_KEEP 4108 4109 pVM->pdm.s.Apic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 4109 4110 Assert(pVM->pdm.s.Apic.pDevInsRC || !VM_IS_RAW_MODE_ENABLED(pVM)); 4111 #endif 4110 4112 4111 4113 LogFlow(("pdmR3DevHlp_ApicRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS)); -
trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
r93115 r93901 419 419 420 420 RTRCPTR pRCHelpers = NIL_RTRCPTR; 421 #if 0 421 422 if (VM_IS_RAW_MODE_ENABLED(pVM)) 422 423 { … … 425 426 AssertRelease(pRCHelpers); 426 427 } 428 #else 429 RT_NOREF(pDevIns); 430 #endif 427 431 428 432 LogFlow(("pdmR3PciRawHlp_GetGCHelpers: caller='%s'/%d: returns %RRv\n", -
trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp
r93718 r93901 956 956 #if defined(PDMLDR_FAKE_MODE) || !defined(VBOX_WITH_RAW_MODE_KEEP) 957 957 RT_NOREF(pVM, pszModule, pszSymbol); 958 Assert(VM_IS_RAW_MODE_ENABLED(pVM));959 958 *pRCPtrValue = NIL_RTRCPTR; 960 959 return VINF_SUCCESS; … … 1025 1024 #if defined(PDMLDR_FAKE_MODE) || !defined(VBOX_WITH_RAW_MODE_KEEP) 1026 1025 RT_NOREF(pVM, pszModule, pszSearchPath, pszSymbol); 1027 Assert(VM_IS_RAW_MODE_ENABLED(pVM));1028 1026 *pRCPtrValue = NIL_RTRCPTR; 1029 1027 return VINF_SUCCESS; … … 1637 1635 bool fRing0) 1638 1636 { 1639 bool const fNullRun = !fRing0 && !VM_IS_RAW_MODE_ENABLED(pVM);1637 bool const fNullRun = !fRing0; 1640 1638 1641 1639 /* -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r93744 r93901 1087 1087 * GIM is now initialized. Determine if TSC mode switching is allowed (respecting CFGM override). 1088 1088 */ 1089 pVM->tm.s.fTSCModeSwitchAllowed &= tmR3HasFixedTSC(pVM) && GIMIsEnabled(pVM) && !VM_IS_RAW_MODE_ENABLED(pVM);1089 pVM->tm.s.fTSCModeSwitchAllowed &= tmR3HasFixedTSC(pVM) && GIMIsEnabled(pVM); 1090 1090 LogRel(("TM: TMR3InitFinalize: fTSCModeSwitchAllowed=%RTbool\n", pVM->tm.s.fTSCModeSwitchAllowed)); 1091 1091 -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r93718 r93901 729 729 static int vmR3ReadBaseConfig(PVM pVM, PUVM pUVM, uint32_t cCpus) 730 730 { 731 int rc; 732 PCFGMNODE pRoot = CFGMR3GetRoot(pVM); 731 PCFGMNODE const pRoot = CFGMR3GetRoot(pVM); 733 732 734 733 /* 735 734 * Base EM and HM config properties. 736 735 */ 736 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 737 737 pVM->fHMEnabled = true; 738 #else /* Other architectures must fall back on IEM for the time being: */ 739 pVM->fHMEnabled = false; 740 #endif 738 741 739 742 /* … … 741 744 */ 742 745 uint32_t cCPUsCfg; 743 rc = CFGMR3QueryU32Def(pRoot, "NumCPUs", &cCPUsCfg, 1);746 int rc = CFGMR3QueryU32Def(pRoot, "NumCPUs", &cCPUsCfg, 1); 744 747 AssertLogRelMsgRCReturn(rc, ("Configuration error: Querying \"NumCPUs\" as integer failed, rc=%Rrc\n", rc), rc); 745 748 AssertLogRelMsgReturn(cCPUsCfg == cCpus, … … 831 834 if (RT_SUCCESS(rc)) 832 835 { 833 ASMCompilerBarrier(); /* HMR3Init will have modified bMainExecutionEngine*/836 ASMCompilerBarrier(); /* HMR3Init will have modified const member bMainExecutionEngine. */ 834 837 Assert( pVM->bMainExecutionEngine == VM_EXEC_ENGINE_HW_VIRT 835 || pVM->bMainExecutionEngine == VM_EXEC_ENGINE_NATIVE_API); 838 || pVM->bMainExecutionEngine == VM_EXEC_ENGINE_NATIVE_API 839 || pVM->bMainExecutionEngine == VM_EXEC_ENGINE_IEM); 836 840 rc = MMR3Init(pVM); 837 841 if (RT_SUCCESS(rc)) -
trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp
r93115 r93901 368 368 * assisted virtualization mode, thus the different messages. 369 369 */ 370 uint32_t uEIP = 0; //CPUMGetHyperEIP(pVCpu);371 370 TRPMEVENT enmType; 372 371 uint8_t u8TrapNo = 0xce; … … 376 375 bool fIcebp = false; 377 376 int rc2 = TRPMQueryTrapAll(pVCpu, &u8TrapNo, &enmType, &uErrorCode, &uCR2, &cbInstr, &fIcebp); 378 if (VM_IS_RAW_MODE_ENABLED(pVM)) 379 { 380 if (RT_SUCCESS(rc2)) 381 pHlp->pfnPrintf(pHlp, 382 "!! TRAP=%02x ERRCD=%RX32 CR2=%RGv EIP=%RX32 Type=%d cbInstr=%02x fIcebp=%RTbool\n", 383 u8TrapNo, uErrorCode, uCR2, uEIP, enmType, cbInstr, fIcebp); 384 else 385 pHlp->pfnPrintf(pHlp, 386 "!! EIP=%RX32 NOTRAP\n", 387 uEIP); 388 } 389 else if (RT_SUCCESS(rc2)) 377 if (RT_SUCCESS(rc2)) 390 378 pHlp->pfnPrintf(pHlp, 391 379 "!! ACTIVE TRAP=%02x ERRCD=%RX32 CR2=%RGv PC=%RGr Type=%d cbInstr=%02x fIcebp=%RTbool (Guest!)\n",
Note:
See TracChangeset
for help on using the changeset viewer.

