- Timestamp:
- May 25, 2018 1:24:28 PM (7 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r71146 r72343 1115 1115 InsertConfigInteger(pRoot, "HMEnabled", fHMEnabled); 1116 1116 1117 /* /HM/x zy*/1117 /* /HM/xyz */ 1118 1118 PCFGMNODE pHM; 1119 1119 InsertConfigNode(pRoot, "HM", &pHM); … … 1185 1185 if (i_isResetTurnedIntoPowerOff()) 1186 1186 InsertConfigInteger(pRoot, "PowerOffInsteadOfReset", 1); 1187 1188 /* Use NEM rather than HM. */ 1189 BOOL fUseNativeApi = false; 1190 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_UseNativeApi, &fUseNativeApi); H(); 1191 InsertConfigInteger(pHM, "UseNEMInstead", fUseNativeApi); 1192 1193 /* 1194 * NEM 1195 */ 1196 PCFGMNODE pNEM; 1197 InsertConfigNode(pRoot, "NEM", &pNEM); 1198 InsertConfigInteger(pNEM, "Allow64BitGuests", fIsGuest64Bit); 1187 1199 1188 1200 /* -
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r71910 r72343 358 358 359 359 /** 360 * Checks if this VM is long-mode capable. 360 * Checks if this VM is using HM and is long-mode capable. 361 * 362 * Use VMR3IsLongModeAllowed() instead of this, when possible. 361 363 * 362 364 * @returns true if long mode is allowed, false otherwise. 363 365 * @param pVM The cross context VM structure. 364 * /365 /** @todo NEM: Check users of HMIsLongModeAllowed*/366 * @sa VMR3IsLongModeAllowed, NEMHCIsLongModeAllowed 367 */ 366 368 VMM_INT_DECL(bool) HMIsLongModeAllowed(PVM pVM) 367 369 { -
trunk/src/VBox/VMM/VMMAll/NEMAll.cpp
r72272 r72343 25 25 #include <VBox/vmm/vm.h> 26 26 27 28 /** 29 * Checks if this VM is in NEM mode and is long-mode capable. 30 * 31 * Use VMR3IsLongModeAllowed() instead of this, when possible. 32 * 33 * @returns true if long mode is allowed, false otherwise. 34 * @param pVM The cross context VM structure. 35 * @sa VMR3IsLongModeAllowed, HMIsLongModeAllowed 36 */ 37 VMM_INT_DECL(bool) NEMHCIsLongModeAllowed(PVM pVM) 38 { 39 return pVM->nem.s.fAllow64BitGuests && VM_IS_NEM_ENABLED(pVM); 40 } 27 41 28 42 -
trunk/src/VBox/VMM/VMMR0/NEMR0Native-win.cpp
r72304 r72343 1784 1784 if (paValues[iReg].Reg64 != pCtx->msrEFER) 1785 1785 { 1786 if ((paValues[iReg].Reg64 ^ pCtx->msrEFER) & MSR_K6_EFER_NXE) 1787 PGMNotifyNxeChanged(pVCpu, RT_BOOL(paValues[iReg].Reg64 & MSR_K6_EFER_NXE)); 1786 1788 pCtx->msrEFER = paValues[iReg].Reg64; 1787 1789 fMaybeChangedMode = true; -
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r72208 r72343 24 24 #include <VBox/vmm/dbgf.h> 25 25 #include <VBox/vmm/hm.h> 26 #include <VBox/vmm/nem.h> 26 27 #include <VBox/vmm/ssm.h> 27 28 #include "CPUMInternal.h" … … 4021 4022 && pVM->cpum.s.HostFeatures.fOpSysXSaveRstor 4022 4023 #if HC_ARCH_BITS == 32 /* Seems this may be broken when doing 64-bit on 32-bit, just disable it for now. */ 4023 && !HMIsLongModeAllowed(pVM) 4024 && ( !HMIsLongModeAllowed(pVM) 4025 || NEMIsLongModeAllowed(pVM)) 4024 4026 #endif 4025 4027 ; -
trunk/src/VBox/VMM/VMMR3/NEMR3.cpp
r72267 r72343 76 76 int rc = CFGMR3ValidateConfig(pCfgNem, 77 77 "/NEM/", 78 "Enabled", 78 "Enabled" 79 "|Allow64BitGuests", 79 80 "" /* pszValidNodes */, "NEM" /* pszWho */, 0 /* uInstance */); 80 81 if (RT_FAILURE(rc)) … … 85 86 rc = CFGMR3QueryBoolDef(pCfgNem, "Enabled", &pVM->nem.s.fEnabled, true); 86 87 AssertLogRelRCReturn(rc, rc); 88 89 90 #ifdef VBOX_WITH_64_BITS_GUESTS 91 /** @cfgm{/HM/Allow64BitGuests, bool, 32-bit:false, 64-bit:true} 92 * Enables AMD64 CPU features. 93 * On 32-bit hosts this isn't default and require host CPU support. 64-bit hosts 94 * already have the support. */ 95 rc = CFGMR3QueryBoolDef(pCfgNem, "Allow64BitGuests", &pVM->nem.s.fAllow64BitGuests, HC_ARCH_BITS == 64); 96 AssertLogRelRCReturn(rc, rc); 97 #else 98 pVM->nem.s.fAllow64BitGuests = false; 99 #endif 100 87 101 88 102 return VINF_SUCCESS; … … 151 165 { 152 166 int rc = VINF_SUCCESS; 153 #ifdef VBOX_WITH_NATIVE_NEM 154 if (pVM->bMainExecutionEngine == VM_EXEC_ENGINE_NATIVE_API) 167 if (pVM->bMainExecutionEngine == VM_EXEC_ENGINE_NATIVE_API) 168 { 169 /* 170 * Enable CPU features making general ASSUMPTIONS (there are two similar 171 * blocks of code in HM.cpp), to avoid duplicating this code. The 172 * native backend can make check capabilities and adjust as needed. 173 */ 174 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_SEP); 175 if (CPUMGetGuestCpuVendor(pVM) == CPUMCPUVENDOR_AMD) 176 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_SYSCALL); /* 64 bits only on Intel CPUs */ 177 if (pVM->nem.s.fAllow64BitGuests) 178 { 179 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_SYSCALL); 180 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_PAE); 181 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_LONG_MODE); 182 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_LAHF); 183 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_NX); 184 } 185 /* Turn on NXE if PAE has been enabled. */ 186 else if (CPUMR3GetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_PAE)) 187 CPUMR3SetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_NX); 188 189 /* 190 * Do native after-CPUM init. 191 */ 192 #ifdef VBOX_WITH_NATIVE_NEM 155 193 rc = nemR3NativeInitAfterCPUM(pVM); 156 194 #else 157 RT_NOREF(pVM); 158 #endif 195 RT_NOREF(pVM); 196 #endif 197 } 159 198 return rc; 160 199 } -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r71699 r72343 4530 4530 /** 4531 4531 * Checks if the VM is long-mode (64-bit) capable or not. 4532 * @returns true if VM can operate in long-mode, false 4533 * otherwise. 4534 * 4532 * 4533 * @returns true if VM can operate in long-mode, false otherwise. 4535 4534 * @param pVM The cross context VM structure. 4536 4535 */ 4537 4536 VMMR3_INT_DECL(bool) VMR3IsLongModeAllowed(PVM pVM) 4538 4537 { 4539 /** @todo NEM: Fixme log mode allowed stuff. */ 4540 if (HMIsEnabled(pVM)) 4541 return HMIsLongModeAllowed(pVM); 4542 return false; 4538 switch (pVM->bMainExecutionEngine) 4539 { 4540 case VM_EXEC_ENGINE_HW_VIRT: 4541 return HMIsLongModeAllowed(pVM); 4542 4543 case VM_EXEC_ENGINE_NATIVE_API: 4544 #ifndef IN_RC 4545 return NEMHCIsLongModeAllowed(pVM); 4546 #else 4547 return false; 4548 #endif 4549 4550 case VM_EXEC_ENGINE_NOT_SET: 4551 AssertFailed(); 4552 RT_FALL_THRU(); 4553 default: 4554 return false; 4555 } 4543 4556 } 4544 4557 -
trunk/src/VBox/VMM/include/HMInternal.h
r72208 r72343 40 40 #endif 41 41 42 #if HC_ARCH_BITS == 64 || defined 42 #if HC_ARCH_BITS == 64 || defined(VBOX_WITH_64_BITS_GUESTS) 43 43 /* Enable 64 bits guest support. */ 44 44 # define VBOX_ENABLE_64_BITS_GUESTS -
trunk/src/VBox/VMM/include/NEMInternal.h
r72308 r72343 108 108 /** Set if enabled. */ 109 109 bool fEnabled; 110 /** Set if long mode guests are allowed. */ 111 bool fAllow64BitGuests; 110 112 #ifdef RT_OS_WINDOWS 111 113 /** Set if we've created the EMTs. */
Note:
See TracChangeset
for help on using the changeset viewer.