Changeset 89666 in vbox for trunk/src/VBox/Devices/Bus
- Timestamp:
- Jun 14, 2021 7:28:22 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145112
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp
r89591 r89666 110 110 /** Size of the group 0 (in bytes). */ 111 111 #define DMAR_MMIO_GROUP_0_SIZE (DMAR_MMIO_GROUP_0_OFF_END - DMAR_MMIO_GROUP_0_OFF_FIRST) 112 /**< Implementation-specific MMIO offset of IVA_REG. */ 112 /** Number of MMIO register offsets defined by our implementation (for saved 113 * states) - IVA_REG, IOTLB_REG, FRCD_LO, FRCD_HI. */ 114 #define DMAR_MMIO_OFF_IMPL_COUNT 4 115 /** Implementation-specific MMIO offset of IVA_REG (used in saved state). */ 113 116 #define DMAR_MMIO_OFF_IVA_REG 0xe50 114 /** < Implementation-specific MMIO offset of IOTLB_REG. */117 /** Implementation-specific MMIO offset of IOTLB_REG (used in saved state). */ 115 118 #define DMAR_MMIO_OFF_IOTLB_REG 0xe58 116 /** < Implementation-specific MMIO offset of FRCD_LO_REG. */119 /** Implementation-specific MMIO offset of FRCD_LO_REG (used in saved state). */ 117 120 #define DMAR_MMIO_OFF_FRCD_LO_REG 0xe70 118 /** < Implementation-specific MMIO offset of FRCD_HI_REG. */121 /** Implementation-specific MMIO offset of FRCD_HI_REG (used in saved state). */ 119 122 #define DMAR_MMIO_OFF_FRCD_HI_REG 0xe78 120 123 AssertCompile(!(DMAR_MMIO_OFF_FRCD_LO_REG & 0xf)); … … 3945 3948 pHlp->pfnSSMPutMem(pSSM, &pThis->abRegs1[0], sizeof(pThis->abRegs1)); 3946 3949 3950 /* 3951 * Save our implemention-defined MMIO registers offsets. 3952 * The register themselves are currently all part of group 1 (saved above). 3953 * We save these to ensure they're located where the code expects them while loading state. 3954 */ 3955 pHlp->pfnSSMPutU16(pSSM, DMAR_MMIO_OFF_IMPL_COUNT); 3956 AssertCompile(DMAR_MMIO_OFF_IMPL_COUNT == 4); 3957 pHlp->pfnSSMPutU16(pSSM, DMAR_MMIO_OFF_IVA_REG); 3958 pHlp->pfnSSMPutU16(pSSM, DMAR_MMIO_OFF_IOTLB_REG); 3959 pHlp->pfnSSMPutU16(pSSM, DMAR_MMIO_OFF_FRCD_LO_REG); 3960 pHlp->pfnSSMPutU16(pSSM, DMAR_MMIO_OFF_FRCD_HI_REG); 3961 3947 3962 /* Save lazily activated registers. */ 3948 3963 pHlp->pfnSSMPutU64(pSSM, pThis->uIrtaReg); … … 3982 3997 { 3983 3998 /* VER_REG */ 3984 uint32_t uVerReg ;3999 uint32_t uVerReg = 0; 3985 4000 int rc = pHlp->pfnSSMGetU32(pSSM, &uVerReg); 3986 4001 AssertRCReturn(rc, rc); … … 3989 4004 rcDataErr); 3990 4005 /* CAP_REG */ 3991 uint64_t fCapReg ;4006 uint64_t fCapReg = 0; 3992 4007 pHlp->pfnSSMGetU64(pSSM, &fCapReg); 3993 4008 AssertLogRelMsgReturn(fCapReg == pThis->fCapReg, … … 3995 4010 rcDataErr); 3996 4011 /* ECAP_REG */ 3997 uint64_t fExtCapReg ;4012 uint64_t fExtCapReg = 0; 3998 4013 pHlp->pfnSSMGetU64(pSSM, &fExtCapReg); 3999 4014 AssertLogRelMsgReturn(fExtCapReg == pThis->fExtCapReg, … … 4007 4022 { 4008 4023 /* Group count. */ 4009 uint32_t cRegGroups ;4024 uint32_t cRegGroups = 0; 4010 4025 pHlp->pfnSSMGetU32(pSSM, &cRegGroups); 4011 4026 AssertLogRelMsgReturn(cRegGroups == DMAR_MMIO_GROUP_COUNT, … … 4013 4028 cRegGroups), rcFmtErr); 4014 4029 /* Group 0. */ 4015 uint32_t cbRegs0 ;4030 uint32_t cbRegs0 = 0; 4016 4031 pHlp->pfnSSMGetU32(pSSM, &cbRegs0); 4017 4032 AssertLogRelMsgReturn(cbRegs0 == sizeof(pThis->abRegs0), … … 4020 4035 pHlp->pfnSSMGetMem(pSSM, &pThis->abRegs0[0], cbRegs0); 4021 4036 /* Group 1. */ 4022 uint32_t cbRegs1 ;4037 uint32_t cbRegs1 = 0; 4023 4038 pHlp->pfnSSMGetU32(pSSM, &cbRegs1); 4024 4039 AssertLogRelMsgReturn(cbRegs1 == sizeof(pThis->abRegs1), … … 4026 4041 cbRegs1), rcFmtErr); 4027 4042 pHlp->pfnSSMGetMem(pSSM, &pThis->abRegs1[0], cbRegs1); 4043 } 4044 4045 /* 4046 * Validate implementation-defined MMIO register offsets. 4047 */ 4048 { 4049 /* Offset count. */ 4050 uint16_t cOffsets = 0; 4051 pHlp->pfnSSMGetU16(pSSM, &cOffsets); 4052 AssertLogRelMsgReturn(cOffsets == DMAR_MMIO_OFF_IMPL_COUNT, 4053 ("%s: MMIO offset count mismatch (expected %u got %u)\n", DMAR_LOG_PFX, DMAR_MMIO_OFF_IMPL_COUNT, 4054 cOffsets), rcFmtErr); 4055 /* IVA_REG. */ 4056 uint16_t offReg = 0; 4057 pHlp->pfnSSMGetU16(pSSM, &offReg); 4058 AssertLogRelMsgReturn(offReg == DMAR_MMIO_OFF_IVA_REG, 4059 ("%s: IVA_REG offset mismatch (expected %u got %u)\n", DMAR_LOG_PFX, DMAR_MMIO_OFF_IVA_REG, 4060 offReg), rcFmtErr); 4061 /* IOTLB_REG. */ 4062 pHlp->pfnSSMGetU16(pSSM, &offReg); 4063 AssertLogRelMsgReturn(offReg == DMAR_MMIO_OFF_IOTLB_REG, 4064 ("%s: IOTLB_REG offset mismatch (expected %u got %u)\n", DMAR_LOG_PFX, DMAR_MMIO_OFF_IOTLB_REG, 4065 offReg), rcFmtErr); 4066 /* FRCD_LO_REG. */ 4067 pHlp->pfnSSMGetU16(pSSM, &offReg); 4068 AssertLogRelMsgReturn(offReg == DMAR_MMIO_OFF_FRCD_LO_REG, 4069 ("%s: FRCD_LO_REG offset mismatch (expected %u got %u)\n", DMAR_LOG_PFX, DMAR_MMIO_OFF_FRCD_LO_REG, 4070 offReg), rcFmtErr); 4071 /* FRCD_HI_REG. */ 4072 pHlp->pfnSSMGetU16(pSSM, &offReg); 4073 AssertLogRelMsgReturn(offReg == DMAR_MMIO_OFF_FRCD_HI_REG, 4074 ("%s: FRCD_HI_REG offset mismatch (expected %u got %u)\n", DMAR_LOG_PFX, DMAR_MMIO_OFF_FRCD_HI_REG, 4075 offReg), rcFmtErr); 4028 4076 } 4029 4077 … … 4046 4094 */ 4047 4095 { 4048 uint32_t uEndMarker ;4096 uint32_t uEndMarker = 0; 4049 4097 int const rc = pHlp->pfnSSMGetU32(pSSM, &uEndMarker); 4050 4098 AssertRCReturn(rc, rc);
Note:
See TracChangeset
for help on using the changeset viewer.