Changeset 108762 in vbox
- Timestamp:
- Mar 27, 2025 10:16:28 AM (3 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168189
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/gic-its.h
r108751 r108762 1 1 /** @file 2 * ARMv8 G eneric Interrupt Controller (GIC)Interrupt Translation Service (ITS) definitions.2 * ARMv8 GIC Interrupt Translation Service (ITS) definitions. 3 3 */ 4 4 … … 41 41 42 42 #include <iprt/types.h> 43 #include <iprt/a rmv8.h>43 #include <iprt/assertcompile.h> 44 44 45 45 /** Size of the ITS register frame. */ … … 200 200 #define GITS_CTRL_REG_CREADR_OFF 0x0090 201 201 202 /** GITS_BASER: ITS Table Descriptors - RW. */ 202 203 #define GITS_CTRL_REG_BASER_OFF_FIRST 0x0100 204 /** GITS_BASER: Size - Number of pages allocated to the table minus one. */ 205 #define GITS_BF_CTRL_REG_BASER_SIZE_SHIFT 0 206 #define GITS_BF_CTRL_REG_BASER_SIZE_MASK UINT64_C(0x00000000000000ff) 207 /** GITS_BASER: Page_Size - Size of the page that the table uses. */ 208 #define GITS_BF_CTRL_REG_BASER_PAGESIZE_SHIFT 8 209 #define GITS_BF_CTRL_REG_BASER_PAGESIZE_MASK UINT64_C(0x0000000000000300) 210 /** GITS_BASER: Shareability attributes of the table. */ 211 #define GITS_BF_CTRL_REG_BASER_SHAREABILITY_SHIFT 10 212 #define GITS_BF_CTRL_REG_BASER_SHAREABILITY_MASK UINT64_C(0x0000000000000c00) 213 /** GITS_BASER: Physical_Address - Physical address of the table. */ 214 #define GITS_BF_CTRL_REG_BASER_PHYS_ADDR_SHIFT 12 215 #define GITS_BF_CTRL_REG_BASER_PHYS_ADDR_MASK UINT64_C(0x0000fffffffff000) 216 /** GITS_BASER: Entry_Size - Size of each table entry minus one in bytes. */ 217 #define GITS_BF_CTRL_REG_BASER_ENTRY_SIZE_SHIFT 48 218 #define GITS_BF_CTRL_REG_BASER_ENTRY_SIZE_MASK UINT64_C(0x001f000000000000) 219 /** GITS_BASER: OuterCache - Outer cacheability attributes of the table. */ 220 #define GITS_BF_CTRL_REG_BASER_OUTER_CACHE_SHIFT 53 221 #define GITS_BF_CTRL_REG_BASER_OUTER_CACHE_MASK UINT64_C(0x00e0000000000000) 222 /** GITS_BASER: Type - The type of entity. */ 223 #define GITS_BF_CTRL_REG_BASER_TYPE_SHIFT 56 224 #define GITS_BF_CTRL_REG_BASER_TYPE_MASK UINT64_C(0x0700000000000000) 225 /** GITS_BASER: InnerCache - Inner cacheability attribtues of the table. */ 226 #define GITS_BF_CTRL_REG_BASER_INNER_CACHE_SHIFT 59 227 #define GITS_BF_CTRL_REG_BASER_INNER_CACHE_MASK UINT64_C(0x3800000000000000) 228 /** GITS_BASER: Indirect - Whether this is a single or two-level table. */ 229 #define GITS_BF_CTRL_REG_BASER_INDIRECT_SHIFT 62 230 #define GITS_BF_CTRL_REG_BASER_INDIRECT_MASK UINT64_C(0x4000000000000000) 231 /** GITS_BASER: Valid - Whether memory has been allocated for the table. */ 232 #define GITS_BF_CTRL_REG_BASER_VALID_SHIFT 63 233 #define GITS_BF_CTRL_REG_BASER_VALID_MASK UINT64_C(0x8000000000000000) 234 /* Sigh C macros... "PAGE_SIZE" is already defined here, just use "PAGESIZE" instead of temporarily undef, redef. */ 235 RT_BF_ASSERT_COMPILE_CHECKS(GITS_BF_CTRL_REG_BASER_, UINT64_C(0), UINT64_MAX, 236 (SIZE, PAGESIZE, SHAREABILITY, PHYS_ADDR, ENTRY_SIZE, OUTER_CACHE, TYPE, INNER_CACHE, INDIRECT, 237 VALID)); 238 203 239 #define GITS_CTRL_REG_BASER_OFF_LAST 0x0138 204 240 #define GITS_CTRL_REG_BASER_RANGE_SIZE (GITS_CTRL_REG_BASER_OFF_LAST + sizeof(uint64_t) - GITS_CTRL_REG_BASER_OFF_FIRST) -
trunk/src/VBox/VMM/VMMAll/GICAll.cpp
r108751 r108762 3279 3279 Assert(!(off & 0x3)); 3280 3280 Assert(cb == 4); RT_NOREF_PV(cb); 3281 3282 AssertReleaseFailed();3283 3281 3284 3282 PGICDEV pGicDev = PDMDEVINS_2_DATA(pDevIns, PGICDEV); -
trunk/src/VBox/VMM/VMMAll/GITSAll.cpp
r108751 r108762 1 1 /* $Id$ */ 2 2 /** @file 3 * GITS - G eneric Interrupt ControllerInterrupt Translation Service (ITS) - All Contexts.3 * GITS - GIC Interrupt Translation Service (ITS) - All Contexts. 4 4 */ 5 5 … … 50 50 * Structures and Typedefs * 51 51 *********************************************************************************************************************************/ 52 /** 53 * Interrupt Table Entry (ITE). 54 */ 55 typedef struct GITSITE 56 { 57 bool fValid; 58 uint8_t uType; 59 uint16_t uIntrCollectId; 60 VMCPUID idTargetCpu; 61 } GITSITE; 62 AssertCompileSize(GITSITE, 8); 52 63 53 64 … … 91 102 } 92 103 } 93 94 #endif 104 #endif /* LOG_ENABLED */ 95 105 96 106 97 107 DECL_HIDDEN_CALLBACK(VBOXSTRICTRC) gitsMmioReadCtrl(PCGITSDEV pGitsDev, uint16_t offReg, uint32_t *puValue) 98 108 { 99 Log4Func(("offReg=%#RX16\n", offReg));100 101 109 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 102 110 switch (offReg) 103 111 { 104 112 case GITS_CTRL_REG_CTLR_OFF: 105 *puValue = pGitsDev->fUnmappedMsiReporting; 106 break; 113 *puValue = RT_BF_MAKE(GITS_BF_CTRL_REG_CTLR_ENABLED, pGitsDev->fEnabled) 114 | RT_BF_MAKE(GITS_BF_CTRL_REG_CTLR_QUIESCENT, pGitsDev->fQuiescent); 115 break; 116 107 117 case GITS_CTRL_REG_PIDR2_OFF: 108 118 { … … 114 124 break; 115 125 } 126 127 case GITS_CTRL_REG_TYPER_OFF: 128 { 129 uint64_t uLo = RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_PHYSICAL, 1) /* Physical LPIs supported. */ 130 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_VIRTUAL, 0) */ /* Virtual LPIs not supported. */ 131 | RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_CCT, 0) /* Collections in memory not supported. */ 132 | RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_ITT_ENTRY_SIZE, sizeof(GITSITE)) /* ITE size in bytes. */ 133 | RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_ID_BITS, 31) /* 32-bit event IDs. */ 134 | RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_DEV_BITS, 31) /* 32-bit device IDs. */ 135 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_SEIS, 0) */ /** @todo SEI support. */ 136 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_PTA, 0) */ /* Target is VCPU ID not address. */ 137 | RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_HCC, 255); /* Collection count. */ 138 *puValue = RT_LO_U32(uLo); 139 break; 140 } 141 142 case GITS_CTRL_REG_TYPER_OFF + 4: 143 { 144 uint64_t uHi = 0 145 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_CID_BITS, 0) */ /* CIL specifies collection ID size. */ 146 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_CIL, 0) */ /* 16-bit collection IDs. */ 147 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_VMOVP, 0) */ /* VMOVP not supported. */ 148 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_MPAM, 0) */ /* MPAM no supported. */ 149 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_VSGI, 0) */ /* VSGI not supported. */ 150 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_VMAPP, 0) */ /* VMAPP not supported. */ 151 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_SVPET, 0) */ /* SVPET not supported. */ 152 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_NID, 0) */ /* NID (doorbell) not supported. */ 153 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_UMSI, 0) */ /** @todo Support reporting receipt of unmapped MSIs. */ 154 /*| RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_UMSI_IRQ, 0) */ /** @todo Support generating interrupt on unmapped MSI. */ 155 | RT_BF_MAKE(GITS_BF_CTRL_REG_TYPER_INV, 1); /* ITS caches are invalidated when clearing 156 GITS_CTLR.Enabled and GITS_BASER<n>.Valid. */ 157 *puValue = RT_HI_U32(uHi); 158 break; 159 } 160 116 161 default: 117 162 AssertReleaseMsgFailed(("offReg=%#x\n", offReg)); … … 119 164 } 120 165 166 Log4Func(("offReg=%#RX16 (%s) uValue=%#RX32\n", offReg, gitsGetCtrlRegDescription(offReg), *puValue)); 121 167 return rcStrict; 122 168 } … … 133 179 DECL_HIDDEN_CALLBACK(VBOXSTRICTRC) gitsMmioWriteCtrl(PGITSDEV pGitsDev, uint16_t offReg, uint32_t uValue) 134 180 { 135 RT_NOREF(pGitsDev, offReg, uValue); 136 AssertReleaseMsgFailed(("offReg=%#x uValue=%#RX32\n", offReg, uValue)); 137 return VERR_NOT_IMPLEMENTED; 181 /* 182 * GITS_BASER<n>. 183 */ 184 if (GITS_IS_REG_IN_RANGE(offReg, GITS_CTRL_REG_BASER_OFF_FIRST, GITS_CTRL_REG_BASER_RANGE_SIZE)) 185 { 186 uint16_t const cbReg = sizeof(uint64_t); 187 uint16_t const idxReg = (offReg - GITS_CTRL_REG_BASER_OFF_FIRST) / cbReg; 188 if (!(offReg & 7)) 189 pGitsDev->aItsTableRegs[idxReg].s.Lo = uValue; 190 else 191 pGitsDev->aItsTableRegs[idxReg].s.Hi = uValue; 192 return VINF_SUCCESS; 193 } 194 195 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 196 switch (offReg) 197 { 198 case GITS_CTRL_REG_CTLR_OFF: 199 pGitsDev->fEnabled = RT_BF_GET(uValue, GITS_BF_CTRL_REG_CTLR_ENABLED); 200 break; 201 202 default: 203 AssertReleaseMsgFailed(("offReg=%#x uValue=%#RX32\n", offReg, uValue)); 204 break; 205 } 206 207 Log4Func(("offReg=%#RX16 (%s) uValue=%#RX32\n", offReg, gitsGetCtrlRegDescription(offReg), uValue)); 208 return rcStrict; 138 209 } 139 210 … … 153 224 pGitsDev->fUnmappedMsiReporting = false; 154 225 pGitsDev->fQuiescent = true; 155 RT_ZERO(pGitsDev->a Bases);226 RT_ZERO(pGitsDev->aItsTableRegs); 156 227 } 157 228 -
trunk/src/VBox/VMM/include/GITSInternal.h
r108751 r108762 41 41 */ 42 42 43 #if 0 43 44 /** 44 45 * Interrupt Translation Table Base. … … 48 49 /** The physical address of the table. */ 49 50 RTGCPHYS GCPhys; 50 /** Number of pages of memory allocated to this table. */ 51 /** Size of every allocated page in bytes. */ 52 uint32_t cbPageSize; 53 /** Number of pages allocated. */ 51 54 uint8_t cPages; 52 /** Size of each page allocated. */ 53 uint8_t cPageSize; 54 /** Size of each entry in the table in bytes. */ 55 /** Size of each entry in bytes. */ 55 56 uint8_t cbEntry; 56 /** Whether this is a two-level table or not. */57 /** Whether this is a two-level or flat table. */ 57 58 bool fTwoLevel; 59 /** Whether software has memory allocated for the table. */ 60 bool fValid; 58 61 /** Memory shareability attributes. */ 59 62 GITSATTRSHARE AttrShare; 60 /** Memory cacheability attributes. */ 61 GITSATTRMEM AttrMem; 63 /** Memory cacheability attributes (Inner). */ 64 GITSATTRMEM AttrMemInner; 65 /** Memory cacheability attributes (Outer). */ 66 GITSATTRMEM AttrMemOuter; 62 67 } GITSITSBASE; 68 AssertCompileSizeAlignment(GITSITSBASE, 8); 69 AssertCompileMemberAlignment(GITSITSBASE, AttrShare, 8); 70 #endif 71 63 72 64 73 /** … … 78 87 bool fPadding0; 79 88 /** The ITS table descriptor registers. */ 80 GITSITSBASE aBases[8];89 RTUINT64U aItsTableRegs[8]; 81 90 /** @} */ 82 91
Note:
See TracChangeset
for help on using the changeset viewer.