VirtualBox

Ignore:
Timestamp:
Oct 16, 2012 3:34:05 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81423
Message:

VMM: APIC refactor. Moved APIC base MSR to the VCPU (where it belongs) for lockless accesses.

File:
1 edited

Legend:

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

    r43387 r43657  
    4040#include <VBox/vmm/cpumctx-v1_6.h>
    4141#include <VBox/vmm/pgm.h>
     42#include <VBox/vmm/pdmapi.h>
    4243#include <VBox/vmm/mm.h>
    4344#include <VBox/vmm/selm.h>
     
    14901491{
    14911492    /** @todo anything different for VCPU > 0? */
    1492     PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
     1493    PCPUMCTX pCtx = &pVCpu->cpum.s.Guest;
    14931494
    14941495    /*
     
    15751576    */
    15761577    pCtx->msrEFER                   = 0;
     1578
     1579    /*
     1580     * Get the APIC base MSR from the APIC device. For historical reasons (saved state), the APIC base
     1581     * continues to reside in the APIC device and we cache it here in the VCPU for all further accesses.
     1582     */
     1583    PDMApicGetBase(pVCpu, &pCtx->msrApicBase);
    15771584}
    15781585
     
    15911598
    15921599#ifdef VBOX_WITH_CRASHDUMP_MAGIC
    1593         PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(&pVM->aCpus[i]);
     1600        PCPUMCTX pCtx = &pVM->aCpus[i].cpum.s.Guest;
    15941601
    15951602        /* Magic marker for searching in crash dumps. */
     
    27022709    }
    27032710
    2704     /* Notify PGM of the NXE states in case they've changed. */
    27052711    for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++)
     2712    {
     2713        /* Notify PGM of the NXE states in case they've changed. */
    27062714        PGMNotifyNxeChanged(&pVM->aCpus[iCpu], !!(pVM->aCpus[iCpu].cpum.s.Guest.msrEFER & MSR_K6_EFER_NXE));
     2715
     2716        /* Cache the local APIC base from the APIC device. During init. this is done in CPUMR3ResetCpu(). */
     2717        PDMApicGetBase(&pVM->aCpus[iCpu], &pVM->aCpus[iCpu].cpum.s.Guest.msrApicBase);
     2718    }
    27072719    return VINF_SUCCESS;
    27082720}
     
    30643076    pHlp->pfnPrintf(pHlp, "Guest CPUM (VCPU %d) state: %s\n", pVCpu->idCpu, pszComment);
    30653077
    3066     PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
     3078    PCPUMCTX pCtx = &pVCpu->cpum.s.Guest;
    30673079    cpumR3InfoOne(pVM, pCtx, CPUMCTX2CORE(pCtx), pHlp, enmType, "");
    30683080}
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