VirtualBox

Changeset 49972 in vbox for trunk/src/VBox/VMM/tools


Ignore:
Timestamp:
Dec 18, 2013 1:10:58 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91398
Message:

CPUM: More msr hacking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/tools/VBoxCpuReport.cpp

    r49966 r49972  
    27752775
    27762776
     2777/**
     2778 * Generic report for an MSR implemented by functions, extended version.
     2779 *
     2780 * @returns VBox status code.
     2781 * @param   uMsr            The MSR.
     2782 * @param   pszRdWrFnName   The read/write function name, optional.
     2783 * @param   uValue          The MSR range value.
     2784 * @param   fSkipMask       Mask of bits to skip.
     2785 * @param   fNoGpMask       Mask of bits to remove from the GP mask after
     2786 *                          probing
     2787 * @param   pszAnnotate     Annotation.
     2788 */
    27772789static int reportMsr_GenFunctionEx(uint32_t uMsr, const char *pszRdWrFnName, uint32_t uValue,
    2778                                    uint64_t fSkipMask, const char *pszAnnotate)
     2790                                   uint64_t fSkipMask, uint64_t fNoGpMask, const char *pszAnnotate)
    27792791{
    27802792    /* Resolve default function name. */
     
    27922804    if (RT_SUCCESS(rc))
    27932805    {
     2806        fGpMask &= ~fNoGpMask;
     2807
    27942808        if (fGpMask == UINT64_MAX && uValue == 0 && !msrProberModifyZero(uMsr))
    27952809            rc = printMsrFunctionReadOnly(uMsr, pszRdWrFnName, pszAnnotate);
     
    28222836    if (vbCpuRepSupportsX2Apic())
    28232837        fSkipMask |= RT_BIT_64(10);
    2824     return reportMsr_GenFunctionEx(uMsr, "Ia32ApicBase", uValue, fSkipMask, NULL);
     2838    return reportMsr_GenFunctionEx(uMsr, "Ia32ApicBase", uValue, fSkipMask, 0, NULL);
    28252839}
    28262840
     
    31443158    }
    31453159
    3146     return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, NULL);
     3160    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, MSR_K6_EFER_LMA, NULL);
    31473161}
    31483162
     
    33223336                  |  RT_BIT(0)   /* SysAckLimit */;
    33233337
    3324     return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, annotateValue(uValue));
     3338    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, 0, annotateValue(uValue));
    33253339}
    33263340
     
    33543368    fSkipMask |= RT_BIT(0);      /* SMMLOCK */
    33553369
    3356     return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, annotateValue(uValue));
     3370    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, 0, annotateValue(uValue));
    33573371}
    33583372
     
    33703384    uint64_t fSkipMask = RT_BIT(4) | RT_BIT(3);
    33713385    fSkipMask |= (RT_BIT_64(vbCpuRepGetPhysAddrWidth()) - 1) & X86_PAGE_4K_BASE_MASK;
    3372     return reportMsr_GenFunctionEx(uMsr, NULL, (uMsr - 0xc0010016) / 2, fSkipMask, annotateValue(uValue));
     3386    return reportMsr_GenFunctionEx(uMsr, NULL, (uMsr - 0xc0010016) / 2, fSkipMask, 0, annotateValue(uValue));
    33733387}
    33743388
     
    33863400    uint64_t fSkipMask = RT_BIT(11);
    33873401    fSkipMask |= (RT_BIT_64(vbCpuRepGetPhysAddrWidth()) - 1) & X86_PAGE_4K_BASE_MASK;
    3388     return reportMsr_GenFunctionEx(uMsr, NULL, (uMsr - 0xc0010017) / 2, fSkipMask, annotateValue(uValue));
     3402    return reportMsr_GenFunctionEx(uMsr, NULL, (uMsr - 0xc0010017) / 2, fSkipMask, 0, annotateValue(uValue));
    33893403}
    33903404
     
    34013415    /* Skip know bits here, as harm seems to come from messing with them. */
    34023416    uint64_t fSkipMask = (RT_BIT_64(vbCpuRepGetPhysAddrWidth()) - 1) & ~(RT_BIT_64(23) - 1);
    3403     return reportMsr_GenFunctionEx(uMsr, NULL, uMsr == 0xc001001d, fSkipMask, annotateValue(uValue));
     3417    return reportMsr_GenFunctionEx(uMsr, NULL, uMsr == 0xc001001d, fSkipMask, 0, annotateValue(uValue));
    34043418}
    34053419
     
    34863500    fSkipMask |= UINT32_C(0x0000003f);              /* CpuFid */
    34873501
    3488     return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, annotateValue(uValue));
     3502    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, 0, annotateValue(uValue));
    34893503}
    34903504
     
    35563570        fSkipMask |= RT_BIT_64(28); /* Unknown killer bit, possibly applicable to other microarchs. */
    35573571    }
    3558     return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, annotateValue(uValue));
     3572    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, 0, annotateValue(uValue));
    35593573}
    35603574
     
    35773591                       | RT_BIT_64(10) /* DcacheAggressivePriority */;
    35783592    fSkipMask |= RT_BIT_64(46) | RT_BIT_64(45); /* Killer field. Seen bit 46 set, 45 clear. Messing with either means reboot/BSOD. */
    3579     return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, annotateValue(uValue));
     3593    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, 0, annotateValue(uValue));
    35803594}
    35813595
     
    35933607    uint64_t fSkipMask = RT_BIT_64(54) /* LateSbzResync  */;
    35943608    fSkipMask |= RT_BIT_64(35); /* Undocumented killer bit. */
    3595     return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, annotateValue(uValue));
     3609    return reportMsr_GenFunctionEx(uMsr, NULL, uValue, fSkipMask, 0, annotateValue(uValue));
    35963610}
    35973611
     
    36833697            rc = reportMsr_GenX2Apic(&paMsrs[i], cMsrs - i, &i);
    36843698        else if (uMsr == 0x00002000 && g_enmVendor == CPUMCPUVENDOR_INTEL)
    3685             rc = reportMsr_GenFunctionEx(uMsr, "IntelP6CrN", 0, X86_CR0_PE | X86_CR0_PG,
     3699            rc = reportMsr_GenFunctionEx(uMsr, "IntelP6CrN", 0, X86_CR0_PE | X86_CR0_PG, 0,
    36863700                                         annotateIfMissingBits(uValue, X86_CR0_PE | X86_CR0_PE | X86_CR0_ET));
    36873701        else if (uMsr == 0x00002002 && g_enmVendor == CPUMCPUVENDOR_INTEL)
    3688             rc = reportMsr_GenFunctionEx(uMsr, "IntelP6CrN", 2, 0, annotateValue(uValue));
     3702            rc = reportMsr_GenFunctionEx(uMsr, "IntelP6CrN", 2, 0, 0, annotateValue(uValue));
    36893703        else if (uMsr == 0x00002003 && g_enmVendor == CPUMCPUVENDOR_INTEL)
    36903704        {
     
    36923706            if (!vbCpuRepSupportsPae())
    36933707                fCr3Mask &= X86_CR3_PAGE_MASK | X86_CR3_AMD64_PAGE_MASK;
    3694             rc = reportMsr_GenFunctionEx(uMsr, "IntelP6CrN", 3, fCr3Mask, annotateValue(uValue));
     3708            rc = reportMsr_GenFunctionEx(uMsr, "IntelP6CrN", 3, fCr3Mask, 0, annotateValue(uValue));
    36953709        }
    36963710        else if (uMsr == 0x00002004 && g_enmVendor == CPUMCPUVENDOR_INTEL)
    36973711            rc = reportMsr_GenFunctionEx(uMsr, "IntelP6CrN", 4,
    3698                                          X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE | X86_CR4_SMXE,
     3712                                         X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE | X86_CR4_SMXE, 0,
    36993713                                         annotateValue(uValue));
    37003714        else if (uMsr == 0xc0000080)
    37013715            rc = reportMsr_Amd64Efer(uMsr, uValue);
    37023716        else if (uMsr == 0xc0000082 || uMsr == 0xc0000083 || uMsr == 0xc0000100 || uMsr == 0xc0000101 || uMsr == 0xc0000102)
    3703             rc = reportMsr_GenFunctionEx(uMsr, NULL, 0, UINT64_C(0xffff800000000000), annotateValue(uValue)); /* Canoncial address hack. */
     3717            rc = reportMsr_GenFunctionEx(uMsr, NULL, 0, UINT64_C(0xffff800000000000), 0, annotateValue(uValue)); /* Canoncial address hack. */
    37043718        else if (uMsr >= 0xc0000408 && uMsr <= 0xc000040f)
    37053719            rc = reportMsr_AmdFam10hMc4MiscN(&paMsrs[i], cMsrs - i, &i);
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