Changeset 86145 in vbox for trunk/src/VBox
- Timestamp:
- Sep 17, 2020 10:31:47 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r86132 r86145 926 926 iommuAmdCmdThreadWakeUpIfNeeded(pDevIns); 927 927 928 Log FlowFunc(("Set CmdBufHeadPtr to %#RX32\n", offBuf));928 Log5Func(("Set CmdBufHeadPtr to %#RX32\n", offBuf)); 929 929 return VINF_SUCCESS; 930 930 } … … 967 967 iommuAmdCmdThreadWakeUpIfNeeded(pDevIns); 968 968 969 Log FlowFunc(("Set CmdBufTailPtr to %#RX32\n", offBuf));969 Log5Func(("Set CmdBufTailPtr to %#RX32\n", offBuf)); 970 970 return VINF_SUCCESS; 971 971 } … … 1104 1104 Assert(!(off & (cb - 1))); 1105 1105 1106 Log FlowFunc(("off=%#x cb=%u uValue=%#RX64\n", off, cb, uValue));1106 Log5Func(("off=%#x cb=%u uValue=%#RX64\n", off, cb, uValue)); 1107 1107 1108 1108 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); … … 1251 1251 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); 1252 1252 1253 Log FlowFunc(("off=%#x\n", off));1253 Log5Func(("off=%#x\n", off)); 1254 1254 1255 1255 /** @todo IOMMU: fine-grained locking? */ … … 1410 1410 static void iommuAmdRaiseMsiInterrupt(PPDMDEVINS pDevIns) 1411 1411 { 1412 LogFlowFunc(("\n")); 1412 1413 if (iommuAmdIsMsiEnabled(pDevIns)) 1414 { 1415 LogFunc(("Raising MSI\n")); 1413 1416 PDMDevHlpPCISetIrq(pDevIns, 0, PDM_IRQ_LEVEL_HIGH); 1417 } 1414 1418 } 1415 1419 … … 3042 3046 { 3043 3047 Assert(EvtError.n.u4EvtCode == IOMMU_EVT_COMMAND_HW_ERROR); 3048 LogFunc(("Raising command hardware error. Cmd=%#x -> COMMAND_HW_ERROR\n", Cmd.n.u4Opcode)); 3044 3049 iommuAmdRaiseCmdHwErrorEvent(pDevIns, (PCEVT_CMD_HW_ERR_T)&EvtError); 3045 3050 } … … 3049 3054 else 3050 3055 { 3056 LogFunc(("Failed to read command at %#RGp. rc=%Rrc -> COMMAND_HW_ERROR\n", GCPhysCmd, rc)); 3051 3057 EVT_CMD_HW_ERR_T EvtCmdHwErr; 3052 3058 iommuAmdInitCmdHwErrorEvent(GCPhysCmd, &EvtCmdHwErr); … … 3089 3095 /** @todo IOMMU: PCI config read stat counter. */ 3090 3096 VBOXSTRICTRC rcStrict = PDMDevHlpPCIConfigRead(pDevIns, pPciDev, uAddress, cb, pu32Value); 3091 Log3Func(("Reading PCI config register %#x (cb=%u) -> %#x %Rrc\n", uAddress, cb, *pu32Value, 3092 VBOXSTRICTRC_VAL(rcStrict))); 3097 Log3Func(("uAddress=%#x (cb=%u) -> %#x. rc=%Rrc\n", uAddress, cb, *pu32Value, VBOXSTRICTRC_VAL(rcStrict))); 3093 3098 return rcStrict; 3094 3099 } … … 3122 3127 IOMMU_LOCK(pDevIns); 3123 3128 3124 VBOXSTRICTRC rcStrict = VERR_I NVALID_FUNCTION;3129 VBOXSTRICTRC rcStrict = VERR_IOMMU_IPE_3; 3125 3130 switch (uAddress) 3126 3131 { … … 3137 3142 if (pThis->IommuBar.n.u1Enable) 3138 3143 { 3139 Assert(pThis->hMmio != NIL_IOMMMIOHANDLE); 3140 Assert(PDMDevHlpMmioGetMappingAddress(pDevIns, pThis->hMmio) == NIL_RTGCPHYS); 3144 Assert(pThis->hMmio != NIL_IOMMMIOHANDLE); /* Paranoia. Ensure we have a valid IOM MMIO handle. */ 3141 3145 Assert(!pThis->ExtFeat.n.u1PerfCounterSup); /* Base is 16K aligned when performance counters aren't supported. */ 3142 RTGCPHYS const GCPhysMmioBase = RT_MAKE_U64(pThis->IommuBar.au32[0] & 0xffffc000, pThis->IommuBar.au32[1]); 3146 RTGCPHYS const GCPhysMmioBase = RT_MAKE_U64(pThis->IommuBar.au32[0] & 0xffffc000, pThis->IommuBar.au32[1]); 3147 RTGCPHYS const GCPhysMmioBasePrev = PDMDevHlpMmioGetMappingAddress(pDevIns, pThis->hMmio); 3148 3149 /* If the MMIO region is already mapped at the specified address, we're done. */ 3150 Assert(GCPhysMmioBase != NIL_RTGCPHYS); 3151 if (GCPhysMmioBasePrev == GCPhysMmioBase) 3152 { 3153 rcStrict = VINF_SUCCESS; 3154 break; 3155 } 3156 3157 /* Unmap the previous MMIO region (which is at a different address). */ 3158 if (GCPhysMmioBasePrev != NIL_RTGCPHYS) 3159 { 3160 LogFlowFunc(("Unmapping previous MMIO region at %#RGp\n", GCPhysMmioBasePrev)); 3161 rcStrict = PDMDevHlpMmioUnmap(pDevIns, pThis->hMmio); 3162 if (RT_FAILURE(rcStrict)) 3163 { 3164 LogFunc(("Failed to unmap MMIO region at %#RGp. rc=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict))); 3165 break; 3166 } 3167 } 3168 3169 /* Map the newly specified MMIO region. */ 3170 LogFlowFunc(("Mapping MMIO region at %#RGp\n", GCPhysMmioBase)); 3143 3171 rcStrict = PDMDevHlpMmioMap(pDevIns, pThis->hMmio, GCPhysMmioBase); 3144 3172 if (RT_FAILURE(rcStrict)) 3145 LogFunc(("Failed to map IOMMU MMIO region at %#RGp. rc=%Rrc\n", GCPhysMmioBase, rcStrict)); 3173 { 3174 LogFunc(("Failed to unmap MMIO region at %#RGp. rc=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict))); 3175 break; 3176 } 3146 3177 } 3178 else 3179 rcStrict = VINF_SUCCESS; 3147 3180 break; 3148 3181 } … … 3174 3207 IOMMU_UNLOCK(pDevIns); 3175 3208 3176 Log3Func((" PCI config write: %#x -> To %#x (%u) %Rrc\n", u32Value, uAddress, cb, VBOXSTRICTRC_VAL(rcStrict)));3209 Log3Func(("uAddress=%#x (cb=%u) with %#x. rc=%Rrc\n", uAddress, cb, u32Value, VBOXSTRICTRC_VAL(rcStrict))); 3177 3210 return rcStrict; 3178 3211 } … … 3950 3983 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); 3951 3984 3985 IOMMU_LOCK_NORET(pDevIns); 3986 3952 3987 LogFlowFunc(("\n")); 3953 3988 … … 4015 4050 pThis->PprLogBOverflowEarly.u64 = 0; 4016 4051 4052 pThis->IommuBar.u64 = 0; 4017 4053 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_BASE_ADDR_REG_LO, 0); 4018 4054 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_BASE_ADDR_REG_HI, 0); 4019 4055 4020 /* 4021 * I ASSUME all MMIO regions mapped by a PDM device are automatically unmapped 4022 * on VM reset. If not, we need to enable the following... 4023 */ 4024 #if 0 4025 /* Unmap the MMIO region on reset if it has been mapped previously. */ 4026 Assert(pThis->hMmio != NIL_IOMMMIOHANDLE); 4027 if (PDMDevHlpMmioGetMappingAddress(pDevIns, pThis->hMmio) != NIL_RTGCPHYS) 4028 PDMDevHlpMmioUnmap(pDevIns, pThis->hMmio); 4029 #endif 4056 PDMPciDevSetCommand(pPciDev, VBOX_PCI_COMMAND_MASTER); 4057 4058 IOMMU_UNLOCK(pDevIns); 4030 4059 } 4031 4060 … … 4095 4124 PDMPciDevSetVendorId(pPciDev, IOMMU_PCI_VENDOR_ID); /* AMD */ 4096 4125 PDMPciDevSetDeviceId(pPciDev, IOMMU_PCI_DEVICE_ID); /* VirtualBox IOMMU device */ 4097 PDMPciDevSetCommand(pPciDev, VBOX_PCI_COMMAND_MASTER); /* Enable bus master (as we write tomain memory) */4126 PDMPciDevSetCommand(pPciDev, VBOX_PCI_COMMAND_MASTER); /* Enable bus master (as we directly access main memory) */ 4098 4127 PDMPciDevSetStatus(pPciDev, VBOX_PCI_STATUS_CAP_LIST); /* Capability list supported */ 4099 4128 PDMPciDevSetRevisionId(pPciDev, IOMMU_PCI_REVISION_ID); /* VirtualBox specific device implementation revision */
Note:
See TracChangeset
for help on using the changeset viewer.