VirtualBox

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


Ignore:
Timestamp:
Apr 21, 2009 1:20:48 PM (16 years ago)
Author:
vboxsync
Message:

CPUMGetGuestCpuId needs a pVCpu parameter.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/EM.cpp

    r19032 r19076  
    16441644        {
    16451645            uint32_t u32Dummy, u32Features, u32ExtFeatures;
    1646             CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Features);
     1646            CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Features);
    16471647            if (u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR)
    16481648            {
     
    31003100        uint32_t u32Dummy, u32Features;
    31013101
    3102         CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
     3102        CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
    31033103        if (!(u32Features & X86_CPUID_FEATURE_EDX_PAE))
    31043104            return EMSTATE_REM;
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r19041 r19076  
    25352535    AssertPtr(pEax); AssertPtr(pEbx); AssertPtr(pEcx); AssertPtr(pEdx);
    25362536
    2537     CPUMGetGuestCpuId(pDevIns->Internal.s.pVMR3, iLeaf, pEax, pEbx, pEcx, pEdx);
     2537    CPUMGetGuestCpuId(VMMGetCpu(pDevIns->Internal.s.pVMR3), iLeaf, pEax, pEbx, pEcx, pEdx);
    25382538
    25392539    LogFlow(("pdmR3DevHlp_GetCpuId: caller='%s'/%d: returns void - *pEax=%#x *pEbx=%#x *pEcx=%#x *pEdx=%#x\n",
  • trunk/src/VBox/VMM/PGM.cpp

    r19044 r19076  
    19411941    /** @todo How to test for the 40 bits support? Long mode seems to be the test criterium. */
    19421942    uint32_t u32Dummy, u32Features;
    1943     CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
     1943    CPUMGetGuestCpuId(VMMGetCpu(pVM), 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
    19441944
    19451945    if (u32Features & X86_CPUID_FEATURE_EDX_PSE36)
     
    39763976            uint32_t u32Dummy, u32Features;
    39773977
    3978             CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
     3978            CPUMGetGuestCpuId(VMMGetCpu(pVM), 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
    39793979            if (!(u32Features & X86_CPUID_FEATURE_EDX_PAE))
    39803980                return VMSetRuntimeError(pVM, VMSETRTERR_FLAGS_FATAL, "PAEmode",
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r19075 r19076  
    10441044 * Gets a CpuId leaf.
    10451045 *
    1046  * @param   pVM     The VM handle.
     1046 * @param   pVCpu   The VMCPU handle.
    10471047 * @param   iLeaf   The CPUID leaf to get.
    10481048 * @param   pEax    Where to store the EAX value.
     
    10511051 * @param   pEdx    Where to store the EDX value.
    10521052 */
    1053 VMMDECL(void) CPUMGetGuestCpuId(PVM pVM, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)
    1054 {
     1053VMMDECL(void) CPUMGetGuestCpuId(PVMCPU pVCpu, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)
     1054{
     1055    PVM pVM = pVCpu->CTX_SUFF(pVM);
     1056
    10551057    PCCPUMCPUID pCpuId;
    10561058    if (iLeaf < RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdStd))
     
    10671069    *pEcx = pCpuId->ecx;
    10681070    *pEdx = pCpuId->edx;
     1071
     1072    if (    iLeaf == 1
     1073        &&  pVM->cCPUs > 1)
     1074    {
     1075        /* Bits 31-24: Initial APIC ID */
     1076        Assert(pVCpu->idCpu <= 255);
     1077        *pEbx |= (pVCpu->idCpu << 24);
     1078    }
     1079
    10691080    Log2(("CPUMGetGuestCpuId: iLeaf=%#010x %RX32 %RX32 %RX32 %RX32\n", iLeaf, *pEax, *pEbx, *pEcx, *pEdx));
    10701081}
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r19032 r19076  
    19451945
    19461946    /* Note: operates the same in 64 and non-64 bits mode. */
    1947     CPUMGetGuestCpuId(pVM, iLeaf, &pRegFrame->eax, &pRegFrame->ebx, &pRegFrame->ecx, &pRegFrame->edx);
     1947    CPUMGetGuestCpuId(pVCpu, iLeaf, &pRegFrame->eax, &pRegFrame->ebx, &pRegFrame->ecx, &pRegFrame->edx);
    19481948    Log(("Emulate: CPUID %x -> %08x %08x %08x %08x\n", iLeaf, pRegFrame->eax, pRegFrame->ebx, pRegFrame->ecx, pRegFrame->edx));
    19491949    return VINF_SUCCESS;
     
    26572657        return VERR_EM_INTERPRETER; /* supervisor only */
    26582658
    2659     CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
     2659    CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
    26602660    if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))
    26612661        return VERR_EM_INTERPRETER; /* not supported */
     
    26812681        return VERR_EM_INTERPRETER; /* supervisor only */
    26822682
    2683     CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
     2683    CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
    26842684    if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))
    26852685        return VERR_EM_INTERPRETER; /* not supported */
     
    27922792        return VERR_EM_INTERPRETER; /* supervisor only */
    27932793
    2794     CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
     2794    CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
    27952795    if (!(u32Features & X86_CPUID_FEATURE_EDX_MSR))
    27962796        return VERR_EM_INTERPRETER; /* not supported */
     
    29262926        return VERR_EM_INTERPRETER; /* supervisor only */
    29272927
    2928     CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
     2928    CPUMGetGuestCpuId(pVCpu, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
    29292929    if (!(u32Features & X86_CPUID_FEATURE_EDX_MSR))
    29302930        return VERR_EM_INTERPRETER; /* not supported */
     
    29632963
    29642964        /* Filter out those bits the guest is allowed to change. (e.g. LMA is read-only) */
    2965         CPUMGetGuestCpuId(pVM, 0x80000001, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
     2965        CPUMGetGuestCpuId(pVCpu, 0x80000001, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
    29662966        if (u32Features & X86_CPUID_AMD_FEATURE_EDX_NX)
    29672967            uMask |= MSR_K6_EFER_NXE;
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