VirtualBox

Changeset 108877 in vbox


Ignore:
Timestamp:
Apr 8, 2025 7:42:07 AM (4 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168328
Message:

VMM/GIC: bugref:10877 GITS command-queue, work-in-progress.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/gic.h

    r108826 r108877  
    499499# define GIC_REDIST_REG_TYPER_VSGI_BIT                  26
    500500/** Bit 27 - 31 - Indicates the maximum PPI INTID that a GIC implementation can support. */
    501 # define GIC_REDIST_REG_TYPER_PPI_NUM                  (  RT_BIT_32(27) | RT_BIT_32(28) | RT_BIT_32(29) \
    502                                                         | RT_BIT_32(30) | RT_BIT_32(31))
    503 # define GIC_REDIST_REG_TYPER_PPI_NUM_SET(a_PpiNum)    (((a_PpiNum) << 27) & GIC_REDIST_REG_TYPER_PPI_NUM)
     501# define GIC_REDIST_REG_TYPER_PPI_NUM                   (  RT_BIT_32(27) | RT_BIT_32(28) | RT_BIT_32(29) \
     502                                                         | RT_BIT_32(30) | RT_BIT_32(31))
     503# define GIC_REDIST_REG_TYPER_PPI_NUM_SET(a_PpiNum)     (((a_PpiNum) << 27) & GIC_REDIST_REG_TYPER_PPI_NUM)
    504504/** Maximum PPI INTID is 31. */
    505 #  define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_31          0
     505#  define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_31           0
    506506/** Maximum PPI INTID is 1087. */
    507 #  define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1087        1
     507#  define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1087         1
    508508/** Maximum PPI INTID is 1119. */
    509 #  define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1119        2
     509#  define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1119         2
     510# define GIC_REDIST_REG_TYPER_CPU_NUMBER_MASK           (GIC_REDIST_REG_TYPER_CPU_NUMBER >> 8)
    510511
    511512/** Redistributor Type Register (the affinity value of the 64-bit register) - RO. */
    512 #define GIC_REDIST_REG_TYPER_AFFINITY_OFF              0x000c
     513#define GIC_REDIST_REG_TYPER_AFFINITY_OFF               0x000c
    513514/** Bit 0 - 31 - The identity of the PE associated with this Redistributor. */
    514 # define GIC_REDIST_REG_TYPER_AFFINITY_VALUE           UINT32_C(0xffffffff)
     515# define GIC_REDIST_REG_TYPER_AFFINITY_VALUE            UINT32_C(0xffffffff)
    515516# define GIC_REDIST_REG_TYPER_AFFINITY_VALUE_SET(a_Aff) ((a_Aff) & GIC_REDIST_REG_TYPER_AFFINITY_VALUE)
    516517
  • trunk/src/VBox/VMM/VMMAll/GITSAll.cpp

    r108872 r108877  
    6565#define GITS_CRIT_SECT_IS_OWNER(a_pDevIns)      PDMDevHlpCritSectIsOwner((a_pDevIns), (a_pDevIns)->CTX_SUFF(pCritSectRo))
    6666
     67/** GITS diagnostic enum description expansion.
     68 * The below construct ensures typos in the input to this macro are caught
     69 * during compile time. */
     70#define GITSDIAG_DESC(a_Name)        RT_CONCAT(kGitsDiag_, a_Name) < kGitsDiag_End ? RT_STR(a_Name) : "Ignored"
     71
    6772
    6873/*********************************************************************************************************************************
     
    8186AssertCompileSize(GITSITE, 8);
    8287
    83 /** GITS diagnostic enum description expansion.
    84  * The below construct ensures typos in the input to this macro are caught
    85  * during compile time. */
    86 #define GITSDIAG_DESC(a_Name)        RT_CONCAT(kGitsDiag_, a_Name) < kGitsDiag_End ? RT_STR(a_Name) : "Ignored"
     88
     89/*********************************************************************************************************************************
     90*   Global Variables                                                                                                             *
     91*********************************************************************************************************************************/
    8792/** GITS diagnostics description for members in GITSDIAG. */
    8893static const char *const g_apszGitsDiagDesc[] =
     
    9499AssertCompile(RT_ELEMENTS(g_apszGitsDiagDesc) == kGitsDiag_End);
    95100#undef GITSDIAG_DESC
    96 
    97 
    98 /*********************************************************************************************************************************
    99 *   Global Variables                                                                                                             *
    100 *********************************************************************************************************************************/
    101101
    102102
     
    420420    pGitsDev->uCmdReadReg        = 0;
    421421    pGitsDev->uCmdWriteReg       = 0;
     422    RT_ZERO(pGitsDev->auCt);
    422423}
    423424
     
    571572                        {
    572573                            Assert(!RT_BF_GET(pGitsDev->uTypeReg.u, GITS_BF_CTRL_REG_TYPER_PTA)); /* GITS_TYPER is read-only */
    573                             /** @todo Implementing me. Figure out interrupt collection, HCC etc. */
    574                             //uint64_t const uDw2 = pCmd->au64[2].u;
    575                             //bool const     fValid            = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_VALID);
    576                             //uint32_t const uTargetCpuId      = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_RDBASE);
    577                             //uint16_t const uIntrCollectionId = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_IC_ID);
     574                            uint64_t const uDw2 = pCmd->au64[2].u;
     575                            bool const     fValid            = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_VALID);
     576                            uint32_t const uTargetCpuId      = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_RDBASE);
     577                            uint16_t const uIntrCollectionId = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_IC_ID);
     578
     579                            AssertRelease(uIntrCollectionId < RT_ELEMENTS(pGitsDev->auCt));
     580                            pGitsDev->auCt[uIntrCollectionId].fValid      = fValid;
     581                            pGitsDev->auCt[uIntrCollectionId].idTargetCpu = uTargetCpuId;
     582                            break;
     583                        }
     584
     585                        case GITS_CMD_ID_SYNC:
     586                        {
     587                            /* Nothing to do since all previous commands have committed their changes to device state. */
     588                            break;
     589                        }
     590
     591                        case GITS_CMD_ID_INVALL:
     592                        {
     593                            /* Nothing to do as we currently do not cache interrupt mappings. */
    578594                            break;
    579595                        }
  • trunk/src/VBox/VMM/include/GITSInternal.h

    r108865 r108877  
    9696#endif
    9797
     98/**
     99 * GITS Collection Table Entry (CTE).
     100 */
     101typedef struct GITSCTE
     102{
     103    /** Whether this entry is valid. */
     104    bool        fValid;
     105    /** Alignment. */
     106    bool        afPadding;
     107    /** Target CPU ID (size based on GICR_TYPER.Processor_Number). */
     108    uint16_t    idTargetCpu;
     109} GITSCTE;
     110/** Pointer to a GITS Collection Table Entry (CTE). */
     111typedef GITSCTE *PGITSCTE;
     112/** Pointer to a const GITS Collection Table Entry (CTE). */
     113typedef GITSCTE const *PCGITSCTE;
     114AssertCompileSize(GITSCTE, 4);
    98115
    99116/**
     
    136153    /** @} */
    137154
     155    /** @name Tables.
     156     * @{
     157     */
     158    /** The collection table. */
     159    GITSCTE                 auCt[2048];
     160    /** @} */
     161
    138162    /** @name Configurables.
    139163     * @{ */
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