VirtualBox

Changeset 107220 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Dec 3, 2024 9:46:18 AM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166224
Message:

VMM/CPUM,TM: Removed obsolete raw-mode CR4 masks. jiraref:VBP-1466

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r107113 r107220  
    23072307        return VMSetError(pVM, VERR_UNSUPPORTED_CPU, RT_SRC_POS, "Host CPU does not support RDTSC.");
    23082308#endif
    2309 
    2310     /*
    2311      * Setup the CR4 AND and OR masks used in the raw-mode switcher.
    2312      */
    2313     pVM->cpum.s.CR4.AndMask = X86_CR4_OSXMMEEXCPT | X86_CR4_PVI | X86_CR4_VME;
    2314     pVM->cpum.s.CR4.OrMask  = X86_CR4_OSFXSR;
    23152309
    23162310    /*
     
    50515045                    pVCpu->cpum.s.Hyper.dr[0], pVCpu->cpum.s.Hyper.dr[1], pVCpu->cpum.s.Hyper.dr[2], pVCpu->cpum.s.Hyper.dr[3],
    50525046                    pVCpu->cpum.s.Hyper.dr[4], pVCpu->cpum.s.Hyper.dr[5], pVCpu->cpum.s.Hyper.dr[6], pVCpu->cpum.s.Hyper.dr[7]);
    5053     pHlp->pfnPrintf(pHlp, "CR4OrMask=%#x CR4AndMask=%#x\n", pVM->cpum.s.CR4.OrMask, pVM->cpum.s.CR4.AndMask);
    50545047}
    50555048
     
    53065299
    53075300
    5308 
    5309 /**
    5310  * API for controlling a few of the CPU features found in CR4.
    5311  *
    5312  * Currently only X86_CR4_TSD is accepted as input.
    5313  *
    5314  * @returns VBox status code.
    5315  *
    5316  * @param   pVM     The cross context VM structure.
    5317  * @param   fOr     The CR4 OR mask.
    5318  * @param   fAnd    The CR4 AND mask.
    5319  */
    5320 VMMR3DECL(int) CPUMR3SetCR4Feature(PVM pVM, RTHCUINTREG fOr, RTHCUINTREG fAnd)
    5321 {
    5322     AssertMsgReturn(!(fOr & ~(X86_CR4_TSD)), ("%#x\n", fOr), VERR_INVALID_PARAMETER);
    5323     AssertMsgReturn((fAnd & ~(X86_CR4_TSD)) == ~(X86_CR4_TSD), ("%#x\n", fAnd), VERR_INVALID_PARAMETER);
    5324 
    5325     pVM->cpum.s.CR4.OrMask &= fAnd;
    5326     pVM->cpum.s.CR4.OrMask |= fOr;
    5327 
    5328     return VINF_SUCCESS;
    5329 }
    5330 
    5331 
    53325301/**
    53335302 * Called when the ring-3 init phase completes.
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r107194 r107220  
    657657     */
    658658    pVM->tm.s.enmOriginalTSCMode = pVM->tm.s.enmTSCMode;
    659 #if !defined(VBOX_VMM_TARGET_ARMV8)
    660     CPUMR3SetCR4Feature(pVM, X86_CR4_TSD, ~X86_CR4_TSD);
    661 #endif
    662659    LogRel(("TM:     cTSCTicksPerSecond=%'RU64 (%#RX64) enmTSCMode=%d (%s) TSCMultiplier=%u\n"
    663660            "TM: cTSCTicksPerSecondHost=%'RU64 (%#RX64)\n"
  • trunk/src/VBox/VMM/include/CPUMInternal.h

    r106061 r107220  
    355355    uint32_t                fHostUseFlags;
    356356
    357     /** CR4 mask
    358      * @todo obsolete? */
    359     struct
    360     {
    361         uint32_t            AndMask; /**< @todo Move these to the per-CPU structure and fix the switchers. Saves a register! */
    362         uint32_t            OrMask;
    363     } CR4;
    364 
    365357    /** The (more) portable CPUID level. */
    366358    uint8_t                 u8PortableCpuIdLevel;
     
    392384
    393385    /** Align to 64-byte boundary. */
    394     uint8_t                 abPadding2[16];
     386    uint8_t                 abPadding2[16+8];
    395387
    396388    /** Host CPU feature information.
  • trunk/src/VBox/VMM/include/CPUMInternal.mac

    r106061 r107220  
    8181    .fHostUseFlags              resd    1
    8282
    83     ; CR4 masks
    84     .CR4.AndMask                resd    1
    85     .CR4.OrMask                 resd    1
    8683    .u8PortableCpuIdLevel       resb    1
    8784    .fPendingRestore            resb    1
  • trunk/src/VBox/VMM/testcase/tstVMStruct.h

    r106061 r107220  
    3838    GEN_CHECK_SIZE(CPUM);    // has .mac
    3939    GEN_CHECK_OFF(CPUM, fHostUseFlags);
    40     GEN_CHECK_OFF(CPUM, CR4);
    4140#ifndef VBOX_FOR_DTRACE_LIB
    4241    GEN_CHECK_OFF(CPUM, u8PortableCpuIdLevel);
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