VirtualBox

Changeset 88290 in vbox for trunk


Ignore:
Timestamp:
Mar 25, 2021 11:54:08 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 PDM: Added CPUMGetGuestAddrWidths and PDM interface for getting number of physical and linear address bits supported by the guest. Will be used by upcoming changes to Intel IOMMU.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r87523 r88290  
    14811481VMMDECL(CPUMCPUVENDOR)  CPUMGetGuestCpuVendor(PVM pVM);
    14821482VMMDECL(CPUMMICROARCH)  CPUMGetGuestMicroarch(PCVM pVM);
     1483VMMDECL(void)           CPUMGetGuestAddrWidths(PCVM pVM, uint8_t *pcPhysAddrWidth, uint8_t *pcLinearAddrWidth);
    14831484VMMDECL(CPUMCPUVENDOR)  CPUMGetHostCpuVendor(PVM pVM);
    14841485VMMDECL(CPUMMICROARCH)  CPUMGetHostMicroarch(PCVM pVM);
  • trunk/include/VBox/vmm/pdmdev.h

    r88153 r88290  
    23492349
    23502350/** Current PDMDEVHLPR3 version number. */
    2351 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 46, 0)
     2351#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 47, 0)
    23522352
    23532353/**
     
    42484248    DECLR3CALLBACKMEMBER(CPUMMICROARCH, pfnCpuGetGuestMicroarch,(PPDMDEVINS pDevIns));
    42494249
     4250    /**
     4251     * Get the number of physical and linear address bits supported by the guest.
     4252     *
     4253     * @param   pDevIns             The device instance.
     4254     * @param   pcPhysAddrWidth     Where to store the number of physical address bits
     4255     *                              supported by the guest.
     4256     * @param   pcLinearAddrWidth   Where to store the number of linear address bits
     4257     *                              supported by the guest.
     4258     */
     4259    DECLR3CALLBACKMEMBER(void, pfnCpuGetGuestAddrWidths,(PPDMDEVINS pDevIns, uint8_t *pcPhysAddrWidth,
     4260                                                         uint8_t *pcLinearAddrWidth));
     4261
    42504262    /** Space reserved for future members.
    42514263     * @{ */
     
    66376649{
    66386650    return pDevIns->CTX_SUFF(pHlp)->pfnCpuGetGuestMicroarch(pDevIns);
     6651}
     6652
     6653/**
     6654 * @copydoc PDMDEVHLPR3::pfnCpuGetGuestAddrWidths
     6655 */
     6656DECLINLINE(void) PDMDevHlpCpuGetGuestAddrWidths(PPDMDEVINS pDevIns, uint8_t *pcPhysAddrWidth, uint8_t *pcLinearAddrWidth)
     6657{
     6658    pDevIns->CTX_SUFF(pHlp)->pfnCpuGetGuestAddrWidths(pDevIns, pcPhysAddrWidth, pcLinearAddrWidth);
    66396659}
    66406660
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r87766 r88290  
    10741074{
    10751075    return pVM->cpum.s.GuestFeatures.enmMicroarch;
     1076}
     1077
     1078
     1079/**
     1080 * Gets the maximum number of physical and linear address bits supported by the
     1081 * guest.
     1082 *
     1083 * @param   pVM                 The cross context VM structure.
     1084 * @param   pcPhysAddrWidth     Where to store the physical address width.
     1085 * @param   pcLinearAddrWidth   Where to store the linear address width.
     1086 */
     1087VMMDECL(void) CPUMGetGuestAddrWidths(PCVM pVM, uint8_t *pcPhysAddrWidth, uint8_t *pcLinearAddrWidth)
     1088{
     1089    AssertPtr(pVM);
     1090    AssertReturnVoid(pcPhysAddrWidth);
     1091    AssertReturnVoid(pcLinearAddrWidth);
     1092    *pcPhysAddrWidth   = pVM->cpum.s.GuestFeatures.cMaxPhysAddrWidth;
     1093    *pcLinearAddrWidth = pVM->cpum.s.GuestFeatures.cMaxLinearAddrWidth;
    10761094}
    10771095
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r88153 r88290  
    973973    Log(("pdmR3DevHlp_CpuGetGuestMicroarch: caller='%s'/%d: returns %u\n", pDevIns->pReg->szName, pDevIns->iInstance, enmMicroarch));
    974974    return enmMicroarch;
     975}
     976
     977
     978/** @interface_method_impl{PDMDEVHLPR3,pfnCpuGetGuestAddrWidths} */
     979static DECLCALLBACK(void) pdmR3DevHlp_CpuGetGuestAddrWidths(PPDMDEVINS pDevIns, uint8_t *pcPhysAddrWidth,
     980                                                            uint8_t *pcLinearAddrWidth)
     981{
     982    PDMDEV_ASSERT_DEVINS(pDevIns);
     983    PVM pVM = pDevIns->Internal.s.pVMR3;
     984    LogFlow(("pdmR3DevHlp_CpuGetGuestAddrWidths: caller='%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
     985    AssertPtrReturnVoid(pcPhysAddrWidth);
     986    AssertPtrReturnVoid(pcLinearAddrWidth);
     987
     988    CPUMGetGuestAddrWidths(pVM, pcPhysAddrWidth, pcLinearAddrWidth);
     989
     990    Log(("pdmR3DevHlp_CpuGetGuestAddrWidths: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
    975991}
    976992
     
    43944410    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
    43954411    pdmR3DevHlp_CpuGetGuestMicroarch,
     4412    pdmR3DevHlp_CpuGetGuestAddrWidths,
    43964413    0,
    43974414    0,
     
    47414758    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
    47424759    pdmR3DevHlp_CpuGetGuestMicroarch,
     4760    pdmR3DevHlp_CpuGetGuestAddrWidths,
    47434761    0,
    47444762    0,
     
    52455263    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
    52465264    pdmR3DevHlp_CpuGetGuestMicroarch,
     5265    pdmR3DevHlp_CpuGetGuestAddrWidths,
    52475266    0,
    52485267    0,
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