- Timestamp:
- Oct 7, 2015 1:28:38 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/Bus
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r57781 r58091 921 921 uNew = INVALID_PCI_ADDRESS; 922 922 } 923 //LogRel(("PCI: config dev %u/%u BAR%i uOld=%#018llx uNew=%#018llx size=%llu\n", pDev->devfn >> 3, pDev->devfn & 7, iRegion, pRegion->addr, uNew, pRegion->size));923 LogRel2(("PCI: config dev %u/%u BAR%i uOld=%#018llx uNew=%#018llx size=%llu\n", pDev->devfn >> 3, pDev->devfn & 7, iRegion, pRegion->addr, uNew, pRegion->size)); 924 924 /* now do the real mapping */ 925 925 if (uNew != pRegion->addr) -
trunk/src/VBox/Devices/Bus/MsiCommon.cpp
r56292 r58091 25 25 #include "MsiCommon.h" 26 26 27 /** @todo: use accessors so that raw PCI devices work correctly with MSI. */28 27 DECLINLINE(uint16_t) msiGetMessageControl(PPCIDEVICE pDev) 29 28 { 30 return PCIDevGetWord(pDev, pDev->Int.s.u8MsiCapOffset + VBOX_MSI_CAP_MESSAGE_CONTROL); 29 uint32_t idxMessageControl = pDev->Int.s.u8MsiCapOffset + VBOX_MSI_CAP_MESSAGE_CONTROL; 30 #ifdef IN_RING3 31 if (pciDevIsPassthrough(pDev)) { 32 return pDev->Int.s.pfnConfigRead(pDev, idxMessageControl, 2); 33 } 34 #endif 35 return PCIDevGetWord(pDev, idxMessageControl); 31 36 } 32 37 … … 39 44 { 40 45 uint8_t iOff = msiIs64Bit(pDev) ? VBOX_MSI_CAP_MASK_BITS_64 : VBOX_MSI_CAP_MASK_BITS_32; 46 /* passthrough devices may have no masked/pending support */ 47 if (iOff >= pDev->Int.s.u8MsiCapSize) 48 return NULL; 41 49 iOff += pDev->Int.s.u8MsiCapOffset; 42 50 return (uint32_t*)(pDev->config + iOff); … … 46 54 { 47 55 uint8_t iOff = msiIs64Bit(pDev) ? VBOX_MSI_CAP_PENDING_BITS_64 : VBOX_MSI_CAP_PENDING_BITS_32; 56 /* passthrough devices may have no masked/pending support */ 57 if (iOff >= pDev->Int.s.u8MsiCapSize) 58 return NULL; 48 59 iOff += pDev->Int.s.u8MsiCapOffset; 49 60 return (uint32_t*)(pDev->config + iOff); … … 220 231 return VINF_SUCCESS; 221 232 222 /* We cannot init MSI on raw devices yet. */ 223 Assert(!pciDevIsPassthrough(pDev)); 233 /* XXX: done in pcirawAnalyzePciCaps() */ 234 if (pciDevIsPassthrough(pDev)) 235 return VINF_SUCCESS; 224 236 225 237 uint16_t cVectors = pMsiReg->cMsiVectors; … … 276 288 AssertMsg(msiIsEnabled(pDev), ("Must be enabled to use that")); 277 289 278 uint32_t uMask = *msiGetMaskBits(pDev); 279 uint32_t* puPending = msiGetPendingBits(pDev); 280 281 LogFlow(("MsiNotify: %d pending=%x mask=%x\n", iVector, *puPending, uMask)); 290 uint32_t uMask; 291 uint32_t *puPending = msiGetPendingBits(pDev); 292 if (puPending) 293 { 294 uint32_t *puMask = msiGetMaskBits(pDev); 295 AssertPtr(puMask); 296 uMask = *puMask; 297 LogFlow(("MsiNotify: %d pending=%x mask=%x\n", iVector, *puPending, uMask)); 298 } 299 else 300 { 301 uMask = 0; 302 LogFlow(("MsiNotify: %d\n", iVector)); 303 } 282 304 283 305 /* We only trigger MSI on level up */ … … 286 308 /* @todo: maybe clear pending interrupts on level down? */ 287 309 #if 0 288 *puPending &= ~(1<<iVector); 289 LogFlow(("msi: clear pending %d, now %x\n", iVector, *puPending)); 310 if (puPending) 311 { 312 *puPending &= ~(1<<iVector); 313 LogFlow(("msi: clear pending %d, now %x\n", iVector, *puPending)); 314 } 290 315 #endif 291 316 return; … … 302 327 uint32_t u32Value = msiGetMsiData(pDev, iVector); 303 328 304 *puPending &= ~(1<<iVector); 329 if (puPending) 330 *puPending &= ~(1<<iVector); 305 331 306 332 Assert(pPciHlp->pfnIoApicSendMsi != NULL);
Note:
See TracChangeset
for help on using the changeset viewer.