- Timestamp:
- Mar 28, 2023 1:06:05 PM (22 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum-armv8.h
r99051 r99196 48 48 * @{ 49 49 */ 50 51 52 /** 53 * System register read functions. 54 */ 55 typedef enum CPUMSYSREGRDFN 56 { 57 /** Invalid zero value. */ 58 kCpumSysRegRdFn_Invalid = 0, 59 /** Return the CPUMMSRRANGE::uValue. */ 60 kCpumSysRegRdFn_FixedValue, 61 /** Alias to the system register range starting at the system register given by 62 * CPUMSYSREGRANGE::uValue. Must be used in pair with 63 * kCpumSysRegWrFn_Alias. */ 64 kCpumSysRegRdFn_Alias, 65 /** Write only register, all read attempts cause an exception. */ 66 kCpumSysRegRdFn_WriteOnly, 67 68 /** End of valid system register read function indexes. */ 69 kCpumSysRegRdFn_End 70 } CPUMSYSREGRDFN; 71 72 73 /** 74 * System register write functions. 75 */ 76 typedef enum CPUMSYSREGWRFN 77 { 78 /** Invalid zero value. */ 79 kCpumSysRegWrFn_Invalid = 0, 80 /** Writes are ignored. */ 81 kCpumSysRegWrFn_IgnoreWrite, 82 /** Writes cause an exception. */ 83 kCpumSysRegWrFn_ReadOnly, 84 /** Alias to the system register range starting at the system register given by 85 * CPUMSYSREGRANGE::uValue. Must be used in pair with 86 * kCpumSysRegRdFn_Alias. */ 87 kCpumSysRegWrFn_Alias, 88 89 /** End of valid system register write function indexes. */ 90 kCpumSysRegWrFn_End 91 } CPUMSYSREGWRFN; 92 93 94 /** 95 * System register range. 96 * 97 * @note This is very similar to how x86/amd64 MSRs are handled. 98 */ 99 typedef struct CPUMSYSREGRANGE 100 { 101 /** The first system register. [0] */ 102 uint16_t uFirst; 103 /** The last system register. [2] */ 104 uint16_t uLast; 105 /** The read function (CPUMMSRRDFN). [4] */ 106 uint16_t enmRdFn; 107 /** The write function (CPUMMSRWRFN). [6] */ 108 uint16_t enmWrFn; 109 /** The offset of the 64-bit system register value relative to the start of CPUMCPU. 110 * UINT16_MAX if not used by the read and write functions. [8] */ 111 uint32_t offCpumCpu : 24; 112 /** Reserved for future hacks. [11] */ 113 uint32_t fReserved : 8; 114 /** Padding/Reserved. [12] */ 115 uint32_t u32Padding; 116 /** The init/read value. [16] 117 * When enmRdFn is kCpumMsrRdFn_INIT_VALUE, this is the value returned on RDMSR. 118 * offCpumCpu must be UINT16_MAX in that case, otherwise it must be a valid 119 * offset into CPUM. */ 120 uint64_t uValue; 121 /** The bits to ignore when writing. [24] */ 122 uint64_t fWrIgnMask; 123 /** The bits that will cause an exception when writing. [32] 124 * This is always checked prior to calling the write function. Using 125 * UINT64_MAX effectively marks the MSR as read-only. */ 126 uint64_t fWrExcpMask; 127 /** The register name, if applicable. [32] */ 128 char szName[56]; 129 130 /** The number of reads. */ 131 STAMCOUNTER cReads; 132 /** The number of writes. */ 133 STAMCOUNTER cWrites; 134 /** The number of times ignored bits were written. */ 135 STAMCOUNTER cIgnoredBits; 136 /** The number of exceptions generated. */ 137 STAMCOUNTER cExcp; 138 } CPUMSYSREGRANGE; 139 #ifndef VBOX_FOR_DTRACE_LIB 140 AssertCompileSize(CPUMSYSREGRANGE, 128); 141 #endif 142 /** Pointer to an system register range. */ 143 typedef CPUMSYSREGRANGE *PCPUMSYSREGRANGE; 144 /** Pointer to a const system register range. */ 145 typedef CPUMSYSREGRANGE const *PCCPUMSYSREGRANGE; 146 50 147 51 148 /** … … 155 252 /** @} */ 156 253 254 255 #ifndef VBOX_FOR_DTRACE_LIB 256 257 /** @name Guest Register Getters. 258 * @{ */ 259 VMMDECL(VBOXSTRICTRC) CPUMQueryGuestSysReg(PVMCPUCC pVCpu, uint32_t idSysReg, uint64_t *puValue); 260 VMMDECL(VBOXSTRICTRC) CPUMSetGuestSysReg(PVMCPUCC pVCpu, uint32_t idSysReg, uint64_t uValue); 261 /** @} */ 262 263 #endif 264 157 265 /** @} */ 158 266 RT_C_DECLS_END -
trunk/src/VBox/VMM/Makefile.kmk
r99070 r99196 413 413 VMMR3/HM-armv8.cpp \ 414 414 VMMAll/CPUMAllRegs-armv8.cpp \ 415 VMMAll/CPUMAllSysRegs-armv8.cpp \ 415 416 VMMAll/DBGFAll.cpp \ 416 417 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \ -
trunk/src/VBox/VMM/VMMR3/CPUM-armv8.cpp
r99070 r99196 202 202 AssertCompileMemberAlignment(VM, cpum, 64); 203 203 AssertCompileMemberAlignment(VMCPU, cpum.s, 64); 204 #ifdef VBOX_STRICT 205 int rc2 = cpumR3SysRegStrictInitChecks(); 206 AssertRCReturn(rc2, rc2); 207 #endif 204 208 205 209 /* -
trunk/src/VBox/VMM/include/CPUMInternal-armv8.h
r99070 r99196 76 76 77 77 /** 78 * CPU info 79 */ 80 typedef struct CPUMINFO 81 { 82 /** The number of system register ranges (CPUMSSREGRANGE) in the array pointed to below. */ 83 uint32_t cSysRegRanges; 84 85 /** MSR ranges. 86 * @todo This is insane, so might want to move this into a separate 87 * allocation. The insanity is mainly for more recent AMD CPUs. */ 88 CPUMSYSREGRANGE aSysRegRanges[1024]; 89 } CPUMINFO; 90 /** Pointer to a CPU info structure. */ 91 typedef CPUMINFO *PCPUMINFO; 92 /** Pointer to a const CPU info structure. */ 93 typedef CPUMINFO const *CPCPUMINFO; 94 95 96 /** 78 97 * CPUM Data (part of VM) 79 98 */ … … 85 104 uint8_t abPadding0[7]; 86 105 106 /** Guest CPU info. */ 107 CPUMINFO GuestInfo; 87 108 /** @todo */ 109 110 /** @name System register statistics. 111 * @{ */ 112 STAMCOUNTER cSysRegWrites; 113 STAMCOUNTER cSysRegWritesToIgnoredBits; 114 STAMCOUNTER cSysRegWritesRaiseExcp; 115 STAMCOUNTER cSysRegWritesUnknown; 116 STAMCOUNTER cSysRegReads; 117 STAMCOUNTER cSysRegReadsRaiseExcp; 118 STAMCOUNTER cSysRegReadsUnknown; 119 /** @} */ 88 120 } CPUM; 89 121 #ifndef VBOX_FOR_DTRACE_LIB … … 125 157 # ifdef IN_RING3 126 158 DECLHIDDEN(int) cpumR3DbgInit(PVM pVM); 159 DECLHIDDEN(int) cpumR3SysRegStrictInitChecks(void); 127 160 # endif 128 161
Note:
See TracChangeset
for help on using the changeset viewer.