VirtualBox

Ignore:
Timestamp:
May 19, 2014 12:47:48 PM (11 years ago)
Author:
vboxsync
Message:

Fixes for canonical address in MSRs.

File:
1 edited

Legend:

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

    r50657 r51288  
    25592559
    25602560
     2561/**
     2562 * Adjusts the ignore and GP masks for MSRs which contains canonical addresses.
     2563 *
     2564 * @param   uMsr                The MSR.
     2565 * @param   pfIgn               Pointer to the ignore mask.
     2566 * @param   pfGp                Pointer to the GP mask.
     2567 */
     2568static void adjustCanonicalIgnAndGpMasks(uint32_t uMsr, uint64_t *pfIgn, uint64_t *pfGp)
     2569{
     2570    if (!vbCpuRepSupportsLongMode())
     2571        return;
     2572    switch (uMsr)
     2573    {
     2574        case 0x00000175:
     2575        case 0x00000176:
     2576        case 0x000001da:
     2577        case 0x000001db:
     2578        case 0x000001dc:
     2579        case 0x000001de:
     2580        case 0x00000600:
     2581            if (*pfGp == UINT64_C(0xffff800000000000))
     2582                *pfGp = 0;
     2583            break;
     2584        case 0x000001dd:
     2585            if (*pfGp == UINT64_C(0x7fff800000000000) || *pfGp == UINT64_C(0xffff800000000000)) /* why is the top bit writable? */
     2586                *pfGp = 0;
     2587            break;
     2588
     2589        case 0xc0000082:
     2590        case 0xc0000083:
     2591        case 0xc0000100:
     2592        case 0xc0000101:
     2593        case 0xc0000102:
     2594            *pfGp = 0;
     2595            break;
     2596    }
     2597}
     2598
    25612599
    25622600
     
    29492987                    if (RT_FAILURE(rc))
    29502988                        return rc;
     2989                    adjustCanonicalIgnAndGpMasks(uMsr, &fIgnMask, &fGpMask);
    29512990
    29522991                    if (pszFnName)
     
    41144153        else if (uMsr == 0xc0000080)
    41154154            rc = reportMsr_Amd64Efer(uMsr, uValue);
    4116         else if (uMsr == 0xc0000082 || uMsr == 0xc0000083 || uMsr == 0xc0000100 || uMsr == 0xc0000101 || uMsr == 0xc0000102)
    4117             rc = reportMsr_GenFunctionEx(uMsr, NULL, 0, UINT64_C(0xffff800000000000), 0, annotateValue(uValue)); /* Canoncial address hack. */
    41184155        else if (uMsr >= 0xc0000408 && uMsr <= 0xc000040f)
    41194156            rc = reportMsr_AmdFam10hMc4MiscN(&paMsrs[i], cMsrs - i, &i);
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