- Timestamp:
- Apr 18, 2013 9:49:05 PM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r45589 r45622 937 937 This setting determines whether VirtualBox will expose a synthetic CPU to the guest to allow 938 938 teleporting between host systems that differ significantly. 939 </desc> 940 </const> 941 <const name="LongMode" value="3"> 942 <desc> 943 This setting determines whether VirtualBox will advertice long mode 944 (i.e. 64-bit guest support) and let the guest enter it. 939 945 </desc> 940 946 </const> -
trunk/src/VBox/Main/include/ApplianceImplPrivate.h
r45601 r45622 224 224 void convertCIMOSType2VBoxOSType(Utf8Str &strType, ovf::CIMOSType_T c, const Utf8Str &cStr); 225 225 226 ovf::CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVBox );226 ovf::CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVBox, BOOL fLongMode); 227 227 228 228 Utf8Str convertNetworkAttachmentTypeToString(NetworkAttachmentType_T type); -
trunk/src/VBox/Main/include/MachineImpl.h
r45563 r45622 269 269 BOOL mAccelerate2DVideoEnabled; 270 270 BOOL mPAEEnabled; 271 settings::Hardware::LongModeType mLongMode; 271 272 BOOL mSyntheticCpu; 272 273 ULONG mCPUCount; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r45618 r45622 890 890 */ 891 891 BOOL fIsGuest64Bit; 892 hrc = guestOSType->COMGETTER(Is64Bit)(&fIsGuest64Bit);H();892 hrc = pMachine->GetCPUProperty(CPUPropertyType_LongMode, &fIsGuest64Bit); H(); 893 893 BOOL fSupportsLongMode; 894 894 hrc = host->GetProcessorFeature(ProcessorFeature_LongMode, &fSupportsLongMode); H(); -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r45602 r45622 245 245 * Private helper func that suggests a VirtualBox guest OS type 246 246 * for the given OVF operating system type. 247 * @returns CIM OS type. 247 248 * @param pcszVBox Our guest OS type identifier string. 248 */ 249 ovf::CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVBox) 249 * @param fLongMode Whether long mode is enabled and a 64-bit CIM type is 250 * preferred even if the VBox guest type isn't 64-bit. 251 */ 252 ovf::CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVBox, BOOL fLongMode) 250 253 { 251 254 for (size_t i = 0; i < RT_ELEMENTS(g_osTypes); ++i) 252 255 { 253 256 if (!RTStrICmp(pcszVBox, Global::OSTypeId(g_osTypes[i].osType))) 257 { 258 if (fLongMode && !(g_osTypes[i].osType & VBOXOSTYPE_x64)) 259 { 260 VBOXOSTYPE enmDesiredOsType = (VBOXOSTYPE)((int)g_osTypes[i].osType | (int)VBOXOSTYPE_x64); 261 size_t j = i; 262 while (++j < RT_ELEMENTS(g_osTypes)) 263 if (g_osTypes[j].osType == enmDesiredOsType) 264 return g_osTypes[j].cim; 265 j = i; 266 while (--j > 0) 267 if (g_osTypes[j].osType == enmDesiredOsType) 268 return g_osTypes[j].cim; 269 /* Not all OSes have 64-bit versions, so just return the 32-bit variant. */ 270 } 254 271 return g_osTypes[i].cim; 272 } 255 273 } 256 274 -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r45600 r45622 127 127 // HWVirtExVPIDEnabled? 128 128 // PAEEnabled? 129 // Long mode enabled? 130 BOOL fLongMode; 131 rc = GetCPUProperty(CPUPropertyType_LongMode, &fLongMode); 132 if (FAILED(rc)) throw rc; 133 129 134 // snapshotFolder? 130 135 // VRDPServer? 131 136 132 137 /* Guest OS type */ 133 ovf::CIMOSType_T cim = convertVBoxOSType2CIMOSType(strOsTypeVBox.c_str() );138 ovf::CIMOSType_T cim = convertVBoxOSType2CIMOSType(strOsTypeVBox.c_str(), fLongMode); 134 139 pNewDesc->addEntry(VirtualSystemDescriptionType_OS, 135 140 "", -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r45598 r45622 65 65 66 66 #include <iprt/asm.h> 67 #if HC_ARCH_BITS == 32 68 # include <iprt/asm-amd64-x86.h> 69 #endif 67 70 #include <iprt/path.h> 68 71 #include <iprt/dir.h> … … 191 194 mPAEEnabled = false; 192 195 #endif 196 mLongMode = HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled; 193 197 mSyntheticCpu = false; 194 198 mHPETEnabled = false; … … 351 355 for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot) 352 356 mSerialPorts[slot]->applyDefaults(aOsType); 357 358 /* Let the OS type select 64-bit ness. */ 359 mHWData->mLongMode = aOsType->is64Bit() 360 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled; 353 361 } 354 362 … … 2028 2036 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2029 2037 2030 switch(property) 2031 { 2032 case CPUPropertyType_PAE: 2033 *aVal = mHWData->mPAEEnabled; 2034 break; 2035 2036 case CPUPropertyType_Synthetic: 2037 *aVal = mHWData->mSyntheticCpu; 2038 break; 2039 2040 default: 2041 return E_INVALIDARG; 2038 switch (property) 2039 { 2040 case CPUPropertyType_PAE: 2041 *aVal = mHWData->mPAEEnabled; 2042 break; 2043 2044 case CPUPropertyType_Synthetic: 2045 *aVal = mHWData->mSyntheticCpu; 2046 break; 2047 2048 case CPUPropertyType_LongMode: 2049 if (mHWData->mLongMode == settings::Hardware::LongMode_Enabled) 2050 *aVal = TRUE; 2051 else if (mHWData->mLongMode == settings::Hardware::LongMode_Disabled) 2052 *aVal = FALSE; 2053 #if HC_ARCH_BITS == 64 2054 else 2055 *aVal = TRUE; 2056 #else 2057 else 2058 { 2059 *aVal = FALSE; 2060 2061 ComPtr<IGuestOSType> guestOSType; 2062 HRESULT hrc2 = mParent->GetGuestOSType(Bstr(mUserData->s.strOsType).raw(), guestOSType.asOutParam()); 2063 if (SUCCEEDED(hrc2)) 2064 { 2065 BOOL fIs64Bit = FALSE; 2066 hrc2 = pGuestOSType->COMGETTER(Is64Bit)(&fIs64Bit); AssertComRC(hrc); 2067 if (SUCCEEDED(hrc2) && fIs64Bit) 2068 { 2069 ComObjPtr<Host> ptrHost = mParent->host(); 2070 alock.release(); 2071 hrc2 = ptrHost->GetProcessorFeature(ProcessorFeature_LongMode, aVal) 2072 AssertComRC(hrc); 2073 if (FAILURE(hrc2)) 2074 *aVal = FALSE; 2075 } 2076 } 2077 #endif 2078 break; 2079 2080 default: 2081 return E_INVALIDARG; 2042 2082 } 2043 2083 return S_OK; … … 2054 2094 if (FAILED(rc)) return rc; 2055 2095 2056 switch(property) 2057 { 2058 case CPUPropertyType_PAE: 2059 setModified(IsModified_MachineData); 2060 mHWData.backup(); 2061 mHWData->mPAEEnabled = !!aVal; 2062 break; 2063 2064 case CPUPropertyType_Synthetic: 2065 setModified(IsModified_MachineData); 2066 mHWData.backup(); 2067 mHWData->mSyntheticCpu = !!aVal; 2068 break; 2069 2070 default: 2071 return E_INVALIDARG; 2096 switch (property) 2097 { 2098 case CPUPropertyType_PAE: 2099 setModified(IsModified_MachineData); 2100 mHWData.backup(); 2101 mHWData->mPAEEnabled = !!aVal; 2102 break; 2103 2104 case CPUPropertyType_Synthetic: 2105 setModified(IsModified_MachineData); 2106 mHWData.backup(); 2107 mHWData->mSyntheticCpu = !!aVal; 2108 break; 2109 2110 case CPUPropertyType_LongMode: 2111 setModified(IsModified_MachineData); 2112 mHWData.backup(); 2113 mHWData->mLongMode = !aVal ? settings::Hardware::LongMode_Disabled : settings::Hardware::LongMode_Enabled; 2114 break; 2115 2116 default: 2117 return E_INVALIDARG; 2072 2118 } 2073 2119 return S_OK; … … 8597 8643 mHWData->mPAEEnabled = data.fPAE; 8598 8644 mHWData->mSyntheticCpu = data.fSyntheticCpu; 8599 8645 mHWData->mLongMode = data.enmLongMode; 8600 8646 mHWData->mCPUCount = data.cCPUs; 8601 8647 mHWData->mCPUHotPlugEnabled = data.fCpuHotPlug; … … 9827 9873 data.fHardwareVirtForce = !!mHWData->mHWVirtExForceEnabled; 9828 9874 data.fPAE = !!mHWData->mPAEEnabled; 9875 data.enmLongMode = mHWData->mLongMode; 9829 9876 data.fSyntheticCpu = !!mHWData->mSyntheticCpu; 9830 9877 -
trunk/src/VBox/Main/xml/Settings.cpp
r45138 r45622 1734 1734 fSyntheticCpu(false), 1735 1735 fPAE(false), 1736 enmLongMode(HC_ARCH_BITS == 64 ? Hardware::LongMode_Enabled : Hardware::LongMode_Disabled), 1736 1737 cCPUs(1), 1737 1738 fCpuHotPlug(false), … … 1800 1801 && (fSyntheticCpu == h.fSyntheticCpu) 1801 1802 && (fPAE == h.fPAE) 1803 && (enmLongMode == h.enmLongMode) 1802 1804 && (cCPUs == h.cCPUs) 1803 1805 && (fCpuHotPlug == h.fCpuHotPlug) … … 2537 2539 pelmCPUChild->getAttributeValue("enabled", hw.fPAE); 2538 2540 2541 bool fLongMode; 2542 if ( (pelmCPUChild = pelmHwChild->findChildElement("LongMode")) 2543 && pelmCPUChild->getAttributeValue("enabled", fLongMode) ) 2544 hw.enmLongMode = fLongMode ? Hardware::LongMode_Enabled : Hardware::LongMode_Disabled; 2545 else 2546 hw.enmLongMode = Hardware::LongMode_Legacy; 2547 2539 2548 if ((pelmCPUChild = pelmHwChild->findChildElement("SyntheticCpu"))) 2540 2549 pelmCPUChild->getAttributeValue("enabled", hw.fSyntheticCpu); … … 3701 3710 pelmCPU->createChild("HardwareVirtExVPID")->setAttribute("enabled", hw.fVPID); 3702 3711 pelmCPU->createChild("PAE")->setAttribute("enabled", hw.fPAE); 3712 if (m->sv >= SettingsVersion_v1_14 && hw.enmLongMode != Hardware::LongMode_Legacy) 3713 pelmCPU->createChild("LongMode")->setAttribute("enabled", hw.enmLongMode == Hardware::LongMode_Enabled); 3703 3714 3704 3715 if (hw.fSyntheticCpu) … … 4990 5001 { 4991 5002 // VirtualBox 4.3 adds default frontend setting. 4992 if (!hardwareMachine.strDefaultFrontend.isEmpty()) 5003 if ( !hardwareMachine.strDefaultFrontend.isEmpty() 5004 || hardwareMachine.enmLongMode != Hardware::LongMode_Legacy) 4993 5005 m->sv = SettingsVersion_v1_14; 4994 5006 }
Note:
See TracChangeset
for help on using the changeset viewer.