Changeset 105686 in vbox
- Timestamp:
- Aug 15, 2024 12:36:59 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpumctx-armv8.h
r100726 r105686 236 236 CPUMCTXSYSREG MDccInt; 237 237 238 /** @name Hypervisor (EL2) support. 239 * @{ */ 240 /** The CNTHCTL_EL2 register. */ 241 CPUMCTXSYSREG CntHCtlEl2; 242 /** The CNTP_CTL_EL2 register. */ 243 CPUMCTXSYSREG CntHpCtlEl2; 244 /** The CNTP_CVAL_EL2 register. */ 245 CPUMCTXSYSREG CntHpCValEl2; 246 /** The CNTP_TVAL_EL2 register. */ 247 CPUMCTXSYSREG CntHpTValEl2; 248 /** The CNTVOFF_EL2 register. */ 249 CPUMCTXSYSREG CntVOffEl2; 250 /** The CPTR_EL2 register. */ 251 CPUMCTXSYSREG CptrEl2; 252 /** The ELR_EL2 register. */ 253 CPUMCTXSYSREG ElrEl2; 254 /** The ESR_EL2 register. */ 255 CPUMCTXSYSREG EsrEl2; 256 /** The FAR_EL2 register. */ 257 CPUMCTXSYSREG FarEl2; 258 /** The HCR_EL2 register. */ 259 CPUMCTXSYSREG HcrEl2; 260 /** The HPFAR_EL2 register. */ 261 CPUMCTXSYSREG HpFarEl2; 262 /** The MAIR_EL2 register. */ 263 CPUMCTXSYSREG MairEl2; 264 /** The MDCR_EL2 register. */ 265 CPUMCTXSYSREG MdcrEl2; 266 /** The SCTLR_EL2 register. */ 267 CPUMCTXSYSREG SctlrEl2; 268 /** The SPSR_EL2 register. */ 269 CPUMCTXSYSREG SpsrEl2; 270 /** The SP_EL2 register. */ 271 CPUMCTXSYSREG SpEl2; 272 /** The TCR_EL2 register. */ 273 CPUMCTXSYSREG TcrEl2; 274 /** The TPIDR_EL2 register. */ 275 CPUMCTXSYSREG TpidrEl2; 276 /** The TTBR0_EL2 register. */ 277 CPUMCTXSYSREG Ttbr0El2; 278 /** The TTBR1_EL2 register. */ 279 CPUMCTXSYSREG Ttbr1El2; 280 /** The VBAR_EL2 register. */ 281 CPUMCTXSYSREG VBarEl2; 282 /** The VMPIDR_EL2 register. */ 283 CPUMCTXSYSREG VMpidrEl2; 284 /** The VPIDR_EL2 register. */ 285 CPUMCTXSYSREG VPidrEl2; 286 /** The VTCR_EL2 register. */ 287 CPUMCTXSYSREG VTcrEl2; 288 /** The VTTBR_EL2 register. */ 289 CPUMCTXSYSREG VTtbrEl2; 290 /** @} */ 291 238 292 /** Floating point control register. */ 239 293 uint64_t fpcr; … … 258 312 uint64_t CntvCValEl0; 259 313 260 uint64_t au64Padding2[ 4];314 uint64_t au64Padding2[3]; 261 315 } CPUMCTX; 262 316 … … 323 377 /** PAuth key system registers are kept externally. */ 324 378 #define CPUMCTX_EXTRN_SYSREG_PAUTH_KEYS UINT64_C(0x0000000000020000) 379 /** EL2 system registers are kept externally. */ 380 #define CPUMCTX_EXTRN_SYSREG_EL2 UINT64_C(0x0000000000040000) 325 381 /** Various system registers (rarely accessed) are kept externally. */ 326 #define CPUMCTX_EXTRN_SYSREG_MISC UINT64_C(0x00000000000 40000)382 #define CPUMCTX_EXTRN_SYSREG_MISC UINT64_C(0x0000000000080000) 327 383 328 384 /** Mask of bits the keepers can use for state tracking. */ -
trunk/include/VBox/vmm/dbgf.h
r105072 r105686 2156 2156 DBGFREG_ARMV8_SP_EL1, 2157 2157 DBGFREG_ARMV8_SPSR_EL1, 2158 DBGFREG_ARMV8_SPSR_EL2, 2159 DBGFREG_ARMV8_PSTATE = DBGFREG_ARMV8_SPSR_EL2, 2158 DBGFREG_ARMV8_PSTATE, 2160 2159 DBGFREG_ARMV8_SCTLR_EL1, 2161 2160 DBGFREG_ARMV8_TCR_EL1, … … 2165 2164 DBGFREG_ARMV8_VBAR_EL1, 2166 2165 2167 DBGFREG_ARMV8_LAST = DBGFREG_ARMV8_VBAR_EL1, 2166 /** EL2 system registers: */ 2167 DBGFREG_ARMV8_CNTHCTL_EL2, 2168 DBGFREG_ARMV8_CNTHP_CTL_EL2, 2169 DBGFREG_ARMV8_CNTHP_CVAL_EL2, 2170 DBGFREG_ARMV8_CNTHP_TVAL_EL2, 2171 DBGFREG_ARMV8_CNTVOFF_EL2, 2172 DBGFREG_ARMV8_CPTR_EL2, 2173 DBGFREG_ARMV8_ELR_EL2, 2174 DBGFREG_ARMV8_ESR_EL2, 2175 DBGFREG_ARMV8_FAR_EL2, 2176 DBGFREG_ARMV8_HCR_EL2, 2177 DBGFREG_ARMV8_HPFAR_EL2, 2178 DBGFREG_ARMV8_MAIR_EL2, 2179 DBGFREG_ARMV8_MDCR_EL2, 2180 DBGFREG_ARMV8_SCTLR_EL2, 2181 DBGFREG_ARMV8_SPSR_EL2, 2182 DBGFREG_ARMV8_SP_EL2, 2183 DBGFREG_ARMV8_TCR_EL2, 2184 DBGFREG_ARMV8_TPIDR_EL2, 2185 DBGFREG_ARMV8_TTBR0_EL2, 2186 DBGFREG_ARMV8_TTBR1_EL2, 2187 DBGFREG_ARMV8_VBAR_EL2, 2188 DBGFREG_ARMV8_VMPIDR_EL2, 2189 DBGFREG_ARMV8_VPIDR_EL2, 2190 DBGFREG_ARMV8_VTCR_EL2, 2191 DBGFREG_ARMV8_VTTBR_EL2, 2192 DBGFREG_ARMV8_LAST = DBGFREG_ARMV8_VTTBR_EL2, 2168 2193 /** @} */ 2169 2194 -
trunk/src/VBox/VMM/VMMR3/CPUM-armv8.cpp
r101549 r105686 316 316 SSMFIELD_ENTRY( CPUMCTX, CntvCtlEl0), 317 317 SSMFIELD_ENTRY( CPUMCTX, CntvCValEl0), 318 /** @name EL2 support: 319 * @{ */ 320 SSMFIELD_ENTRY( CPUMCTX, CntHCtlEl2), 321 SSMFIELD_ENTRY( CPUMCTX, CntHpCtlEl2), 322 SSMFIELD_ENTRY( CPUMCTX, CntHpCValEl2), 323 SSMFIELD_ENTRY( CPUMCTX, CntHpTValEl2), 324 SSMFIELD_ENTRY( CPUMCTX, CntVOffEl2), 325 SSMFIELD_ENTRY( CPUMCTX, CptrEl2), 326 SSMFIELD_ENTRY( CPUMCTX, ElrEl2), 327 SSMFIELD_ENTRY( CPUMCTX, EsrEl2), 328 SSMFIELD_ENTRY( CPUMCTX, FarEl2), 329 SSMFIELD_ENTRY( CPUMCTX, HcrEl2), 330 SSMFIELD_ENTRY( CPUMCTX, HpFarEl2), 331 SSMFIELD_ENTRY( CPUMCTX, MairEl2), 332 SSMFIELD_ENTRY( CPUMCTX, MdcrEl2), 333 SSMFIELD_ENTRY( CPUMCTX, SctlrEl2), 334 SSMFIELD_ENTRY( CPUMCTX, SpsrEl2), 335 SSMFIELD_ENTRY( CPUMCTX, SpEl2), 336 SSMFIELD_ENTRY( CPUMCTX, TcrEl2), 337 SSMFIELD_ENTRY( CPUMCTX, TpidrEl2), 338 SSMFIELD_ENTRY( CPUMCTX, Ttbr0El2), 339 SSMFIELD_ENTRY( CPUMCTX, Ttbr1El2), 340 SSMFIELD_ENTRY( CPUMCTX, VBarEl2), 341 SSMFIELD_ENTRY( CPUMCTX, VMpidrEl2), 342 SSMFIELD_ENTRY( CPUMCTX, VPidrEl2), 343 SSMFIELD_ENTRY( CPUMCTX, VTcrEl2), 344 SSMFIELD_ENTRY( CPUMCTX, VTtbrEl2), 345 /** @} */ 346 318 347 SSMFIELD_ENTRY_TERM() 319 348 }; … … 362 391 363 392 pVM->cpum.s.GuestInfo.paSysRegRangesR3 = &pVM->cpum.s.GuestInfo.aSysRegRanges[0]; 393 pVM->cpum.s.bResetEl = ARMV8_AARCH64_EL_1; 364 394 365 395 PCFGMNODE pCpumCfg = CFGMR3GetChild(CFGMR3GetRoot(pVM), "CPUM"); 366 396 367 397 /** @cfgm{/CPUM/ResetPcValue, string} 368 * Program counter value after a reset, sets the address of the first i sntruction to execute. */398 * Program counter value after a reset, sets the address of the first instruction to execute. */ 369 399 int rc = CFGMR3QueryU64Def(pCpumCfg, "ResetPcValue", &pVM->cpum.s.u64ResetPc, 0); 370 400 AssertLogRelRCReturn(rc, rc); 401 402 /** @cfgm{/CPUM/NestedHWVirt, bool, false} 403 * Whether to expose the hardware virtualization (EL2) feature to the guest. 404 * The default is false, and when enabled requires a 64-bit CPU and a NEM backend 405 * supporting it. 406 */ 407 bool fNestedHWVirt = false; 408 rc = CFGMR3QueryBoolDef(pCpumCfg, "NestedHWVirt", &fNestedHWVirt, false); 409 AssertLogRelRCReturn(rc, rc); 410 if (fNestedHWVirt) 411 pVM->cpum.s.bResetEl = ARMV8_AARCH64_EL_2; 371 412 372 413 /* … … 468 509 /* Start in Supervisor mode. */ 469 510 /** @todo Differentiate between Aarch64 and Aarch32 configuation. */ 470 pCtx->fPState = ARMV8_SPSR_EL2_AARCH64_SET_EL( ARMV8_AARCH64_EL_1)511 pCtx->fPState = ARMV8_SPSR_EL2_AARCH64_SET_EL(pVM->cpum.s.bResetEl) 471 512 | ARMV8_SPSR_EL2_AARCH64_SP 472 513 | ARMV8_SPSR_EL2_AARCH64_D -
trunk/src/VBox/VMM/VMMR3/CPUMDbg-armv8.cpp
r100118 r105686 157 157 #undef CPUMREGALIAS_STD 158 158 159 static DBGFREGALIAS const g_aCpumRegAliases_pstate[] =160 {161 { "spsr_el2", DBGFREGVALTYPE_U64 },162 { NULL, DBGFREGVALTYPE_INVALID }163 };164 165 159 166 160 /* … … 270 264 CPU_GREG_REG(29), 271 265 CPU_GREG_REG(30), 272 CPU_REG_RW_AS("pstate", PSTATE, U64, fPState, cpumR3RegGet_Generic, cpumR3RegSet_Generic, g_aCpumRegAliases_pstate,g_aCpumRegFields_pstate ),266 CPU_REG_RW_AS("pstate", PSTATE, U64, fPState, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, g_aCpumRegFields_pstate ), 273 267 CPU_REG_RW_AS("pc", PC, U64, Pc, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 274 268 CPU_REG_RW_AS("sp_el0", SP_EL0, U64, aSpReg[0], cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), … … 315 309 CPU_VREG_REG(30), 316 310 CPU_VREG_REG(31), 311 CPU_REG_RW_AS("cnthctl_el2", CNTHCTL_EL2, U64, CntHCtlEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 312 CPU_REG_RW_AS("cnthp_ctl_el2", CNTHP_CTL_EL2, U64, CntHpCtlEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 313 CPU_REG_RW_AS("cnthp_cval_el2", CNTHP_CVAL_EL2, U64, CntHpCValEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 314 CPU_REG_RW_AS("cnthp_tval_el2", CNTHP_TVAL_EL2, U64, CntHpTValEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 315 CPU_REG_RW_AS("cntvoff_el2", CNTVOFF_EL2, U64, CntVOffEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 316 CPU_REG_RW_AS("cptr_el2", CPTR_EL2, U64, CptrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 317 CPU_REG_RW_AS("elr_el2", ELR_EL2, U64, ElrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 318 CPU_REG_RW_AS("esr_el2", ESR_EL2, U64, EsrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 319 CPU_REG_RW_AS("far_el2", FAR_EL2, U64, FarEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 320 CPU_REG_RW_AS("hcr_el2", HCR_EL2, U64, HcrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 321 CPU_REG_RW_AS("hpfar_el2", HPFAR_EL2, U64, HpFarEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 322 CPU_REG_RW_AS("mair_el2", MAIR_EL2, U64, MairEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 323 CPU_REG_RW_AS("mdcr_el2", MDCR_EL2, U64, MdcrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 324 CPU_REG_RW_AS("sctlr_el2", SCTLR_EL2, U64, SctlrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 325 CPU_REG_RW_AS("spsr_el2", SPSR_EL2, U64, SpsrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 326 CPU_REG_RW_AS("sp_el2", SP_EL2, U64, SpEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 327 CPU_REG_RW_AS("tcr_el2", TCR_EL2, U64, TcrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 328 CPU_REG_RW_AS("tpidr_el2", TPIDR_EL2, U64, TpidrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 329 CPU_REG_RW_AS("ttbr0_el2", TTBR0_EL2, U64, Ttbr0El2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 330 CPU_REG_RW_AS("ttbr1_el2", TTBR1_EL2, U64, Ttbr1El2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 331 CPU_REG_RW_AS("vbar_el2", VBAR_EL2, U64, VBarEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 332 CPU_REG_RW_AS("vmpidr_el2", VMPIDR_EL2, U64, VMpidrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 333 CPU_REG_RW_AS("vpidr_el2", VPIDR_EL2, U64, VPidrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 334 CPU_REG_RW_AS("vtcr_el2", VTCR_EL2, U64, VTcrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 335 CPU_REG_RW_AS("vttbr_el2", VTTBR_EL2, U64, VTtbrEl2, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ), 336 317 337 DBGFREGDESC_TERMINATOR() 318 338 -
trunk/src/VBox/VMM/include/CPUMInternal-armv8.h
r101549 r105686 105 105 * This is used to verify load order dependencies (PGM). */ 106 106 bool fPendingRestore; 107 uint8_t abPadding0[6]; 107 /** The initial exception level (EL) to start the CPU after a reset, 108 * should be either ARMV8_AARCH64_EL_1 or ARMV8_AARCH64_EL_2 for nested virtualization. */ 109 uint8_t bResetEl; 110 111 uint8_t abPadding0[5]; 108 112 109 113 /** The reset value of the program counter. */
Note:
See TracChangeset
for help on using the changeset viewer.