Changeset 88600 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Apr 20, 2021 11:23:33 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp
r88596 r88600 139 139 kDmarDiag_None = 0, 140 140 kDmarDiag_IqtReg_Qt_NotAligned, 141 kDmarDiag_IqaReg_Dw_Invalid, 141 142 /* Last member for determining array index limit. */ 142 143 kDmarDiag_End … … 150 151 static const char *const g_apszDmarDiagDesc[] = 151 152 { 152 DMARDIAG_DESC(kNone, "None" ), 153 DMARDIAG_DESC(kDmarDiag_IqtReg_Qt_NotAligned, "IqtReg_Qt_NotAligned") 153 DMARDIAG_DESC(kNone , "None" ), 154 DMARDIAG_DESC(kDmarDiag_IqtReg_Qt_NotAligned, "IqtReg_Qt_NotAligned"), 155 DMARDIAG_DESC(kDmarDiag_IqaReg_Dw_Invalid , "IqaReg_Dw_Invalid" ) 154 156 /* kDmarDiag_End */ 155 157 }; … … 841 843 * @param pThisCC The current-context DMAR device state. 842 844 */ 843 static void dmarFaultRaiseInterrupt(PPDMDEVINS pDevIns, PDMAR pThis, PCDMARCC pThisCC) 844 { 845 static void dmarFaultRaiseInterrupt(PPDMDEVINS pDevIns) 846 { 847 PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR); 848 PCDMARCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PCDMARCC); 845 849 #ifdef RT_STRICT 846 850 { … … 918 922 919 923 /** 920 * Records an IQE (invalidation queue error)fault.924 * Records an IQE fault. 921 925 * 922 926 * @param pDevIns The IOMMU device instance. … … 941 945 dmarRegChange64(pThis, VTD_MMIO_OFF_IQERCD_REG, UINT64_MAX, fIqei); 942 946 943 dmarFaultRaiseInterrupt(pDevIns , pThis, pThisCC);947 dmarFaultRaiseInterrupt(pDevIns); 944 948 } 945 949 … … 956 960 static VBOXSTRICTRC dmarCcmdRegWrite(PPDMDEVINS pDevIns, uint16_t off, uint8_t cb, uint64_t uCcmdReg) 957 961 { 958 /* We only care about responding to high 32-bits writes, low 32-bits are data. */962 /* At present, we only care about responding to high 32-bits writes, low 32-bits are data. */ 959 963 if (off + cb > VTD_MMIO_OFF_CCMD_REG + 4) 960 964 { … … 1018 1022 1019 1023 /** 1024 * Handles writes to IQA_REG. 1025 * 1026 * @returns Strict VBox status code. 1027 * @param pDevIns The IOMMU device instance. 1028 * @param off The MMIO register offset. 1029 * @param cb The size of the MMIO access (in bytes). 1030 * @param uIqaReg The value written to IQA_REG. 1031 */ 1032 static VBOXSTRICTRC dmarIqaRegWrite(PPDMDEVINS pDevIns, uint16_t off, uint64_t uIqaReg) 1033 { 1034 /** @todo Don't allow writing this when GSTS.QIES is set? */ 1035 1036 /* At present, we only care about the low 32-bits, high 32-bits are data. */ 1037 if (off == VTD_MMIO_OFF_IQA_REG) 1038 { 1039 PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR); 1040 uint8_t const fDw = RT_BF_GET(uIqaReg, VTD_BF_IQA_REG_DW); 1041 if (fDw == VTD_IQA_REG_DW_256_BIT) 1042 { 1043 uint64_t const fDwMask = VTD_BF_ECAP_REG_SMTS_MASK | VTD_BF_ECAP_REG_ADMS_MASK; 1044 bool const fSupports256BitDw = RT_BOOL(pThis->fExtCap & fDwMask); 1045 if (fSupports256BitDw) 1046 { /* likely */ } 1047 else 1048 dmarIqeFaultRecord(pDevIns, kDmarDiag_IqaReg_Dw_Invalid, kInvalidDescriptorWidth); 1049 } 1050 } 1051 return VINF_SUCCESS; 1052 } 1053 1054 1055 /** 1020 1056 * Memory access bulk (one or more 4K pages) request from a device. 1021 1057 * … … 1111 1147 { 1112 1148 rcStrict = dmarCcmdRegWrite(pDevIns, offReg, cb, uRegWritten); 1149 break; 1150 } 1151 1152 case VTD_MMIO_OFF_IQA_REG: 1153 case VTD_MMIO_OFF_IQA_REG + 4: 1154 { 1155 rcStrict = dmarIqaRegWrite(pDevIns, offReg, uRegWritten); 1113 1156 break; 1114 1157 }
Note:
See TracChangeset
for help on using the changeset viewer.