VirtualBox

Changeset 95793 in vbox


Ignore:
Timestamp:
Jul 25, 2022 11:07:54 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152514
Message:

VMM/CPUM: Clear NX if no PAE, as it is causing trouble for 32-bit Windows 7. Followup to r151799. bugref:9898

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

Legend:

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

    r94943 r95793  
    43944394            cpumR3MsrRegStats(pVM);
    43954395
     4396            /* There shouldn't be any more calls to CPUMR3SetGuestCpuIdFeature and
     4397               CPUMR3ClearGuestCpuIdFeature now, so do some final CPUID polishing (NX). */
     4398            cpumR3CpuIdRing3InitDone(pVM);
     4399
    43964400            /* Create VMX-preemption timer for nested guests if required.  Must be
    43974401               done here as CPUM is initialized before TM. */
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r95361 r95793  
    37253725
    37263726
     3727/**
     3728 * Do some final polishing after all calls to CPUMR3SetGuestCpuIdFeature and
     3729 * CPUMR3ClearGuestCpuIdFeature are (probably) done.
     3730 *
     3731 * @param   pVM             The cross context VM structure.
     3732 */
     3733void cpumR3CpuIdRing3InitDone(PVM pVM)
     3734{
     3735    /*
     3736     * Do not advertise NX w/o PAE, seems to confuse windows 7 (black screen very
     3737     * early in real mode).
     3738     */
     3739    PCPUMCPUIDLEAF pStdLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001));
     3740    PCPUMCPUIDLEAF pExtLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001));
     3741    if (pStdLeaf && pExtLeaf)
     3742    {
     3743        if (   !(pStdLeaf->uEdx & X86_CPUID_FEATURE_EDX_PAE)
     3744            && (pExtLeaf->uEdx & X86_CPUID_EXT_FEATURE_EDX_NX))
     3745            pExtLeaf->uEdx &= ~X86_CPUID_EXT_FEATURE_EDX_NX;
     3746    }
     3747}
     3748
     3749
    37273750/*
    37283751 *
  • trunk/src/VBox/VMM/include/CPUMInternal.h

    r94934 r95793  
    502502int                 cpumR3InitCpuIdAndMsrs(PVM pVM, PCCPUMMSRS pHostMsrs);
    503503void                cpumR3InitVmxGuestFeaturesAndMsrs(PVM pVM, PCVMXMSRS pHostVmxMsrs, PVMXMSRS pGuestVmxMsrs);
     504void                cpumR3CpuIdRing3InitDone(PVM pVM);
    504505void                cpumR3SaveCpuId(PVM pVM, PSSMHANDLE pSSM);
    505506int                 cpumR3LoadCpuId(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, PCCPUMMSRS pGuestMsrs);
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