VirtualBox

Changeset 76549 in vbox


Ignore:
Timestamp:
Dec 31, 2018 4:08:00 AM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Use the CR0, CR4 valid masks functions from r127850.

File:
1 edited

Legend:

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

    r76200 r76549  
    55555555
    55565556            uint64_t const uOldCrX = pVCpu->cpum.GstCtx.cr0;
    5557             uint32_t const fValid  = X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS
    5558                                    | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM
    5559                                    | X86_CR0_NW | X86_CR0_CD | X86_CR0_PG;
     5557            uint32_t const fValid  = CPUMGetGuestCR0ValidMask();
    55605558
    55615559            /* ET is hardcoded on 486 and later. */
     
    57995797            uint64_t const uOldCrX = pVCpu->cpum.GstCtx.cr4;
    58005798
    5801             /** @todo Shouldn't this look at the guest CPUID bits to determine
    5802              *        valid bits? e.g. if guest CPUID doesn't allow X86_CR4_OSXMMEEXCPT, we
    5803              *        should #GP(0). */
    5804             /* reserved bits */
    5805             uint32_t fValid = X86_CR4_VME | X86_CR4_PVI
    5806                             | X86_CR4_TSD | X86_CR4_DE
    5807                             | X86_CR4_PSE | X86_CR4_PAE
    5808                             | X86_CR4_MCE | X86_CR4_PGE
    5809                             | X86_CR4_PCE | X86_CR4_OSFXSR
    5810                             | X86_CR4_OSXMMEEXCPT;
    5811             if (IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fVmx)
    5812                 fValid |= X86_CR4_VMXE;
    5813             if (IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fXSaveRstor)
    5814                 fValid |= X86_CR4_OSXSAVE;
    5815             if (IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fPcid)
    5816                 fValid |= X86_CR4_PCIDE;
    5817             if (IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fFsGsBase)
    5818                 fValid |= X86_CR4_FSGSBASE;
     5799            /* Reserved bits. */
     5800            uint32_t const fValid = CPUMGetGuestCR4ValidMask(pVCpu->CTX_SUFF(pVM));
    58195801            if (uNewCrX & ~(uint64_t)fValid)
    58205802            {
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