Changeset 63648 in vbox for trunk/src/VBox/VMM/include
- Timestamp:
- Aug 26, 2016 11:44:40 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 110381
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/GIMHvInternal.h
r62641 r63648 476 476 /** Whether the SIEF page is enabled or not. */ 477 477 #define MSR_GIM_HV_SIEF_PAGE_IS_ENABLED(a) RT_BOOL((a) & MSR_GIM_HV_SIEF_PAGE_ENABLE) 478 /** @} */ 479 480 /** @name Hyper-V MSR - Synthetic Interrupt Control (MSR_GIM_HV_CONTROL). 481 * @{ 482 */ 483 /** The SControl enable mask. */ 484 #define MSR_GIM_HV_SCONTROL_ENABLE RT_BIT_64(0) 485 /** Whether SControl is enabled or not. */ 486 #define MSR_GIM_HV_SCONTROL_IS_ENABLED(a) RT_BOOL((a) & MSR_GIM_HV_SCONTROL_ENABLE) 487 /** @} */ 488 489 /** @name Hyper-V MSR - Synthetic Timer Config (MSR_GIM_HV_STIMER_CONFIG). 490 * @{ 491 */ 492 /** The Stimer enable mask. */ 493 #define MSR_GIM_HV_STIMER_ENABLE RT_BIT_64(0) 494 /** Whether Stimer is enabled or not. */ 495 #define MSR_GIM_HV_STIMER_IS_ENABLED(a) RT_BOOL((a) & MSR_GIM_HV_STIMER_ENABLE) 496 /** The Stimer periodic mask. */ 497 #define MSR_GIM_HV_STIMER_PERIODIC RT_BIT_64(1) 498 /** Whether Stimer is enabled or not. */ 499 #define MSR_GIM_HV_STIMER_IS_PERIODIC(a) RT_BOOL((a) & MSR_GIM_HV_STIMER_PERIODIC) 500 /** The Stimer lazy mask. */ 501 #define MSR_GIM_HV_STIMER_LAZY RT_BIT_64(2) 502 /** Whether Stimer is enabled or not. */ 503 #define MSR_GIM_HV_STIMER_IS_LAZY(a) RT_BOOL((a) & MSR_GIM_HV_STIMER_LAZY) 504 /** The Stimer auto-enable mask. */ 505 #define MSR_GIM_HV_STIMER_AUTO_ENABLE RT_BIT_64(3) 506 /** Whether Stimer is enabled or not. */ 507 #define MSR_GIM_HV_STIMER_IS_AUTO_ENABLED(a) RT_BOOL((a) & MSR_GIM_HV_STIMER_AUTO_ENABLE) 508 /** The Stimer SINTx mask (bits 16:19). */ 509 #define MSR_GIM_HV_STIMER_SINTX UINT64_C(0xf0000) 510 /** Gets the Stimer synthetic interrupt source. */ 511 #define MSR_GIM_HV_STIMER_GET_SINTX(a) (((a) >> 16) & 0xf) 512 /** The Stimer valid read/write mask. */ 513 #define MSR_GIM_HV_STIMER_RW_VALID ( MSR_GIM_HV_STIMER_ENABLE | MSR_GIM_HV_STIMER_PERIODIC \ 514 | MSR_GIM_HV_STIMER_LAZY | MSR_GIM_HV_STIMER_AUTO_ENABLE \ 515 | MSR_GIM_HV_STIMER_SINTX) 478 516 /** @} */ 479 517 … … 726 764 /** Whether the interrupt source is masked. */ 727 765 #define MSR_GIM_HV_SINT_IS_MASKED(a) RT_BOOL((a) & MSR_GIM_HV_SINT_MASKED) 728 /** Interrupt vector. */ 729 #define MSR_GIM_HV_SINT_VECTOR(a) ((a) & UINT64_C(0xff)) 766 /** Gets the interrupt vector. */ 767 #define MSR_GIM_HV_SINT_GET_VECTOR(a) ((a) & UINT64_C(0xff)) 768 /** The AutoEoi mask. */ 769 #define MSR_GIM_HV_SINT_AUTOEOI RT_BIT_64(17) 770 /** Gets whether AutoEoi is enabled for the synthetic interrupt. */ 771 #define MSR_GIM_HV_SINT_IS_AUTOEOI(a) RT_BOOL((a) & MSR_GIM_HV_SINT_AUTOEOI) 730 772 /** @} */ 731 773 … … 787 829 /** SynIC version register. */ 788 830 #define GIM_HV_SVERSION 1 789 /** Number of synthetic interrupt sources . */831 /** Number of synthetic interrupt sources (warning, fixed in saved-states!). */ 790 832 #define GIM_HV_SINT_COUNT 16 791 833 /** Lowest valid vector for synthetic interrupt. */ … … 793 835 /** Highest valid vector for synthetic interrupt. */ 794 836 #define GIM_HV_SINT_VECTOR_VALID_MAX 255 837 /** Number of synthetic timers. */ 838 #define GIM_HV_STIMER_COUNT 4 795 839 /** @} */ 796 840 797 841 /** @name Hyper-V synthetic interrupt message type. 842 * See 14.8.2 "SynIC Message Types" 798 843 * @{ 799 844 */ … … 1136 1181 1137 1182 /** 1138 * GIM Hyper-V VCPU instance data. 1183 * Hyper-V per-VCPU synthetic timer. 1184 */ 1185 typedef struct GIMHVSTIMER 1186 { 1187 /** Synthetic timer object - R0 ptr. */ 1188 PTMTIMERR0 pTimerR0; 1189 /** Synthetic timer object - R3 ptr. */ 1190 PTMTIMERR3 pTimerR3; 1191 /** Synthetic timer object - RC ptr. */ 1192 PTMTIMERRC pTimerRC; 1193 /** RC alignment padding. */ 1194 RTRCPTR uAlignment0; 1195 /** Virtual CPU ID this timer belongs to (for reverse mapping). */ 1196 VMCPUID idCpu; 1197 /** The index of this timer in the auStimers array (for reverse mapping). */ 1198 uint32_t idxStimer; 1199 /** Synthetic timer config MSR. */ 1200 uint64_t uStimerConfigMsr; 1201 /** Synthetic timer count MSR. */ 1202 uint64_t uStimerCountMsr; 1203 /** Timer description. */ 1204 char szTimerDesc[24]; 1205 1206 } GIMHVSTIMER; 1207 /** Pointer to per-VCPU Hyper-V synthetic timer. */ 1208 typedef GIMHVSTIMER *PGIMHVSTIMER; 1209 /** Pointer to a const per-VCPU Hyper-V synthetic timer. */ 1210 typedef GIMHVSTIMER const *PCGIMHVSTIMER; 1211 AssertCompileSizeAlignment(GIMHVSTIMER, 8); 1212 1213 /** 1214 * Hyper-V VCPU instance data. 1139 1215 * Changes to this must checked against the padding of the gim union in VMCPU! 1140 1216 */ … … 1146 1222 uint64_t uSimpMsr; 1147 1223 /** Interrupt source MSRs. */ 1148 uint64_t auSint XMsr[GIM_HV_SINT_COUNT];1224 uint64_t auSintMsrs[GIM_HV_SINT_COUNT]; 1149 1225 /** Synethtic interrupt events flag page MSR. */ 1150 1226 uint64_t uSiefpMsr; 1151 1227 /** APIC-assist page MSR. */ 1152 1228 uint64_t uApicAssistPageMsr; 1229 /** Synthetic interrupt control MSR. */ 1230 uint64_t uSControlMsr; 1231 /** Synthetic timers. */ 1232 GIMHVSTIMER aStimers[GIM_HV_STIMER_COUNT]; 1233 /** @} */ 1234 1235 /** @name Statistics. 1236 * @{ */ 1237 STAMCOUNTER aStatStimerFired[GIM_HV_STIMER_COUNT]; 1153 1238 /** @} */ 1154 1239 } GIMHVCPU; … … 1205 1290 VMM_INT_DECL(VBOXSTRICTRC) gimHvWriteMsr(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uRawValue); 1206 1291 1292 VMM_INT_DECL(void) gimHvStartStimer(PVMCPU pVCpu, PCGIMHVSTIMER pHvStimer); 1293 1207 1294 RT_C_DECLS_END 1208 1295
Note:
See TracChangeset
for help on using the changeset viewer.