VirtualBox

Changeset 30145 in vbox for trunk/src


Ignore:
Timestamp:
Jun 10, 2010 11:52:14 AM (15 years ago)
Author:
vboxsync
Message:

Preparations for fixing the NXE assumption in the 32/64 switcher.

Location:
trunk/src/VBox/VMM
Files:
5 edited

Legend:

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

    r29250 r30145  
    14221422        }
    14231423
     1424        case CPUMCPUIDFEATURE_NXE:
     1425        {
     1426            if (pVM->cpum.s.aGuestCpuIdExt[0].eax >= 0x80000001)
     1427                return !!(pVM->cpum.s.aGuestCpuIdExt[1].edx & X86_CPUID_AMD_FEATURE_EDX_NX);
     1428        }
     1429
    14241430        case CPUMCPUIDFEATURE_RDTSCP:
    14251431        {
  • trunk/src/VBox/VMM/VMMSwitcher.cpp

    r28800 r30145  
    527527            }
    528528
    529 
    530             ///@todo case FIX_CR4_MASK:
    531             ///@todo case FIX_CR4_OSFSXR:
     529            /*
     530             * Store the EFER or mask for the 32->64 bit switcher.
     531             */
     532            case FIX_EFER_OR_MASK:
     533            {
     534                uint32_t u32OrMask = MSR_K6_EFER_LME | MSR_K6_EFER_SCE;
     535                if (CPUMGetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_NXE))
     536                    u32OrMask |= MSR_K6_EFER_NXE;
     537
     538                *uSrc.pu32 = u32OrMask;
     539                break;
     540            }
    532541
    533542            /*
  • trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac

    r28800 r30145  
    228228    rdmsr
    229229    or      eax, MSR_K6_EFER_LME | MSR_K6_EFER_SCE | MSR_K6_EFER_NXE
     230;    FIXUP FIX_EFER_OR_MASK
     231;    or      eax, 0
     232    or      eax, 0
     233    and     eax, ~(MSR_K6_EFER_FFXSR) ; turn off fast fxsave/fxrstor (skipping xmm regs)
    230234    wrmsr
    231235    mov     edx, ebp
  • trunk/src/VBox/VMM/VMMSwitcher/VMMSwitcher.h

    r28800 r30145  
    4343#define FIX_HYPER_TSS           20
    4444#define FIX_GC_TSS_GDTE_DW2     21
    45 #define FIX_CR4_MASK            22
    46 #define FIX_CR4_OSFSXR          23
    4745#define FIX_NO_FXSAVE_JMP       24
    4846#define FIX_NO_SYSENTER_JMP     25
     
    5957#define FIX_GC_64_BIT_CPUM_OFF  36
    6058#define FIX_GC_CPUMCPU_OFF      37
     59#define FIX_EFER_OR_MASK        38
    6160#define FIX_THE_END             255
    6261/** @} */
  • trunk/src/VBox/VMM/VMMSwitcher/VMMSwitcher.mac

    r28800 r30145  
    8787%define FIX_HYPER_TSS           20
    8888%define FIX_GC_TSS_GDTE_DW2     21
    89 %define FIX_CR4_MASK            22
    90 %define FIX_CR4_OSFSXR          23
    9189%define FIX_NO_FXSAVE_JMP       24
    9290%define FIX_NO_SYSENTER_JMP     25
     
    103101%define FIX_GC_64_BIT_CPUM_OFF  36
    104102%define FIX_GC_CPUMCPU_OFF      37
     103%define FIX_EFER_OR_MASK        38
    105104%define FIX_THE_END             255
    106105;/** @} */
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