VirtualBox

Changeset 71529 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Mar 28, 2018 6:32:43 AM (7 years ago)
Author:
vboxsync
Message:

VMM/HM: Fixes to MSRPM bit accesses. Implemented merging of guest and nested-guest MSRPMs. Other nits and cleanups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp

    r71419 r71529  
    317317 *                      returned in @a pbOffMsrpm.
    318318 */
    319 VMM_INT_DECL(int) HMSvmGetMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint32_t *puMsrpmBit)
     319VMM_INT_DECL(int) HMSvmGetMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit)
    320320{
    321321    Assert(pbOffMsrpm);
     
    335335    {
    336336        /* Pentium-compatible MSRs. */
    337         *pbOffMsrpm = 0;
    338         *puMsrpmBit = idMsr << 1;
     337        uint32_t const bitoffMsr = idMsr << 1;
     338        *pbOffMsrpm = bitoffMsr >> 3;
     339        *puMsrpmBit = bitoffMsr & 7;
    339340        return VINF_SUCCESS;
    340341    }
     
    344345    {
    345346        /* AMD Sixth Generation x86 Processor MSRs. */
    346         *pbOffMsrpm = 0x800;
    347         *puMsrpmBit = (idMsr - 0xc0000000) << 1;
     347        uint32_t const bitoffMsr = (idMsr - 0xc0000000) << 1;
     348        *pbOffMsrpm = 0x800 + (bitoffMsr >> 3);
     349        *puMsrpmBit = bitoffMsr & 7;
    348350        return VINF_SUCCESS;
    349351    }
     
    353355    {
    354356        /* AMD Seventh and Eighth Generation Processor MSRs. */
    355         *pbOffMsrpm = 0x1000;
    356         *puMsrpmBit = (idMsr - 0xc0010000) << 1;
     357        uint32_t const bitoffMsr = (idMsr - 0xc0010000) << 1;
     358        *pbOffMsrpm = 0x1000 + (bitoffMsr >> 3);
     359        *puMsrpmBit = bitoffMsr & 7;
    357360        return VINF_SUCCESS;
    358361    }
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