Changeset 92359 in vbox for trunk/src/VBox/VMM/include/HMVMXCommon.h
- Timestamp:
- Nov 11, 2021 11:06:08 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148210
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/HMVMXCommon.h
r92354 r92359 222 222 AssertCompileSizeAlignment(HMEVENT, 8); 223 223 224 225 typedef struct VMXVMCSINFOSHARED 226 { 227 /** @name Real-mode emulation state. 228 * @{ */ 229 /** Set if guest was executing in real mode (extra checks). */ 230 bool fWasInRealMode; 231 /** Padding. */ 232 bool afPadding0[7]; 233 struct 234 { 235 X86DESCATTR AttrCS; 236 X86DESCATTR AttrDS; 237 X86DESCATTR AttrES; 238 X86DESCATTR AttrFS; 239 X86DESCATTR AttrGS; 240 X86DESCATTR AttrSS; 241 X86EFLAGS Eflags; 242 bool fRealOnV86Active; 243 bool afPadding1[3]; 244 } RealMode; 245 /** @} */ 246 247 /** @name LBR MSR data. 248 * @{ */ 249 /** List of LastBranch-From-IP MSRs. */ 250 uint64_t au64LbrFromIpMsr[32]; 251 /** List of LastBranch-To-IP MSRs. */ 252 uint64_t au64LbrToIpMsr[32]; 253 /** The MSR containing the index to the most recent branch record. */ 254 uint64_t u64LbrTosMsr; 255 /** @} */ 256 } VMXVMCSINFOSHARED; 257 /** Pointer to a VMXVMCSINFOSHARED struct. */ 258 typedef VMXVMCSINFOSHARED *PVMXVMCSINFOSHARED; 259 /** Pointer to a const VMXVMCSINFOSHARED struct. */ 260 typedef const VMXVMCSINFOSHARED *PCVMXVMCSINFOSHARED; 261 AssertCompileSizeAlignment(VMXVMCSINFOSHARED, 8); 262 263 264 /** 265 * VMX VMCS information, ring-0 only. 266 * 267 * This structure provides information maintained for and during the executing of a 268 * guest (or nested-guest) VMCS (VM control structure) using hardware-assisted VMX. 269 * 270 * Note! The members here are ordered and aligned based on estimated frequency of 271 * usage and grouped to fit within a cache line in hot code paths. Even subtle 272 * changes here have a noticeable effect in the bootsector benchmarks. Modify with 273 * care. 274 */ 275 typedef struct VMXVMCSINFO 276 { 277 /** Pointer to the bits we share with ring-3. */ 278 R3R0PTRTYPE(PVMXVMCSINFOSHARED) pShared; 279 280 /** @name Auxiliary information. 281 * @{ */ 282 /** Host-physical address of the EPTP. */ 283 RTHCPHYS HCPhysEPTP; 284 /** The VMCS launch state, see VMX_V_VMCS_LAUNCH_STATE_XXX. */ 285 uint32_t fVmcsState; 286 /** The VMCS launch state of the shadow VMCS, see VMX_V_VMCS_LAUNCH_STATE_XXX. */ 287 uint32_t fShadowVmcsState; 288 /** The host CPU for which its state has been exported to this VMCS. */ 289 RTCPUID idHostCpuState; 290 /** The host CPU on which we last executed this VMCS. */ 291 RTCPUID idHostCpuExec; 292 /** Number of guest MSRs in the VM-entry MSR-load area. */ 293 uint32_t cEntryMsrLoad; 294 /** Number of guest MSRs in the VM-exit MSR-store area. */ 295 uint32_t cExitMsrStore; 296 /** Number of host MSRs in the VM-exit MSR-load area. */ 297 uint32_t cExitMsrLoad; 298 /** @} */ 299 300 /** @name Cache of execution related VMCS fields. 301 * @{ */ 302 /** Pin-based VM-execution controls. */ 303 uint32_t u32PinCtls; 304 /** Processor-based VM-execution controls. */ 305 uint32_t u32ProcCtls; 306 /** Secondary processor-based VM-execution controls. */ 307 uint32_t u32ProcCtls2; 308 /** Tertiary processor-based VM-execution controls. */ 309 uint64_t u64ProcCtls3; 310 /** VM-entry controls. */ 311 uint32_t u32EntryCtls; 312 /** VM-exit controls. */ 313 uint32_t u32ExitCtls; 314 /** Exception bitmap. */ 315 uint32_t u32XcptBitmap; 316 /** Page-fault exception error-code mask. */ 317 uint32_t u32XcptPFMask; 318 /** Page-fault exception error-code match. */ 319 uint32_t u32XcptPFMatch; 320 /** Padding. */ 321 uint32_t u32Alignment0; 322 /** TSC offset. */ 323 uint64_t u64TscOffset; 324 /** VMCS link pointer. */ 325 uint64_t u64VmcsLinkPtr; 326 /** CR0 guest/host mask. */ 327 uint64_t u64Cr0Mask; 328 /** CR4 guest/host mask. */ 329 uint64_t u64Cr4Mask; 330 #ifdef IN_RING0 331 /** Current VMX_VMCS_HOST_RIP value (only used in HMR0A.asm). */ 332 uint64_t uHostRip; 333 /** Current VMX_VMCS_HOST_RSP value (only used in HMR0A.asm). */ 334 uint64_t uHostRsp; 335 #endif 336 /** @} */ 337 338 /** @name Host-virtual address of VMCS and related data structures. 339 * @{ */ 340 /** The VMCS. */ 341 R3R0PTRTYPE(void *) pvVmcs; 342 /** The shadow VMCS. */ 343 R3R0PTRTYPE(void *) pvShadowVmcs; 344 /** The virtual-APIC page. */ 345 R3R0PTRTYPE(uint8_t *) pbVirtApic; 346 /** The MSR bitmap. */ 347 R3R0PTRTYPE(void *) pvMsrBitmap; 348 /** The VM-entry MSR-load area. */ 349 R3R0PTRTYPE(void *) pvGuestMsrLoad; 350 /** The VM-exit MSR-store area. */ 351 R3R0PTRTYPE(void *) pvGuestMsrStore; 352 /** The VM-exit MSR-load area. */ 353 R3R0PTRTYPE(void *) pvHostMsrLoad; 354 /** @} */ 355 356 #ifdef IN_RING0 357 /** @name Host-physical address of VMCS and related data structures. 358 * @{ */ 359 /** The VMCS. */ 360 RTHCPHYS HCPhysVmcs; 361 /** The shadow VMCS. */ 362 RTHCPHYS HCPhysShadowVmcs; 363 /** The virtual APIC page. */ 364 RTHCPHYS HCPhysVirtApic; 365 /** The MSR bitmap. */ 366 RTHCPHYS HCPhysMsrBitmap; 367 /** The VM-entry MSR-load area. */ 368 RTHCPHYS HCPhysGuestMsrLoad; 369 /** The VM-exit MSR-store area. */ 370 RTHCPHYS HCPhysGuestMsrStore; 371 /** The VM-exit MSR-load area. */ 372 RTHCPHYS HCPhysHostMsrLoad; 373 /** @} */ 374 375 /** @name R0-memory objects address for VMCS and related data structures. 376 * @{ */ 377 /** R0-memory object for VMCS and related data structures. */ 378 RTR0MEMOBJ hMemObj; 379 /** @} */ 380 #endif 381 } VMXVMCSINFO; 382 /** Pointer to a VMXVMCSINFOR0 struct. */ 383 typedef VMXVMCSINFO *PVMXVMCSINFO; 384 /** Pointer to a const VMXVMCSINFO struct. */ 385 typedef const VMXVMCSINFO *PCVMXVMCSINFO; 386 AssertCompileSizeAlignment(VMXVMCSINFO, 8); 387 AssertCompileMemberAlignment(VMXVMCSINFO, u32PinCtls, 4); 388 AssertCompileMemberAlignment(VMXVMCSINFO, u64VmcsLinkPtr, 8); 389 AssertCompileMemberAlignment(VMXVMCSINFO, pvVmcs, 8); 390 AssertCompileMemberAlignment(VMXVMCSINFO, pvShadowVmcs, 8); 391 AssertCompileMemberAlignment(VMXVMCSINFO, pbVirtApic, 8); 392 AssertCompileMemberAlignment(VMXVMCSINFO, pvMsrBitmap, 8); 393 AssertCompileMemberAlignment(VMXVMCSINFO, pvGuestMsrLoad, 8); 394 AssertCompileMemberAlignment(VMXVMCSINFO, pvGuestMsrStore, 8); 395 AssertCompileMemberAlignment(VMXVMCSINFO, pvHostMsrLoad, 8); 396 #ifdef IN_RING0 397 AssertCompileMemberAlignment(VMXVMCSINFO, HCPhysVmcs, 8); 398 AssertCompileMemberAlignment(VMXVMCSINFO, hMemObj, 8); 399 #endif 400 224 401 /** @} */ 225 402
Note:
See TracChangeset
for help on using the changeset viewer.