VirtualBox

Changeset 108742 in vbox for trunk/src


Ignore:
Timestamp:
Mar 26, 2025 6:42:04 AM (3 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168167
Message:

Main: bugref:10877 Added ACPI MADT table entry for the GIC ITS and allow configuring it for the VM from ConsoleImpl.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/SystemTableBuilder.h

    r108558 r108742  
    6161    virtual int addMmioDeviceNoIrq(const char *pszVBoxName, uint32_t uInstance, RTGCPHYS GCPhysMmio, RTGCPHYS cbMmio);
    6262    virtual int addMmioDevice(const char *pszVBoxName, uint32_t uInstance, RTGCPHYS GCPhysMmio, RTGCPHYS cbMmio, uint32_t u32Irq);
    63     virtual int configureGic(uint32_t cCpus, RTGCPHYS GCPhysIntcDist, RTGCPHYS cbMmioIntcDist, RTGCPHYS GCPhysIntcReDist, RTGCPHYS cbMmioIntcReDist);
     63    virtual int configureGic(uint32_t cCpus, RTGCPHYS GCPhysIntcDist, RTGCPHYS cbMmioIntcDist, RTGCPHYS GCPhysIntcReDist,
     64                             RTGCPHYS cbMmioIntcReDist, RTGCPHYS GCPhysIntcIts, RTGCPHYS cbMmioIntcIts);
    6465    virtual int configureClock(void);
    6566    virtual int configurePcieRootBus(const char *pszVBoxName, uint32_t aPinIrqs[4], RTGCPHYS GCPhysMmioPio, RTGCPHYS GCPhysMmioEcam, size_t cbPciMmioEcam,
     
    8687    int addMmioDeviceNoIrq(const char *pszVBoxName, uint32_t uInstance, RTGCPHYS GCPhysMmio, RTGCPHYS cbMmio);
    8788    int addMmioDevice(const char *pszVBoxName, uint32_t uInstance, RTGCPHYS GCPhysMmio, RTGCPHYS cbMmio, uint32_t u32Irq);
    88     int configureGic(uint32_t cCpus, RTGCPHYS GCPhysIntcDist, RTGCPHYS cbMmioIntcDist, RTGCPHYS GCPhysIntcReDist, RTGCPHYS cbMmioIntcReDist);
     89    int configureGic(uint32_t cCpus, RTGCPHYS GCPhysIntcDist, RTGCPHYS cbMmioIntcDist, RTGCPHYS GCPhysIntcReDist,
     90                     RTGCPHYS cbMmioIntcReDist, RTGCPHYS GCPhysIntcIts, RTGCPHYS cbMmioIntcIts);
    8991    int configureClock(void);
    9092    int configurePcieRootBus(const char *pszVBoxName, uint32_t aPinIrqs[4], RTGCPHYS GCPhysMmioPio, RTGCPHYS GCPhysMmioEcam, size_t cbPciMmioEcam,
     
    111113    RTGCPHYS m_GCPhysIntcReDist;
    112114    RTGCPHYS m_cbMmioIntcReDist;
     115    RTGCPHYS m_GCPhysIntcIts;
     116    RTGCPHYS m_cbMmioIntcIts;
    113117
    114118    RTGCPHYS m_GCPhysPciMmioEcam;
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp

    r108558 r108742  
    507507        RTGCPHYS cbMmioIntcReDist;
    508508
     509        /** @todo Add API for configuring a GIC ITS for the VM and init this value from
     510         *        there. */
     511        BOOL fGicIts = FALSE;
     512
    509513        /* Allow for up to 256 vCPUs in the future without changing the address space layout. */
    510514        hrc = pResMgr->assignMmioRegion("gic", _64K + 256 * _128K, &GCPhysIntcDist, &cbMmioIntcDist);     H();
     
    513517        cbMmioIntcDist = _64K;
    514518
     519        /* Reserve an MMIO region for the GIC ITS even if it might not be configured for the VM. */
    515520        hrc = pResMgr->assignMmioRegion("gic-its", 2 * _64K, &GCPhysIntcIts, &cbMmioIntcIts);             H();
    516521
     
    526531        InsertConfigInteger(pCfg,  "DistributorMmioBase",   GCPhysIntcDist);
    527532        InsertConfigInteger(pCfg,  "RedistributorMmioBase", GCPhysIntcReDist);
    528         InsertConfigInteger(pCfg,  "ItsMmioBase",           GCPhysIntcIts);
     533        if (fGicIts == TRUE)
     534            InsertConfigInteger(pCfg, "ItsMmioBase", GCPhysIntcIts);
    529535
    530536        vrc = RTFdtNodeAddF(hFdt, "intc@%RGp", GCPhysIntcDist);                                         VRC();
     
    544550        {
    545551            vrc = pSysTblsBldAcpi->configureGic(cCpus, GCPhysIntcDist, cbMmioIntcDist,
    546                                                 GCPhysIntcReDist, cbMmioIntcReDist);
     552                                                GCPhysIntcReDist, cbMmioIntcReDist, GCPhysIntcIts, cbMmioIntcIts);
    547553            VRC();
    548554        }
  • trunk/src/VBox/Main/src-client/SystemTableBuilder.cpp

    r108560 r108742  
    345345
    346346int SystemTableBuilderAcpi::configureGic(uint32_t cCpus, RTGCPHYS GCPhysIntcDist, RTGCPHYS cbMmioIntcDist, RTGCPHYS GCPhysIntcReDist,
    347                                          RTGCPHYS cbMmioIntcReDist)
     347                                         RTGCPHYS cbMmioIntcReDist, RTGCPHYS GCPhysIntcIts, RTGCPHYS cbMmioIntcIts)
    348348{
    349349    m_cCpus            = cCpus;
     
    352352    m_GCPhysIntcReDist = GCPhysIntcReDist;
    353353    m_cbMmioIntcReDist = cbMmioIntcReDist;
     354    m_GCPhysIntcIts    = GCPhysIntcIts;
     355    m_cbMmioIntcIts    = cbMmioIntcIts;
    354356    return VINF_SUCCESS;
    355357}
     
    522524
    523525    cbMadt += sizeof(*pGicr);
     526
     527    /* Build the GITS. */
     528    PACPIMADTGICITS pGits = (PACPIMADTGICITS)(pGicr + 1);
     529    pGits->bType                    = ACPI_MADT_INTR_CTRL_TYPE_GIC_ITS;
     530    pGits->cbThis                   = sizeof(*pGits);
     531    pGits->u64PhysAddrBase          = m_GCPhysIntcIts;
     532    pGits->u32GicItsId              = 0;
     533
     534    cbMadt += sizeof(*pGits);
    524535
    525536    /* Finalize the MADT. */
     
    14421453
    14431454int SystemTableBuilder::configureGic(uint32_t cCpus, RTGCPHYS GCPhysIntcDist, RTGCPHYS cbMmioIntcDist, RTGCPHYS GCPhysIntcReDist,
    1444                                      RTGCPHYS cbMmioIntcReDist)
    1445 {
    1446     RT_NOREF(cCpus, GCPhysIntcDist, cbMmioIntcDist, GCPhysIntcReDist, cbMmioIntcReDist);
     1455                                     RTGCPHYS cbMmioIntcReDist, RTGCPHYS GCPhysIntcIts, RTGCPHYS cbMmioIntcIts)
     1456{
     1457    RT_NOREF(cCpus, GCPhysIntcDist, cbMmioIntcDist, GCPhysIntcReDist, cbMmioIntcReDist, GCPhysIntcIts, cbMmioIntcIts);
    14471458    return VERR_NOT_IMPLEMENTED;
    14481459}
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