VirtualBox

Changeset 9724 in vbox


Ignore:
Timestamp:
Jun 16, 2008 1:43:33 PM (17 years ago)
Author:
vboxsync
Message:

EFER updates implemented for wrmsr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r9722 r9724  
    22882288
    22892289    case MSR_K6_EFER:
    2290         AssertFailed();
    2291         pCtx->msrEFER = val;
    2292         break;
     2290    {
     2291        uint64_t uMask = 0;
     2292
     2293        /* Filter out those bits the guest is allowed to change. (e.g. LMA is read-only) */
     2294        CPUMGetGuestCpuId(pVM, 0x80000001, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
     2295        if (u32Features & X86_CPUID_AMD_FEATURE_EDX_NX)
     2296            uMask |= MSR_K6_EFER_NXE;
     2297        if (u32Features & X86_CPUID_AMD_FEATURE_EDX_LONG_MODE)
     2298            uMask |= MSR_K6_EFER_LME;
     2299        if (u32Features & X86_CPUID_AMD_FEATURE_EDX_SEP)
     2300            uMask |= MSR_K6_EFER_SCE;
     2301
     2302        /* There are a few more: e.g. MSR_K6_EFER_FFXSR, MSR_K6_EFER_LMSLE */
     2303        AssertMsg(!(val & ~(MSR_K6_EFER_NXE|MSR_K6_EFER_LME|MSR_K6_EFER_SCE)), ("Unexpected value %RX64\n", val));
     2304        pCtx->msrEFER = (pCtx->msrEFER & ~uMask) | (val & uMask);
     2305        break;
     2306    }
    22932307
    22942308    case MSR_K8_SF_MASK:
Note: See TracChangeset for help on using the changeset viewer.

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