VirtualBox

Changeset 43667 in vbox


Ignore:
Timestamp:
Oct 17, 2012 11:54:39 AM (12 years ago)
Author:
vboxsync
Message:

VMM: APIC refactor, cache APIC base MSR during init phase.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r42427 r43667  
    414414
    415415VMMR3DECL(int)          CPUMR3Init(PVM pVM);
     416VMMR3DECL(int)          CPUMR3InitCompleted(PVM pVM);
    416417VMMR3DECL(void)         CPUMR3Relocate(PVM pVM);
    417418VMMR3DECL(int)          CPUMR3Term(PVM pVM);
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r43657 r43667  
    864864        {
    865865            PVM pVM = pVCpu->CTX_SUFF(pVM);
    866             if (   (    pVM->cpum.s.aGuestCpuIdStd[0].eax >= 1
     866            if (   (    pVM->cpum.s.aGuestCpuIdStd[0].eax >= 1                                  /* APIC Std feature */
    867867                    && (pVM->cpum.s.aGuestCpuIdStd[1].edx & X86_CPUID_FEATURE_EDX_APIC))
    868                 || (   pVM->cpum.s.aGuestCpuIdExt[0].eax >= 0x80000001
     868                || (   pVM->cpum.s.aGuestCpuIdExt[0].eax >= 0x80000001                          /* APIC Ext feature (AMD) */
    869869                    && pVM->cpum.s.enmGuestCpuVendor == CPUMCPUVENDOR_AMD
    870                     && (pVM->cpum.s.aGuestCpuIdExt[1].edx & X86_CPUID_AMD_FEATURE_EDX_APIC)))
     870                    && (pVM->cpum.s.aGuestCpuIdExt[1].edx & X86_CPUID_AMD_FEATURE_EDX_APIC))
     871                || (    pVM->cpum.s.aGuestCpuIdStd[0].eax >= 1                                  /* x2APIC */
     872                    && (pVM->cpum.s.aGuestCpuIdStd[1].ecx & X86_CPUID_FEATURE_ECX_X2APIC)))
    871873            {
    872874                *puValue = pVCpu->cpum.s.Guest.msrApicBase;
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r43657 r43667  
    43824382}
    43834383
     4384
     4385/**
     4386 * Called when the ring-3 init phase completes.
     4387 *
     4388 * @returns VBox status code.
     4389 * @param   pVM                 Pointer to the VM.
     4390 */
     4391VMMR3DECL(int) CPUMR3InitCompleted(PVM pVM)
     4392{
     4393    for (VMCPUID i = 0; i < pVM->cCpus; i++)
     4394    {
     4395        /* Cache the APIC base (from the APIC device) once it has been initialized. */
     4396        PDMApicGetBase(&pVM->aCpus[i], &pVM->aCpus[i].cpum.s.Guest.msrApicBase);
     4397        Log(("CPUMR3InitCompleted pVM=%p APIC base[%u]=%RX64\n", pVM, (unsigned)i, pVM->aCpus[i].cpum.s.Guest.msrApicBase));
     4398    }
     4399    return VINF_SUCCESS;
     4400}
     4401
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r43394 r43667  
    627627        {
    628628            /*
     629             * CPUM's post-initialization (APIC base MSR caching).
     630             */
     631            rc = CPUMR3InitCompleted(pVM);
     632            AssertRCReturn(rc, rc);
     633
     634            /*
    629635             * Set page attributes to r/w for stack pages.
    630636             */
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