Changeset 72343 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- May 25, 2018 1:24:28 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122799
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.