Changeset 106384 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 16, 2024 1:58:41 PM (7 months ago)
- svn:sync-xref-src-repo-rev:
- 165197
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r106218 r106384 1221 1221 setting may slow down workloads causing many VM exits, so it is only 1222 1222 recommended for situation where there is a real need to be paranoid. 1223 </desc> 1224 </const> 1225 </enum> 1226 1227 <enum 1228 name="CPUPropertyTypeARM" 1229 uuid="c84685f6-6bd3-4071-97c6-86f34595648f" 1230 > 1231 <desc> 1232 Virtual CPU property type for ARM-based CPUs. This enumeration represents possible values of the 1233 IPlatformARM get- and setCPUProperty methods. 1234 </desc> 1235 <const name="Null" value="0"> 1236 <desc>Null value (never used by the API).</desc> 1237 </const> 1238 <const name="HWVirt" value="1"> 1239 <desc> 1240 Enables the hardware virtualization feature on the guest CPU. 1241 This requires the nested virtualization feature on the host CPU. 1223 1242 </desc> 1224 1243 </const> … … 7392 7411 <interface 7393 7412 name="IPlatformARM" extends="$unknown" 7394 uuid=" 75dff9be-6cb3-4857-bde6-2faf82ed9a8d"7413 uuid="002c75fe-3316-4920-aece-7d21ce6f624b" 7395 7414 wsmap="managed" 7396 7415 rest="managed" … … 7403 7422 </desc> 7404 7423 7405 <!-- Currently empty, but that should change before long... --> 7406 <attribute name="midlDoesNotLikeEmptyInterfaces" readonly="yes" type="boolean"/> 7424 <method name="getCPUProperty" const="yes"> 7425 <rest request="get" path="/vms/{vmid}/configuration/"/> 7426 <desc> 7427 Returns the virtual CPU boolean value of the specified property. 7428 7429 <result name="E_INVALIDARG"> 7430 Invalid property. 7431 </result> 7432 7433 </desc> 7434 <param name="property" type="CPUPropertyTypeARM" dir="in"> 7435 <desc> 7436 Property type to query. 7437 </desc> 7438 </param> 7439 <param name="value" type="boolean" dir="return"> 7440 <desc> 7441 Property value. 7442 </desc> 7443 </param> 7444 </method> 7445 7446 <method name="setCPUProperty"> 7447 <rest request="post" path="/vms/{vmid}/configuration/"/> 7448 <desc> 7449 Sets the virtual CPU boolean value of the specified property. 7450 7451 <result name="E_INVALIDARG"> 7452 Invalid property. 7453 </result> 7454 7455 </desc> 7456 <param name="property" type="CPUPropertyTypeARM" dir="in"> 7457 <desc> 7458 Property type to query. 7459 </desc> 7460 </param> 7461 <param name="value" type="boolean" dir="in"> 7462 <desc> 7463 Property value. 7464 </desc> 7465 </param> 7466 </method> 7407 7467 7408 7468 </interface> -
trunk/src/VBox/Main/include/PlatformARMImpl.h
r106061 r106384 68 68 HRESULT i_saveSettings(settings::PlatformARM &data); 69 69 HRESULT i_applyDefaults(GuestOSType *aOsType); 70 71 private: 72 73 // wrapped IPlatformARM methods 74 HRESULT getCPUProperty(CPUPropertyTypeARM_T aProperty, BOOL *aValue); 75 HRESULT setCPUProperty(CPUPropertyTypeARM_T aProperty, BOOL aValue); 70 76 }; 71 77 #endif /* !MAIN_INCLUDED_PlatformARMImpl_h */ -
trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp
r106139 r106384 1277 1277 static const TpmType_T aTpmTypes[] = 1278 1278 { 1279 TpmType_None 1279 TpmType_None, 1280 TpmType_v2_0 1280 1281 }; 1281 1282 aSupportedTpmTypes.assign(aTpmTypes, -
trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp
r106361 r106384 153 153 #endif 154 154 155 /* Get the ARM platform object. */ 156 ComPtr<IPlatformARM> platformARM; 157 hrc = platform->COMGETTER(ARM)(platformARM.asOutParam()); H(); 158 155 159 ComPtr<IPlatformProperties> pPlatformProperties; 156 160 hrc = platform->COMGETTER(Properties)(pPlatformProperties.asOutParam()); H(); … … 364 368 PCFGMNODE pCpum; 365 369 InsertConfigNode(pRoot, "CPUM", &pCpum); 370 371 /* Nested Virtualization. */ 372 BOOL fNestedHWVirt = FALSE; 373 hrc = platformARM->GetCPUProperty(CPUPropertyTypeARM_HWVirt, &fNestedHWVirt); H(); 374 InsertConfigInteger(pCpum, "NestedHWVirt", fNestedHWVirt ? true : false); 366 375 367 376 -
trunk/src/VBox/Main/src-server/PlatformARMImpl.cpp
r106061 r106384 31 31 #include "PlatformImpl.h" 32 32 #include "LoggingNew.h" 33 34 #include "AutoStateDep.h" 33 35 34 36 #include <VBox/settings.h> … … 239 241 HRESULT PlatformARM::i_loadSettings(const settings::PlatformARM &data) 240 242 { 241 RT_NOREF(data); 242 243 /* Nothing here yet. */ 243 AutoCaller autoCaller(this); 244 AssertComRCReturnRC(autoCaller.hrc()); 245 246 AutoReadLock mlock(mMachine COMMA_LOCKVAL_SRC_POS); 247 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 248 249 // simply copy 250 m->bd.assignCopy(&data); 244 251 return S_OK; 245 252 } … … 255 262 HRESULT PlatformARM::i_saveSettings(settings::PlatformARM &data) 256 263 { 257 RT_NOREF(data); 264 AutoCaller autoCaller(this); 265 AssertComRCReturnRC(autoCaller.hrc()); 266 267 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 268 269 data = *m->bd.data(); 270 271 return S_OK; 272 } 273 274 HRESULT PlatformARM::i_applyDefaults(GuestOSType *aOsType) 275 { 276 RT_NOREF(aOsType); 258 277 259 278 /* Nothing here yet. */ … … 261 280 } 262 281 263 HRESULT PlatformARM::i_applyDefaults(GuestOSType *aOsType) 264 { 265 RT_NOREF(aOsType); 266 267 /* Nothing here yet. */ 268 return S_OK; 269 } 282 HRESULT PlatformARM::getCPUProperty(CPUPropertyTypeARM_T aProperty, BOOL *aValue) 283 { 284 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 285 286 switch (aProperty) 287 { 288 case CPUPropertyTypeARM_HWVirt: 289 *aValue = m->bd->fNestedHWVirt; 290 break; 291 292 default: 293 return E_INVALIDARG; 294 } 295 return S_OK; 296 } 297 298 HRESULT PlatformARM::setCPUProperty(CPUPropertyTypeARM_T aProperty, BOOL aValue) 299 { 300 /* sanity */ 301 AutoCaller autoCaller(this); 302 AssertComRCReturnRC(autoCaller.hrc()); 303 304 /* the machine needs to be mutable */ 305 AutoMutableStateDependency adep(mMachine); 306 if (FAILED(adep.hrc())) return adep.hrc(); 307 308 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 309 310 switch (aProperty) 311 { 312 case CPUPropertyTypeARM_HWVirt: 313 { 314 m->bd.backup(); 315 m->bd->fNestedHWVirt = !!aValue; 316 break; 317 } 318 319 default: 320 return E_INVALIDARG; 321 } 322 323 alock.release(); 324 325 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS); 326 mMachine->i_setModified(Machine::IsModified_Platform); 327 328 return S_OK; 329 } -
trunk/src/VBox/Main/xml/Settings.cpp
r106061 r106384 3969 3969 3970 3970 #ifdef VBOX_WITH_VIRT_ARMV8 3971 PlatformARM::PlatformARM() 3971 PlatformARM::PlatformARM() : 3972 fNestedHWVirt(false) 3972 3973 { 3973 3974 } … … 3975 3976 bool PlatformARM::operator==(const PlatformARM& h) const 3976 3977 { 3977 RT_NOREF(h);3978 return true;3978 return (this == &h) 3979 || (fNestedHWVirt == h.fNestedHWVirt); 3979 3980 } 3980 3981 #endif /* VBOX_WITH_VIRT_ARMV8 */ … … 5306 5307 } 5307 5308 5309 #ifdef VBOX_WITH_VIRT_ARMV8 5310 /** 5311 * Reads the ARM platform settings. 5312 * 5313 * For settings >= v1.20 these were stored under the "Platform/arm" node. 5314 * 5315 * @param elmPlatformARM Platform/arm node to read from. 5316 * @param platARM Where to store the ARM platform settings. 5317 */ 5318 void MachineConfigFile::readPlatformARM(const xml::ElementNode &elmPlatformARM, 5319 PlatformARM &platARM) 5320 { 5321 xml::NodesLoop nl1(elmPlatformARM); 5322 5323 const xml::ElementNode *pelChild; 5324 while ((pelChild = nl1.forAllNodes())) 5325 { 5326 if (pelChild->nameEquals("CPU")) 5327 { 5328 const xml::ElementNode *pelmCPUChild; 5329 if ((pelmCPUChild = pelChild->findChildElement("NestedHWVirt"))) 5330 pelmCPUChild->getAttributeValue("enabled", platARM.fNestedHWVirt); 5331 } 5332 } 5333 } 5334 #endif 5335 5308 5336 /** 5309 5337 * Reads the platform settings. … … 5443 5471 case PlatformArchitecture_ARM: 5444 5472 { 5445 /* Nothing here yet -- add ARM-specific stuff as soon as we have it. */ 5473 const xml::ElementNode *pelmPlatformARM; 5474 5475 pelmPlatformARM = elmPlatformOrHardware.findChildElement("arm"); 5476 if (pelmPlatformARM) 5477 readPlatformARM(*pelmPlatformARM, plat.arm); 5446 5478 break; 5447 5479 } … … 7350 7382 } 7351 7383 7384 #ifdef VBOX_WITH_VIRT_ARMV8 7385 /** 7386 * Writes ARM-specific platform settings out to the XML. 7387 * 7388 * For settings >= v1.20 this creates a \<arm\> node under elmParent. 7389 * keys under that. Called for both the \<Machine\> node and for snapshots. 7390 * 7391 * @param elmParent Parent element. 7392 * For settings >= v1.20 this is the \<Platform\> element. 7393 * @param elmCPU CPU element platform-generic settings. 7394 * For settings >= v1.20 this is the \<Platform/CPU\> element. 7395 * @param platARM ARM-specific platform settings to use for building the XML. 7396 */ 7397 void MachineConfigFile::buildPlatformARMXML(xml::ElementNode &elmParent, const PlatformARM &platARM) 7398 { 7399 xml::ElementNode *pelmARMRoot = elmParent.createChild("arm"); 7400 xml::ElementNode *pelmARMCPU = pelmARMRoot->createChild("CPU"); 7401 7402 if (platARM.fNestedHWVirt) 7403 pelmARMCPU->createChild("NestedHWVirt")->setAttribute("enabled", platARM.fNestedHWVirt); 7404 } 7405 #endif /* VBOX_WITH_VIRT_ARMV8 */ 7406 7407 7352 7408 /** 7353 7409 * Stores platform-generic and platform-specific data and then writes out the XML. … … 7465 7521 if (plat.architectureType == PlatformArchitecture_x86) 7466 7522 buildPlatformX86XML(*pelmPlatformOrHardware, *pelmCPU, plat.x86); 7467 /** @todo Put ARM stuff here as soon as we have it. */ 7523 #ifdef VBOX_WITH_VIRT_ARMV8 7524 else if (plat.architectureType == PlatformArchitecture_ARM) 7525 { 7526 Assert(m->sv >= SettingsVersion_v1_20); 7527 buildPlatformARMXML(*pelmPlatformOrHardware, plat.arm); 7528 } 7529 #endif 7468 7530 } 7469 7531
Note:
See TracChangeset
for help on using the changeset viewer.