Changeset 55674 in vbox
- Timestamp:
- May 5, 2015 5:58:10 PM (10 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r55259 r55674 189 189 " [--pae on|off]\n" 190 190 " [--longmode on|off]\n" 191 " [-- synthcpu on|off]\n"191 " [--cpuid-portability-level <0..3>\n" 192 192 " [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]\n" 193 193 " [--cpuidremove <leaf>]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r55259 r55674 558 558 SHOW_BOOLEAN_METHOD( machine, GetCPUProperty(CPUPropertyType_PAE, &f), "pae", "PAE"); 559 559 SHOW_BOOLEAN_METHOD( machine, GetCPUProperty(CPUPropertyType_LongMode, &f), "longmode", "Long Mode"); 560 SHOW_ BOOLEAN_METHOD( machine, GetCPUProperty(CPUPropertyType_Synthetic, &f), "synthcpu", "Synthetic CPU");560 SHOW_ULONG_PROP( machine, CPUIDPortabilityLevel, "cpuid-portability-level", "CPUID Portability Level", ""); 561 561 562 562 if (details != VMINFO_MACHINEREADABLE) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r55259 r55674 60 60 MODIFYVM_PAE, 61 61 MODIFYVM_LONGMODE, 62 MODIFYVM_ SYNTHCPU,62 MODIFYVM_CPUID_PORTABILITY, 63 63 MODIFYVM_TFRESET, 64 64 MODIFYVM_PARAVIRTPROVIDER, … … 225 225 { "--pae", MODIFYVM_PAE, RTGETOPT_REQ_BOOL_ONOFF }, 226 226 { "--longmode", MODIFYVM_LONGMODE, RTGETOPT_REQ_BOOL_ONOFF }, 227 { "-- synthcpu", MODIFYVM_SYNTHCPU, RTGETOPT_REQ_BOOL_ONOFF},227 { "--cpuid-portability-level", MODIFYVM_CPUID_PORTABILITY, RTGETOPT_REQ_UINT32 }, 228 228 { "--triplefaultreset", MODIFYVM_TFRESET, RTGETOPT_REQ_BOOL_ONOFF }, 229 229 { "--paravirtprovider", MODIFYVM_PARAVIRTPROVIDER, RTGETOPT_REQ_STRING }, … … 638 638 } 639 639 640 case MODIFYVM_ SYNTHCPU:641 { 642 CHECK_ERROR(sessionMachine, SetCPUProperty(CPUPropertyType_Synthetic, ValueUnion.f));640 case MODIFYVM_CPUID_PORTABILITY: 641 { 642 CHECK_ERROR(sessionMachine, COMSETTER(CPUIDPortabilityLevel)(ValueUnion.u32)); 643 643 break; 644 644 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r55668 r55674 945 945 <enum 946 946 name="CPUPropertyType" 947 uuid=" 52bc41f4-a279-45da-88ab-3a1d86fb73eb"947 uuid="ed4094c1-d00e-483a-93e9-7163549ebd6e" 948 948 > 949 949 <desc> … … 961 961 </desc> 962 962 </const> 963 <const name="Synthetic" value="2"> 964 <desc> 965 This setting determines whether VirtualBox will expose a synthetic CPU to the guest to allow 966 teleporting between host systems that differ significantly. 967 </desc> 968 </const> 969 <const name="LongMode" value="3"> 963 <const name="LongMode" value="2"> 970 964 <desc> 971 965 This setting determines whether VirtualBox will advertise long mode … … 973 967 </desc> 974 968 </const> 975 <const name="TripleFaultReset" value="4">969 <const name="TripleFaultReset" value="3"> 976 970 <desc> 977 971 This setting determines whether a triple fault within a guest will trigger an internal … … 4176 4170 <interface 4177 4171 name="IMachine" extends="$unknown" 4178 uuid=" bfe5287a-5fbc-4ceb-9f0e-7fb317e78681"4172 uuid="701464d0-7284-42e9-b7b3-894cf31536b7" 4179 4173 wsmap="managed" 4180 4174 wrap-hint-server-addinterfaces="IInternalMachineControl" … … 4391 4385 is 1 - 100. 100 (the default) implies no limit. 4392 4386 </desc> 4387 </attribute> 4388 4389 <attribute name="CPUIDPortabilityLevel" type="unsigned long"> 4390 <desc>Virtual CPUID portability level, the higher number the fewer newer 4391 or vendor specific CPU feature is reported to the guest (via the CPUID 4392 instruction). The default level of zero (0) means that all virtualized 4393 feautres supported by the host is pass thru to the guest. While the 4394 three (3) is currently the level supressing the most features. 4395 4396 Exactly which of the CPUID features are left out by the VMM at which 4397 level is subject to change with each major version. 4398 </desc> 4393 4399 </attribute> 4394 4400 -
trunk/src/VBox/Main/include/MachineImpl.h
r55437 r55674 284 284 BOOL mPAEEnabled; 285 285 settings::Hardware::LongModeType mLongMode; 286 BOOL mSyntheticCpu;287 286 BOOL mTripleFaultReset; 288 287 ULONG mCPUCount; 289 288 BOOL mCPUHotPlugEnabled; 290 289 ULONG mCpuExecutionCap; 290 uint32_t mCpuIdPortabilityLevel; 291 291 BOOL mAccelerate3DEnabled; 292 292 BOOL mHPETEnabled; … … 866 866 HRESULT getCPUExecutionCap(ULONG *aCPUExecutionCap); 867 867 HRESULT setCPUExecutionCap(ULONG aCPUExecutionCap); 868 HRESULT getCPUIDPortabilityLevel(ULONG *aCPUIDPortabilityLevel); 869 HRESULT setCPUIDPortabilityLevel(ULONG aCPUIDPortabilityLevel); 868 870 HRESULT getMemorySize(ULONG *aMemorySize); 869 871 HRESULT setMemorySize(ULONG aMemorySize); -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r55502 r55674 1108 1108 } 1109 1109 1110 /* Synthetic CPU*/1111 BOOL fSyntheticCpu = false;1112 hrc = pMachine-> GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu);H();1113 InsertConfigInteger(pCPUM, " SyntheticCpu", fSyntheticCpu);1110 /* CPU Portability level, */ 1111 ULONG uCpuIdPortabilityLevel = 0; 1112 hrc = pMachine->COMGETTER(CPUIDPortabilityLevel)(&uCpuIdPortabilityLevel); H(); 1113 InsertConfigInteger(pCPUM, "PortableCpuIdLevel", uCpuIdPortabilityLevel); 1114 1114 1115 1115 /* Physical Address Extension (PAE) */ … … 1117 1117 hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE); H(); 1118 1118 InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE); 1119 1120 1119 1121 1120 /* -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r55670 r55674 193 193 #endif 194 194 mLongMode = HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled; 195 mSyntheticCpu = false;196 195 mTripleFaultReset = false; 197 196 mHPETEnabled = false; 197 mCpuExecutionCap = 100; /* Maximum CPU execution cap by default. */ 198 mCpuIdPortabilityLevel = 0; 198 199 199 200 /* default boot order: floppy - DVD - HDD */ … … 220 221 mIOCacheEnabled = true; 221 222 mIOCacheSize = 5; /* 5MB */ 222 223 /* Maximum CPU execution cap by default. */224 mCpuExecutionCap = 100;225 223 } 226 224 … … 1585 1583 } 1586 1584 1585 HRESULT Machine::getCPUIDPortabilityLevel(ULONG *aCPUIDPortabilityLevel) 1586 { 1587 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1588 1589 *aCPUIDPortabilityLevel = mHWData->mCpuIdPortabilityLevel; 1590 1591 return S_OK; 1592 } 1593 1594 HRESULT Machine::setCPUIDPortabilityLevel(ULONG aCPUIDPortabilityLevel) 1595 { 1596 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1597 1598 HRESULT hrc = i_checkStateDependency(MutableStateDep); 1599 if (SUCCEEDED(hrc)) 1600 { 1601 i_setModified(IsModified_MachineData); 1602 mHWData.backup(); 1603 mHWData->mCpuIdPortabilityLevel = aCPUIDPortabilityLevel; 1604 } 1605 return hrc; 1606 } 1607 1587 1608 HRESULT Machine::getEmulatedUSBCardReaderEnabled(BOOL *aEmulatedUSBCardReaderEnabled) 1588 1609 { … … 2139 2160 case CPUPropertyType_PAE: 2140 2161 *aValue = mHWData->mPAEEnabled; 2141 break;2142 2143 case CPUPropertyType_Synthetic:2144 *aValue = mHWData->mSyntheticCpu;2145 2162 break; 2146 2163 … … 2201 2218 mHWData.backup(); 2202 2219 mHWData->mPAEEnabled = !!aValue; 2203 break;2204 2205 case CPUPropertyType_Synthetic:2206 i_setModified(IsModified_MachineData);2207 mHWData.backup();2208 mHWData->mSyntheticCpu = !!aValue;2209 2220 break; 2210 2221 … … 8799 8810 mHWData->mHWVirtExForceEnabled = data.fHardwareVirtForce; 8800 8811 mHWData->mPAEEnabled = data.fPAE; 8801 mHWData->mSyntheticCpu = data.fSyntheticCpu;8802 8812 mHWData->mLongMode = data.enmLongMode; 8803 8813 mHWData->mTripleFaultReset = data.fTripleFaultReset; … … 8805 8815 mHWData->mCPUHotPlugEnabled = data.fCpuHotPlug; 8806 8816 mHWData->mCpuExecutionCap = data.ulCpuExecutionCap; 8817 mHWData->mCpuIdPortabilityLevel = data.uCpuIdPortabilityLevel; 8807 8818 8808 8819 // cpu … … 10125 10136 data.fPAE = !!mHWData->mPAEEnabled; 10126 10137 data.enmLongMode = mHWData->mLongMode; 10127 data.fSyntheticCpu = !!mHWData->mSyntheticCpu;10128 10138 data.fTripleFaultReset = !!mHWData->mTripleFaultReset; 10129 10130 /* Standard and Extended CPUID leafs. */ 10131 data.llCpuIdLeafs.clear(); 10132 for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); ++idx) 10133 { 10134 if (mHWData->mCpuIdStdLeafs[idx].ulId != UINT32_MAX) 10135 data.llCpuIdLeafs.push_back(mHWData->mCpuIdStdLeafs[idx]); 10136 } 10137 for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); ++idx) 10138 { 10139 if (mHWData->mCpuIdExtLeafs[idx].ulId != UINT32_MAX) 10140 data.llCpuIdLeafs.push_back(mHWData->mCpuIdExtLeafs[idx]); 10141 } 10142 10143 data.cCPUs = mHWData->mCPUCount; 10144 data.fCpuHotPlug = !!mHWData->mCPUHotPlugEnabled; 10145 data.ulCpuExecutionCap = mHWData->mCpuExecutionCap; 10139 data.cCPUs = mHWData->mCPUCount; 10140 data.fCpuHotPlug = !!mHWData->mCPUHotPlugEnabled; 10141 data.ulCpuExecutionCap = mHWData->mCpuExecutionCap; 10142 data.uCpuIdPortabilityLevel = mHWData->mCpuIdPortabilityLevel; 10146 10143 10147 10144 data.llCpus.clear(); … … 10158 10155 } 10159 10156 } 10157 10158 /* Standard and Extended CPUID leafs. */ 10159 data.llCpuIdLeafs.clear(); 10160 for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdStdLeafs); ++idx) 10161 if (mHWData->mCpuIdStdLeafs[idx].ulId != UINT32_MAX) 10162 data.llCpuIdLeafs.push_back(mHWData->mCpuIdStdLeafs[idx]); 10163 for (unsigned idx = 0; idx < RT_ELEMENTS(mHWData->mCpuIdExtLeafs); ++idx) 10164 if (mHWData->mCpuIdExtLeafs[idx].ulId != UINT32_MAX) 10165 data.llCpuIdLeafs.push_back(mHWData->mCpuIdExtLeafs[idx]); 10160 10166 10161 10167 // memory -
trunk/src/VBox/Main/xml/Settings.cpp
r55259 r55674 1963 1963 fUnrestrictedExecution(true), 1964 1964 fHardwareVirtForce(false), 1965 fSyntheticCpu(false),1966 1965 fTripleFaultReset(false), 1967 1966 fPAE(false), … … 1971 1970 fHPETEnabled(false), 1972 1971 ulCpuExecutionCap(100), 1972 uCpuIdPortabilityLevel(0), 1973 1973 ulMemorySizeMB((uint32_t)-1), 1974 1974 graphicsControllerType(GraphicsControllerType_VBoxVGA), … … 2037 2037 && (fUnrestrictedExecution == h.fUnrestrictedExecution) 2038 2038 && (fHardwareVirtForce == h.fHardwareVirtForce) 2039 && (fSyntheticCpu == h.fSyntheticCpu)2040 2039 && (fPAE == h.fPAE) 2041 2040 && (enmLongMode == h.enmLongMode) … … 2044 2043 && (fCpuHotPlug == h.fCpuHotPlug) 2045 2044 && (ulCpuExecutionCap == h.ulCpuExecutionCap) 2045 && (uCpuIdPortabilityLevel == h.uCpuIdPortabilityLevel) 2046 2046 && (fHPETEnabled == h.fHPETEnabled) 2047 2047 && (llCpus == h.llCpus) … … 2802 2802 2803 2803 if ((pelmCPUChild = pelmHwChild->findChildElement("SyntheticCpu"))) 2804 pelmCPUChild->getAttributeValue("enabled", hw.fSyntheticCpu); 2804 { 2805 bool fSyntheticCpu = false; 2806 pelmCPUChild->getAttributeValue("enabled", fSyntheticCpu); 2807 hw.uCpuIdPortabilityLevel = fSyntheticCpu ? 1 : 0; 2808 } 2809 pelmCPUChild->getAttributeValue("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel); 2805 2810 2806 2811 if ((pelmCPUChild = pelmHwChild->findChildElement("TripleFaultReset"))) … … 4095 4100 pelmCPU->createChild("LongMode")->setAttribute("enabled", hw.enmLongMode == Hardware::LongMode_Enabled); 4096 4101 4097 if (hw.fSyntheticCpu)4098 pelmCPU->createChild("SyntheticCpu")->setAttribute("enabled", hw.fSyntheticCpu);4099 4102 if (hw.fTripleFaultReset) 4100 4103 pelmCPU->createChild("TripleFaultReset")->setAttribute("enabled", hw.fTripleFaultReset); … … 4102 4105 if (hw.ulCpuExecutionCap != 100) 4103 4106 pelmCPU->setAttribute("executionCap", hw.ulCpuExecutionCap); 4107 if (hw.uCpuIdPortabilityLevel != 0) 4108 pelmCPU->setAttribute("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel); 4104 4109 4105 4110 /* Always save this setting as we have changed the default in 4.0 (on for large memory 64-bit systems). */ … … 5501 5506 5502 5507 /* 5503 * Check whether a paravirtualization provider other than "Legacy" is used, if so bump the version.5508 * Check simple configuration bits first, loopy stuff afterwards. 5504 5509 */ 5505 if (hardwareMachine.paravirtProvider != ParavirtProvider_Legacy) 5510 if ( hardwareMachine.paravirtProvider != ParavirtProvider_Legacy 5511 || hardwareMachine.uCpuIdPortabilityLevel != 0) 5512 { 5506 5513 m->sv = SettingsVersion_v1_15; 5507 else 5508 { 5509 /* 5510 * Check whether the hotpluggable flag of all storage devices differs 5511 * from the default for old settings. 5512 * AHCI ports are hotpluggable by default every other device is not. 5513 * Also check if there are USB storage controllers. 5514 */ 5515 for (StorageControllersList::const_iterator it = storageMachine.llStorageControllers.begin(); 5516 it != storageMachine.llStorageControllers.end(); 5517 ++it) 5518 { 5519 const StorageController &sctl = *it; 5520 5521 if (sctl.controllerType == StorageControllerType_USB) 5514 return; 5515 } 5516 5517 /* 5518 * Check whether the hotpluggable flag of all storage devices differs 5519 * from the default for old settings. 5520 * AHCI ports are hotpluggable by default every other device is not. 5521 * Also check if there are USB storage controllers. 5522 */ 5523 for (StorageControllersList::const_iterator it = storageMachine.llStorageControllers.begin(); 5524 it != storageMachine.llStorageControllers.end(); 5525 ++it) 5526 { 5527 const StorageController &sctl = *it; 5528 5529 if (sctl.controllerType == StorageControllerType_USB) 5530 { 5531 m->sv = SettingsVersion_v1_15; 5532 return; 5533 } 5534 5535 for (AttachedDevicesList::const_iterator it2 = sctl.llAttachedDevices.begin(); 5536 it2 != sctl.llAttachedDevices.end(); 5537 ++it2) 5538 { 5539 const AttachedDevice &att = *it2; 5540 5541 if ( ( att.fHotPluggable 5542 && sctl.controllerType != StorageControllerType_IntelAhci) 5543 || ( !att.fHotPluggable 5544 && sctl.controllerType == StorageControllerType_IntelAhci)) 5522 5545 { 5523 5546 m->sv = SettingsVersion_v1_15; 5524 5547 return; 5525 5548 } 5526 5527 for (AttachedDevicesList::const_iterator it2 = sctl.llAttachedDevices.begin(); 5528 it2 != sctl.llAttachedDevices.end(); 5529 ++it2) 5530 { 5531 const AttachedDevice &att = *it2; 5532 5533 if ( ( att.fHotPluggable 5534 && sctl.controllerType != StorageControllerType_IntelAhci) 5535 || ( !att.fHotPluggable 5536 && sctl.controllerType == StorageControllerType_IntelAhci)) 5537 { 5538 m->sv = SettingsVersion_v1_15; 5539 return; 5540 } 5541 } 5542 } 5543 5544 /* 5545 * Check if there is an xHCI (USB3) USB controller. 5546 */ 5547 for (USBControllerList::const_iterator it = hardwareMachine.usbSettings.llUSBControllers.begin(); 5548 it != hardwareMachine.usbSettings.llUSBControllers.end(); 5549 ++it) 5550 { 5551 const USBController &ctrl = *it; 5552 if (ctrl.enmType == USBControllerType_XHCI) 5553 { 5554 m->sv = SettingsVersion_v1_15; 5555 return; 5556 } 5557 } 5558 5559 /* 5560 * Check if any serial port uses the TCP backend. 5561 */ 5562 for (SerialPortsList::const_iterator it = hardwareMachine.llSerialPorts.begin(); 5563 it != hardwareMachine.llSerialPorts.end(); 5564 ++it) 5565 { 5566 const SerialPort &port = *it; 5567 if (port.portMode == PortMode_TCP) 5568 { 5569 m->sv = SettingsVersion_v1_15; 5570 return; 5571 } 5549 } 5550 } 5551 5552 /* 5553 * Check if there is an xHCI (USB3) USB controller. 5554 */ 5555 for (USBControllerList::const_iterator it = hardwareMachine.usbSettings.llUSBControllers.begin(); 5556 it != hardwareMachine.usbSettings.llUSBControllers.end(); 5557 ++it) 5558 { 5559 const USBController &ctrl = *it; 5560 if (ctrl.enmType == USBControllerType_XHCI) 5561 { 5562 m->sv = SettingsVersion_v1_15; 5563 return; 5564 } 5565 } 5566 5567 /* 5568 * Check if any serial port uses the TCP backend. 5569 */ 5570 for (SerialPortsList::const_iterator it = hardwareMachine.llSerialPorts.begin(); 5571 it != hardwareMachine.llSerialPorts.end(); 5572 ++it) 5573 { 5574 const SerialPort &port = *it; 5575 if (port.portMode == PortMode_TCP) 5576 { 5577 m->sv = SettingsVersion_v1_15; 5578 return; 5572 5579 } 5573 5580 } -
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r55466 r55674 2103 2103 typedef struct CPUMCPUIDCONFIG 2104 2104 { 2105 bool fSyntheticCpu;2106 2105 bool fNt4LeafLimit; 2107 2106 bool fInvariantTsc; … … 3511 3510 int rc; 3512 3511 3513 /** @cfgm{/CPUM/SyntheticCpu, boolean, false}3514 * Enables the Synthetic CPU. The Vendor ID and Processor Name are3515 * completely overridden by VirtualBox custom strings. Some3516 * CPUID information is withheld, like the cache info.3517 *3518 * This is obsoleted by PortableCpuIdLevel. */3519 rc = CFGMR3QueryBoolDef(pCpumCfg, "SyntheticCpu", &pConfig->fSyntheticCpu, false);3520 AssertRCReturn(rc, rc);3521 3522 3512 /** @cfgm{/CPUM/PortableCpuIdLevel, 8-bit, 0, 3, 0} 3523 3513 * When non-zero CPUID features that could cause portability issues will be … … 3525 3515 * values should only be used when older CPUs are involved since it may 3526 3516 * harm performance and maybe also cause problems with specific guests. */ 3527 rc = CFGMR3QueryU8Def(pCpumCfg, "PortableCpuIdLevel", &pVM->cpum.s.u8PortableCpuIdLevel, pConfig->fSyntheticCpu ? 1 :0);3517 rc = CFGMR3QueryU8Def(pCpumCfg, "PortableCpuIdLevel", &pVM->cpum.s.u8PortableCpuIdLevel, 0); 3528 3518 AssertLogRelRCReturn(rc, rc); 3529 3519
Note:
See TracChangeset
for help on using the changeset viewer.