- Timestamp:
- May 20, 2016 4:26:32 AM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r61075 r61078 543 543 VMCPU_ASSERT_EMT(pVCpu); 544 544 545 uint32_t uValidMask = XAPIC_SVR ;545 uint32_t uValidMask = XAPIC_SVR_VALID; 546 546 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu); 547 547 if (pXApicPage->version.u.fEoiBroadcastSupression) … … 1030 1030 1031 1031 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu); 1032 pXApicPage->icr_lo.all.u32IcrLo = uIcrLo & XAPIC_ICR_LO_WR ;1032 pXApicPage->icr_lo.all.u32IcrLo = uIcrLo & XAPIC_ICR_LO_WR_VALID; 1033 1033 Log2(("APIC%u: apicSetIcrLo: uIcrLo=%#RX32\n", pVCpu->idCpu, pXApicPage->icr_lo.all.u32IcrLo)); 1034 1034 … … 1053 1053 /* Validate. */ 1054 1054 uint32_t const uLo = RT_LO_U32(u64Icr); 1055 if (RT_LIKELY(!(uLo & ~XAPIC_ICR_LO_WR )))1055 if (RT_LIKELY(!(uLo & ~XAPIC_ICR_LO_WR_VALID))) 1056 1056 { 1057 1057 /* Update high dword first, then update the low dword which sends the IPI. */ … … 1078 1078 1079 1079 if ( XAPIC_IN_X2APIC_MODE(pVCpu) 1080 && (uEsr & ~XAPIC_ESR_WO ))1080 && (uEsr & ~XAPIC_ESR_WO_VALID)) 1081 1081 return apicMsrAccessError(pVCpu, MSR_IA32_X2APIC_ESR, APICMSRACCESS_WRITE_RSVD_BITS); 1082 1082 … … 1151 1151 1152 1152 if ( XAPIC_IN_X2APIC_MODE(pVCpu) 1153 && (uTpr & ~XAPIC_TPR ))1153 && (uTpr & ~XAPIC_TPR_VALID)) 1154 1154 return apicMsrAccessError(pVCpu, MSR_IA32_X2APIC_TPR, APICMSRACCESS_WRITE_RSVD_BITS); 1155 1155 … … 1177 1177 1178 1178 if ( XAPIC_IN_X2APIC_MODE(pVCpu) 1179 && (uEoi & ~XAPIC_EOI_WO ))1179 && (uEoi & ~XAPIC_EOI_WO_VALID)) 1180 1180 return apicMsrAccessError(pVCpu, MSR_IA32_X2APIC_EOI, APICMSRACCESS_WRITE_RSVD_BITS); 1181 1181 … … 1222 1222 1223 1223 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu); 1224 apicWriteRaw32(pXApicPage, XAPIC_OFF_LDR, uLdr & XAPIC_LDR );1224 apicWriteRaw32(pXApicPage, XAPIC_OFF_LDR, uLdr & XAPIC_LDR_VALID); 1225 1225 return VINF_SUCCESS; 1226 1226 } … … 1241 1241 Assert(!XAPIC_IN_X2APIC_MODE(pVCpu)); 1242 1242 1243 uDfr &= XAPIC_DFR ;1243 uDfr &= XAPIC_DFR_VALID; 1244 1244 uDfr |= XAPIC_DFR_RSVD_MB1; 1245 1245 … … 1263 1263 VMCPU_ASSERT_EMT(pVCpu); 1264 1264 if ( XAPIC_IN_X2APIC_MODE(pVCpu) 1265 && (uTimerDcr & ~XAPIC_TIMER_DCR ))1265 && (uTimerDcr & ~XAPIC_TIMER_DCR_VALID)) 1266 1266 return apicMsrAccessError(pVCpu, MSR_IA32_X2APIC_TIMER_DCR, APICMSRACCESS_WRITE_RSVD_BITS); 1267 1267 -
trunk/src/VBox/VMM/VMMR3/APIC.cpp
r61075 r61078 871 871 uint32_t u32Tpr; 872 872 SSMR3GetU32(pSSM, &u32Tpr); 873 pXApicPage->tpr.u8Tpr = u32Tpr & XAPIC_TPR ;873 pXApicPage->tpr.u8Tpr = u32Tpr & XAPIC_TPR_VALID; 874 874 875 875 SSMR3GetU32(pSSM, &pXApicPage->svr.all.u32Svr); -
trunk/src/VBox/VMM/include/APICInternal.h
r61077 r61078 104 104 #define XAPIC_ESR_ILLEGAL_REG_ADDRESS RT_BIT(7) 105 105 /** ESR - Valid write-only bits. */ 106 #define XAPIC_ESR_WO 106 #define XAPIC_ESR_WO_VALID UINT32_C(0x0) 107 107 108 108 /** TPR - Valid bits. */ 109 #define XAPIC_TPR 109 #define XAPIC_TPR_VALID UINT32_C(0xff) 110 110 /** TPR - Task-priority class. */ 111 111 #define XAPIC_TPR_TP UINT32_C(0xf0) … … 118 118 119 119 /** PPR - Valid bits. */ 120 #define XAPIC_PPR 120 #define XAPIC_PPR_VALID UINT32_C(0xff) 121 121 /** PPR - Processor-priority class. */ 122 122 #define XAPIC_PPR_PP UINT32_C(0xf0) … … 164 164 #define XAPIC_LVT_INTR_INPUT_PIN_POLARITY RT_BIT(13) 165 165 /** LVT - Valid bits common to all LVTs. */ 166 #define XAPIC_LVT_COMMON 166 #define XAPIC_LVT_COMMON_VALID (XAPIC_LVT_VECTOR | XAPIC_LVT_DELIVERY_STATUS | XAPIC_LVT_MASK) 167 167 /** LVT CMCI - Valid bits. */ 168 #define XAPIC_LVT_CMCI_VALID (XAPIC_LVT_COMMON | XAPIC_LVT_DELIVERY_MODE)168 #define XAPIC_LVT_CMCI_VALID (XAPIC_LVT_COMMON_VALID | XAPIC_LVT_DELIVERY_MODE) 169 169 /** LVT Timer - Valid bits. */ 170 #define XAPIC_LVT_TIMER_VALID (XAPIC_LVT_COMMON | XAPIC_LVT_TIMER_MODE | XAPIC_LVT_TIMER_TSCDEADLINE)170 #define XAPIC_LVT_TIMER_VALID (XAPIC_LVT_COMMON_VALID | XAPIC_LVT_TIMER_MODE | XAPIC_LVT_TIMER_TSCDEADLINE) 171 171 /** LVT Thermal - Valid bits. */ 172 #define XAPIC_LVT_THERMAL_VALID (XAPIC_LVT_COMMON | XAPIC_LVT_DELIVERY_MODE)172 #define XAPIC_LVT_THERMAL_VALID (XAPIC_LVT_COMMON_VALID | XAPIC_LVT_DELIVERY_MODE) 173 173 /** LVT Perf - Valid bits. */ 174 #define XAPIC_LVT_PERF_VALID (XAPIC_LVT_COMMON | XAPIC_LVT_DELIVERY_MODE)174 #define XAPIC_LVT_PERF_VALID (XAPIC_LVT_COMMON_VALID | XAPIC_LVT_DELIVERY_MODE) 175 175 /** LVT LINTx - Valid bits. */ 176 #define XAPIC_LVT_LINT_VALID ( XAPIC_LVT_COMMON | XAPIC_LVT_DELIVERY_MODE | XAPIC_LVT_DELIVERY_STATUS \176 #define XAPIC_LVT_LINT_VALID ( XAPIC_LVT_COMMON_VALID | XAPIC_LVT_DELIVERY_MODE | XAPIC_LVT_DELIVERY_STATUS \ 177 177 | XAPIC_LVT_INTR_INPUT_PIN_POLARITY | XAPIC_LVT_REMOTE_IRR | XAPIC_LVT_TRIGGER_MODE) 178 178 /** LVT Error - Valid bits. */ 179 #define XAPIC_LVT_ERROR_VALID (XAPIC_LVT_COMMON )179 #define XAPIC_LVT_ERROR_VALID (XAPIC_LVT_COMMON_VALID) 180 180 181 181 /** SVR - The vector. */ … … 187 187 #if XAPIC_HARDWARE_VERSION == XAPIC_HARDWARE_VERSION_P4 188 188 /** SVR - Valid bits. */ 189 # define XAPIC_SVR 189 # define XAPIC_SVR_VALID (XAPIC_SVR_VECTOR | XAPIC_SVR_SOFTWARE_ENABLE) 190 190 #else 191 191 # error "Implement Pentium and P6 family APIC architectures" … … 193 193 194 194 /** DFR - Valid bits. */ 195 #define XAPIC_DFR 195 #define XAPIC_DFR_VALID UINT32_C(0xf0000000) 196 196 /** DFR - Reserved bits that must always remain set. */ 197 197 #define XAPIC_DFR_RSVD_MB1 UINT32_C(0x0fffffff) … … 202 202 203 203 /** LDR - Valid bits. */ 204 #define XAPIC_LDR 204 #define XAPIC_LDR_VALID UINT32_C(0xff000000) 205 205 /** LDR - Cluster ID mask (x2APIC). */ 206 206 #define X2APIC_LDR_CLUSTER_ID UINT32_C(0xffff0000) … … 221 221 222 222 /** EOI - Valid write-only bits. */ 223 #define XAPIC_EOI_WO 223 #define XAPIC_EOI_WO_VALID UINT32_C(0x0) 224 224 /** Timer ICR - Valid bits. */ 225 #define XAPIC_TIMER_ICR 225 #define XAPIC_TIMER_ICR_VALID UINT32_C(0xffffffff) 226 226 /** Timer DCR - Valid bits. */ 227 #define XAPIC_TIMER_DCR 227 #define XAPIC_TIMER_DCR_VALID (RT_BIT(0) | RT_BIT(1) | RT_BIT(3)) 228 228 229 229 /** Self IPI - Valid bits. */ 230 #define XAPIC_SELF_IPI 230 #define XAPIC_SELF_IPI_VALID UINT32_C(0xff) 231 231 /** Self IPI - The vector. */ 232 232 #define XAPIC_SELF_IPI_VECTOR UINT32_C(0xff) … … 251 251 #define XAPIC_ICR_LO_DEST_SHORTHAND (RT_BIT(18) | RT_BIT(19)) 252 252 /** ICR Low - Valid write bits. */ 253 #define XAPIC_ICR_LO_WR 253 #define XAPIC_ICR_LO_WR_VALID ( XAPIC_ICR_LO_VECTOR | XAPIC_ICR_LO_DELIVERY_MODE | XAPIC_ICR_LO_DEST_MODE \ 254 254 | XAPIC_ICR_LO_LEVEL | XAPIC_ICR_TRIGGER_MODE | XAPIC_ICR_LO_DEST_SHORTHAND) 255 255 … … 259 259 #define XAPIC_ICR_HI_GET_DEST(a_u32IcrHi) (((a_u32IcrHi) >> 24) & XAPIC_ICR_HI_DEST) 260 260 /** ICR High - Valid write bits in xAPIC mode. */ 261 #define XAPIC_ICR_HI_WR 261 #define XAPIC_ICR_HI_WR_VALID XAPIC_ICR_HI_DEST 262 262 263 263 /** APIC ID broadcast mask - x2APIC mode. */
Note:
See TracChangeset
for help on using the changeset viewer.