VirtualBox

Changeset 106384 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Oct 16, 2024 1:58:41 PM (5 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165197
Message:

Main: Code for configuring and enabling nested virtualization support on ARM (M3 based hardware + macOS 15.0 aka Sequioa), bugref:10747

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/PlatformARMImpl.cpp

    r106061 r106384  
    3131#include "PlatformImpl.h"
    3232#include "LoggingNew.h"
     33
     34#include "AutoStateDep.h"
    3335
    3436#include <VBox/settings.h>
     
    239241HRESULT PlatformARM::i_loadSettings(const settings::PlatformARM &data)
    240242{
    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);
    244251    return S_OK;
    245252}
     
    255262HRESULT PlatformARM::i_saveSettings(settings::PlatformARM &data)
    256263{
    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
     274HRESULT PlatformARM::i_applyDefaults(GuestOSType *aOsType)
     275{
     276    RT_NOREF(aOsType);
    258277
    259278    /* Nothing here yet. */
     
    261280}
    262281
    263 HRESULT PlatformARM::i_applyDefaults(GuestOSType *aOsType)
    264 {
    265     RT_NOREF(aOsType);
    266 
    267     /* Nothing here yet. */
    268     return S_OK;
    269 }
     282HRESULT 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
     298HRESULT 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}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette