VirtualBox

Changeset 67668 in vbox


Ignore:
Timestamp:
Jun 28, 2017 4:28:34 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116476
Message:

PDM: rip out the entire FakePCIBIOS support, no longer triggered from here
Devices/Bus: register magic port to trigger FakePCIBIOS
BIOS: disable the unneeded function for PCI resource/IRQ initialization (only partially used anyway) and use the magic port to trigger FakePCIBIOS

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/include/VBox/vmm/pdmdev.h

    r66270 r67668  
    610610    DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc));
    611611
    612     /**
    613      * Called to perform the job of the bios.
    614      *
    615      * This is only called for the first PCI Bus - it is expected to
    616      * service all the PCI buses.
    617      *
    618      * @returns VBox status.
    619      * @param   pDevIns     Device instance of the first bus.
    620      * @remarks Caller enters the PDM critical section.
    621      */
    622     DECLR3CALLBACKMEMBER(int, pfnFakePCIBIOSR3,(PPDMDEVINS pDevIns));
    623 
    624612    /** The name of the SetIrq RC entry point. */
    625613    const char         *pszSetIrqRC;
     
    633621
    634622/** Current PDMPCIBUSREG version number. */
    635 #define PDM_PCIBUSREG_VERSION                   PDM_VERSION_MAKE(0xfffe, 6, 0)
     623#define PDM_PCIBUSREG_VERSION                   PDM_VERSION_MAKE(0xfffe, 7, 0)
    636624
    637625/**
  • TabularUnified trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r67583 r67668  
    116116    uint32_t config_addr;
    117117
    118     Log(("pci_data_write: addr=%08x val=%08x len=%d\n", pGlobals->uConfigReg, val, len));
     118    LogFunc(("addr=%08x val=%08x len=%d\n", pGlobals->uConfigReg, val, len));
    119119
    120120    if (!(pGlobals->uConfigReg & (1 << 31))) {
     
    150150        {
    151151#ifdef IN_RING3
    152             Log(("pci_config_write: %s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, val, len));
     152            LogFunc(("%s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, val, len));
    153153            pci_dev->Int.s.pfnConfigWrite(pci_dev->Int.s.CTX_SUFF(pDevIns), pci_dev, config_addr, val, len);
    154154#else
     
    198198#ifdef IN_RING3
    199199            *pu32 = pci_dev->Int.s.pfnConfigRead(pci_dev->Int.s.CTX_SUFF(pDevIns), pci_dev, config_addr, len);
    200             Log(("pci_config_read: %s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, *pu32, len));
     200            LogFunc(("%s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, *pu32, len));
    201201#else
    202202            NOREF(len);
     
    249249        apic_irq = irq_num + 0x10;
    250250        apic_level = get_pci_irq_apic_level(pGlobals, irq_num);
    251         Log3(("apic_set_irq: %s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d\n",
     251        Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d\n",
    252252              R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num));
    253253        pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc);
     
    257257            pPciDev->Int.s.uIrqPinState = PDM_IRQ_LEVEL_LOW;
    258258            apic_level = get_pci_irq_apic_level(pGlobals, irq_num);
    259             Log3(("apic_set_irq: %s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d (flop)\n",
     259            Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d (flop)\n",
    260260                  R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num));
    261261            pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc);
    262262        }
    263263    } else {
    264         Log3(("apic_set_irq: %s: irq_num1=%d level=%d iAcpiIrq=%d\n",
     264        Log3Func(("%s: irq_num1=%d level=%d iAcpiIrq=%d\n",
    265265              R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iAcpiIrq));
    266266        pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), iAcpiIrq, iLevel, uTagSrc);
     
    288288static void pciSetIrqInternal(PDEVPCIROOT pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
    289289{
    290     PDEVPCIBUS     pBus =    &pGlobals->PciBus;
     290    PDEVPCIBUS  pBus = &pGlobals->PciBus;
    291291    uint8_t    *pbCfg = pGlobals->Piix3.PIIX3State.dev.abConfig;
    292292    const bool  fIsAcpiDevice = pPciDev->abConfig[2] == 0x13 && pPciDev->abConfig[3] == 0x71;
     
    364364            pic_level |= pGlobals->Piix3.iAcpiIrqLevel;
    365365
    366         Log3(("pciSetIrq: %s: iLevel=%d iIrq=%d pic_irq=%d pic_level=%d uTagSrc=%#x\n",
     366        Log3Func(("%s: iLevel=%d iIrq=%d pic_irq=%d pic_level=%d uTagSrc=%#x\n",
    367367              R3STRING(pPciDev->pszNameR3), iLevel, iIrq, pic_irq, pic_level, uTagSrc));
    368368        pBus->CTX_SUFF(pPciHlp)->pfnIsaSetIrq(pBus->CTX_SUFF(pDevIns), pic_irq, pic_level, uTagSrc);
     
    617617                if ((pGlobals->uPciBiosIo % _4K) != 0)
    618618                    pGlobals->uPciBiosIo = RT_ALIGN_32(pGlobals->uPciBiosIo, _4K);
    619                 Log(("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosIo));
     619                LogFunc(("Aligned I/O start address. New address %#x\n", pGlobals->uPciBiosIo));
    620620                pci_config_writeb(pGlobals, uBus, uDevFn, VBOX_PCI_IO_BASE, (pGlobals->uPciBiosIo >> 8) & 0xf0);
    621621
     
    623623                if ((pGlobals->uPciBiosMmio % _1M) != 0)
    624624                    pGlobals->uPciBiosMmio = RT_ALIGN_32(pGlobals->uPciBiosMmio, _1M);
    625                 Log(("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosMmio));
     625                LogFunc(("Aligned MMIO start address. New address %#x\n", pGlobals->uPciBiosMmio));
    626626                pci_config_writew(pGlobals, uBus, uDevFn, VBOX_PCI_MEMORY_BASE, (pGlobals->uPciBiosMmio >> 16) & UINT32_C(0xffff0));
    627627
     
    705705                        u32Size = (~u32Size) + 1;
    706706
    707                     Log2(("%s: Size of region %u for device %d on bus %d is %u\n", __FUNCTION__, i, uDevFn, uBus, u32Size));
     707                    Log2Func(("Size of region %u for device %d on bus %d is %u\n", i, uDevFn, uBus, u32Size));
    708708
    709709                    if (u32Size)
     
    727727                        else
    728728                        {
    729                             Log(("%s: Start address of %s region %u is %#x\n", __FUNCTION__, (fIsPio ? "I/O" : "MMIO"), i, uNew));
     729                            LogFunc(("%s: Start address of %s region %u is %#x\n", (fIsPio ? "I/O" : "MMIO"), i, uNew));
    730730                            pci_set_io_region_addr(pGlobals, uBus, uDevFn, i, uNew);
    731731                            if (fIsPio)
     
    734734                                fActiveMemRegion = true;
    735735                            *paddr = uNew + u32Size;
    736                             Log2(("%s: New address is %#x\n", __FUNCTION__, *paddr));
     736                            Log2Func(("New address is %#x\n", *paddr));
    737737                        }
    738738                    }
     
    772772}
    773773
     774/**
     775 * Worker for Fake PCI BIOS config, triggered by magic port access by BIOS.
     776 *
     777 * @returns VBox status code.
     778 *
     779 * @param   pDevIns     i440FX device instance.
     780 */
     781static int pciR3FakePCIBIOS(PPDMDEVINS pDevIns)
     782{
     783    unsigned        i;
     784    uint8_t         elcr[2]    = {0, 0};
     785    PDEVPCIROOT     pGlobals   = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     786    PVM             pVM        = PDMDevHlpGetVM(pDevIns); Assert(pVM);
     787    PVMCPU          pVCpu      = PDMDevHlpGetVMCPU(pDevIns); Assert(pVM);
     788    uint32_t const  cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM);
     789    uint64_t const  cbAbove4GB = MMR3PhysGetRamSizeAbove4GB(pVM);
     790    RT_NOREF(cbBelow4GB, cbAbove4GB);
     791
     792    LogRel(("PCI: setting up resources and interrupts\n"));
     793
     794    /*
     795     * Set the start addresses.
     796     */
     797    pGlobals->uPciBiosBus  = 0;
     798    pGlobals->uPciBiosIo   = 0xd000;
     799    pGlobals->uPciBiosMmio = UINT32_C(0xf0000000);
     800
     801    /*
     802     * Activate IRQ mappings.
     803     */
     804    for (i = 0; i < 4; i++)
     805    {
     806        uint8_t irq = pci_irqs[i];
     807        /* Set to trigger level. */
     808        elcr[irq >> 3] |= (1 << (irq & 7));
     809        /* Activate irq remapping in PIIX3. */
     810        pci_config_writeb(pGlobals, 0, pGlobals->Piix3.PIIX3State.dev.uDevFn, 0x60 + i, irq);
     811    }
     812
     813    /* Tell to the PIC. */
     814    VBOXSTRICTRC rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d0, elcr[0], sizeof(uint8_t));
     815    if (rcStrict == VINF_SUCCESS)
     816        rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d1, elcr[1], sizeof(uint8_t));
     817    if (rcStrict != VINF_SUCCESS)
     818    {
     819        AssertMsgFailed(("Writing to PIC failed! rcStrict=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
     820        return RT_SUCCESS(rcStrict) ? VERR_INTERNAL_ERROR : VBOXSTRICTRC_VAL(rcStrict);
     821    }
     822
     823    /*
     824     * Init the devices.
     825     */
     826    for (i = 0; i < 256; i++)
     827    {
     828        uint8_t aBridgePositions[256];
     829
     830        memset(aBridgePositions, 0, sizeof(aBridgePositions));
     831        Log2(("PCI: Initializing device %d (%#x)\n",
     832              i, 0x80000000 | (i << 8)));
     833        pci_bios_init_device(pGlobals, 0, i, 0, aBridgePositions);
     834    }
     835
     836    return VINF_SUCCESS;
     837}
     838
    774839#endif /* IN_RING3 */
    775840
     
    782847PDMBOTHCBDECL(int) pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    783848{
    784     Log(("pciIOPortAddressWrite: Port=%#x u32=%#x cb=%d\n", Port, u32, cb));
     849    LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb));
    785850    RT_NOREF2(Port, pvUser);
    786851    if (cb == 4)
     
    809874        *pu32 = pThis->uConfigReg;
    810875        PCI_UNLOCK(pDevIns);
    811         Log(("pciIOPortAddressRead: Port=%#x cb=%d -> %#x\n", Port, cb, *pu32));
     876        LogFunc(("Port=%#x cb=%d -> %#x\n", Port, cb, *pu32));
    812877        return VINF_SUCCESS;
    813878    }
    814879    /* else: 440FX does "pass through to the bus" for other writes, what ever that means.
    815880     * Linux probes for cmd640 using byte writes/reads during ide init. We'll just ignore it. */
    816     Log(("pciIOPortAddressRead: Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", Port, cb));
     881    LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", Port, cb));
    817882    return VERR_IOM_IOPORT_UNUSED;
    818883}
     
    824889PDMBOTHCBDECL(int) pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    825890{
    826     Log(("pciIOPortDataWrite: Port=%#x u32=%#x cb=%d\n", Port, u32, cb));
     891    LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb));
    827892    NOREF(pvUser);
    828893    int rc = VINF_SUCCESS;
     
    850915        int rc = pci_data_read(PDMINS_2_DATA(pDevIns, PDEVPCIROOT), Port, cb, pu32);
    851916        PCI_UNLOCK(pDevIns);
    852         Log(("pciIOPortDataRead: Port=%#x cb=%#x -> %#x (%Rrc)\n", Port, cb, *pu32, rc));
     917        LogFunc(("Port=%#x cb=%#x -> %#x (%Rrc)\n", Port, cb, *pu32, rc));
    853918        return rc;
    854919    }
     
    858923
    859924#ifdef IN_RING3
     925
     926/**
     927 * @callback_method_impl{FNIOMIOPORTOUT, PCI data}
     928 */
     929DECLCALLBACK(int) pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
     930{
     931    RT_NOREF2(pvUser, Port);
     932    LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb));
     933    if (cb == 4)
     934    {
     935        if (u32 == UINT32_C(19200509)) // Richard Adams
     936        {
     937            int rc = pciR3FakePCIBIOS(pDevIns);
     938            AssertRC(rc);
     939        }
     940    }
     941
     942    return VINF_SUCCESS;
     943}
     944
     945/**
     946 * @callback_method_impl{FNIOMIOPORTIN, PCI data}
     947 */
     948DECLCALLBACK(int) pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
     949{
     950    RT_NOREF5(pDevIns, pvUser, Port, pu32, cb);
     951    LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", Port, cb));
     952    return VERR_IOM_IOPORT_UNUSED;
     953}
     954
    860955
    861956/*
     
    10771172{
    10781173    PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    1079     PDEVPCIBUS     pBus  = &pThis->PciBus;
     1174    PDEVPCIBUS  pBus  = &pThis->PciBus;
    10801175    uint32_t    u32;
    10811176    int         rc;
     
    11221217
    11231218/* -=-=-=-=-=- PCI Bus Interface Methods (PDMPCIBUSREG) -=-=-=-=-=- */
    1124 
    1125 /**
    1126  * @interface_method_impl{PDMPCIBUSREG,pfnFakePCIBIOSR3}
    1127  */
    1128 static DECLCALLBACK(int) pciR3FakePCIBIOS(PPDMDEVINS pDevIns)
    1129 {
    1130     unsigned        i;
    1131     uint8_t         elcr[2]    = {0, 0};
    1132     PDEVPCIROOT     pGlobals   = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    1133     PVM             pVM        = PDMDevHlpGetVM(pDevIns); Assert(pVM);
    1134     PVMCPU          pVCpu      = PDMDevHlpGetVMCPU(pDevIns); Assert(pVM);
    1135     uint32_t const  cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM);
    1136     uint64_t const  cbAbove4GB = MMR3PhysGetRamSizeAbove4GB(pVM);
    1137     RT_NOREF(cbBelow4GB, cbAbove4GB);
    1138 
    1139     /*
    1140      * Set the start addresses.
    1141      */
    1142     pGlobals->uPciBiosBus  = 0;
    1143     pGlobals->uPciBiosIo   = 0xd000;
    1144     pGlobals->uPciBiosMmio = UINT32_C(0xf0000000);
    1145 
    1146     /*
    1147      * Activate IRQ mappings.
    1148      */
    1149     for (i = 0; i < 4; i++)
    1150     {
    1151         uint8_t irq = pci_irqs[i];
    1152         /* Set to trigger level. */
    1153         elcr[irq >> 3] |= (1 << (irq & 7));
    1154         /* Activate irq remapping in PIIX3. */
    1155         pci_config_writeb(pGlobals, 0, pGlobals->Piix3.PIIX3State.dev.uDevFn, 0x60 + i, irq);
    1156     }
    1157 
    1158     /* Tell to the PIC. */
    1159     VBOXSTRICTRC rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d0, elcr[0], sizeof(uint8_t));
    1160     if (rcStrict == VINF_SUCCESS)
    1161         rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d1, elcr[1], sizeof(uint8_t));
    1162     if (rcStrict != VINF_SUCCESS)
    1163     {
    1164         AssertMsgFailed(("Writing to PIC failed! rcStrict=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
    1165         return RT_SUCCESS(rcStrict) ? VERR_INTERNAL_ERROR : VBOXSTRICTRC_VAL(rcStrict);
    1166     }
    1167 
    1168     /*
    1169      * Init the devices.
    1170      */
    1171     for (i = 0; i < 256; i++)
    1172     {
    1173         uint8_t aBridgePositions[256];
    1174 
    1175         memset(aBridgePositions, 0, sizeof(aBridgePositions));
    1176         Log2(("PCI: Initializing device %d (%#x)\n",
    1177               i, 0x80000000 | (i << 8)));
    1178         pci_bios_init_device(pGlobals, 0, i, 0, aBridgePositions);
    1179     }
    1180 
    1181     return VINF_SUCCESS;
    1182 }
    11831219
    11841220
     
    12751311
    12761312    PDMPCIBUSREG PciBusReg;
    1277     PDEVPCIBUS      pBus = &pGlobals->PciBus;
     1313    PDEVPCIBUS   pBus = &pGlobals->PciBus;
    12781314    PciBusReg.u32Version              = PDM_PCIBUSREG_VERSION;
    12791315    PciBusReg.pfnRegisterR3           = pciR3MergedRegister;
     
    12821318    PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks;
    12831319    PciBusReg.pfnSetIrqR3             = pciSetIrq;
    1284     PciBusReg.pfnFakePCIBIOSR3        = pciR3FakePCIBIOS;
    12851320    PciBusReg.pszSetIrqRC             = fGCEnabled ? "pciSetIrq" : NULL;
    12861321    PciBusReg.pszSetIrqR0             = fR0Enabled ? "pciSetIrq" : NULL;
     
    13611396            return rc;
    13621397    }
     1398
     1399    rc = PDMDevHlpIOPortRegister(pDevIns, 0x0410, 1, NULL, pciR3IOPortMagicPCIWrite, pciR3IOPortMagicPCIRead, NULL, NULL, "i440FX (Fake PCI BIOS trigger)")
     1400;
     1401    if (RT_FAILURE(rc))
     1402        return rc;
     1403
    13631404
    13641405    rc = PDMDevHlpSSMRegisterEx(pDevIns, VBOX_PCI_SAVED_STATE_VERSION, sizeof(*pBus) + 16*128, "pgm",
     
    14671508     * of our parent passing the device which asserted the interrupt instead of the device of the bridge.
    14681509     */
    1469     PDEVPCIBUS    pBus          = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
     1510    PDEVPCIBUS pBus          = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    14701511    PPDMPCIDEV pPciDevBus    = pPciDev;
    14711512    int        iIrqPinBridge = iIrq;
     
    15141555        if (pPciDev)
    15151556        {
    1516             Log(("%s: %s: addr=%02x val=%08x len=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));
     1557            LogFunc(("%s: addr=%02x val=%08x len=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb));
    15171558            pPciDev->Int.s.pfnConfigWrite(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, u32Value, cb);
    15181559        }
     
    15481589        {
    15491590            u32Value = pPciDev->Int.s.pfnConfigRead(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, cb);
    1550             Log(("%s: %s: u32Address=%02x u32Value=%08x cb=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));
     1591            LogFunc(("%s: u32Address=%02x u32Value=%08x cb=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb));
    15511592        }
    15521593    }
     
    16411682    PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks;
    16421683    PciBusReg.pfnSetIrqR3             = pcibridgeSetIrq;
    1643     PciBusReg.pfnFakePCIBIOSR3        = NULL; /* Only needed for the first bus. */
    16441684    PciBusReg.pszSetIrqRC             = fGCEnabled ? "pcibridgeSetIrq" : NULL;
    16451685    PciBusReg.pszSetIrqR0             = fR0Enabled ? "pcibridgeSetIrq" : NULL;
  • TabularUnified trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r67583 r67668  
    9696                                  int iIrq, int iLevel, uint32_t uTagSrc);
    9797#ifdef IN_RING3
     98static int ich9pciFakePCIBIOS(PPDMDEVINS pDevIns);
    9899DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t uBus);
    99100static void ich9pciBiosInitAllDevicesOnBus(PDEVPCIROOT pPciRoot, uint8_t uBus);
     
    155156
    156157
     158#ifdef IN_RING3
     159
    157160/**
    158  * Port I/O Handler for PCI address OUT operations.
    159  *
    160  * Emulates writes to Configuration Address Port at 0CF8h for
    161  * Configuration Mechanism #1.
     161 * Port I/O Handler for Fake PCI BIOS trigger OUT operations at 0410h
    162162 *
    163163 * @returns VBox status code.
     
    169169 * @param   cb          The value size in bytes.
    170170 */
     171DECLCALLBACK(int) ich9pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
     172{
     173    RT_NOREF2(pvUser, uPort);
     174    LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));
     175    if (cb == 4)
     176    {
     177        if (u32 == UINT32_C(19200509)) // Richard Adams
     178        {
     179            int rc = ich9pciFakePCIBIOS(pDevIns);
     180            AssertRC(rc);
     181        }
     182    }
     183
     184    return VINF_SUCCESS;
     185}
     186
     187
     188/**
     189 * Port I/O Handler for Fake PCI BIOS trigger IN operations at 0410h
     190 *
     191 * @returns VBox status code.
     192 *
     193 * @param   pDevIns     ICH9 device instance.
     194 * @param   pvUser      User argument - ignored.
     195 * @param   uPort       Port number used for the IN operation.
     196 * @param   pu32        Where to store the result.
     197 * @param   cb          Number of bytes read.
     198 */
     199DECLCALLBACK(int) ich9pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
     200{
     201    RT_NOREF5(pDevIns, pvUser, uPort, pu32, cb);
     202    LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));
     203    return VERR_IOM_IOPORT_UNUSED;
     204}
     205
     206#endif /* IN_RING3 */
     207
     208
     209/**
     210 * Port I/O Handler for PCI address OUT operations.
     211 *
     212 * Emulates writes to Configuration Address Port at 0CF8h for
     213 * Configuration Mechanism #1.
     214 *
     215 * @returns VBox status code.
     216 *
     217 * @param   pDevIns     ICH9 device instance.
     218 * @param   pvUser      User argument - ignored.
     219 * @param   uPort       Port number used for the OUT operation.
     220 * @param   u32         The value to output.
     221 * @param   cb          The value size in bytes.
     222 */
    171223PDMBOTHCBDECL(int) ich9pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
    172224{
    173     LogFlow(("ich9pciIOPortAddressWrite: Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));
     225    LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));
    174226    RT_NOREF2(uPort, pvUser);
    175227    if (cb == 4)
     
    217269        PCI_UNLOCK(pDevIns);
    218270
    219         LogFlow(("ich9pciIOPortAddressRead: Port=%#x cb=%d -> %#x\n", uPort, cb, *pu32));
     271        LogFlowFunc(("Port=%#x cb=%d -> %#x\n", uPort, cb, *pu32));
    220272        return VINF_SUCCESS;
    221273    }
    222274
    223     Log(("ich9pciIOPortAddressRead: Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));
     275    LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));
    224276    return VERR_IOM_IOPORT_UNUSED;
    225277}
     
    269321    }
    270322
    271     Log2(("ich9pciDataWriteAddr: %02x:%02x.%d reg %x(%d) %x %Rrc\n",
    272           pAddr->iBus, pAddr->iDeviceFunc >> 3, pAddr->iDeviceFunc & 0x7, pAddr->iRegister,
    273           cb, val, rc));
     323    Log2Func(("%02x:%02x.%d reg %x(%d) %x %Rrc\n",
     324              pAddr->iBus, pAddr->iDeviceFunc >> 3, pAddr->iDeviceFunc & 0x7, pAddr->iRegister, cb, val, rc));
    274325    return rc;
    275326}
     
    286337static int ich9pciDataWrite(PDEVPCIROOT pPciRoot, uint32_t addr, uint32_t val, int len)
    287338{
    288     LogFlow(("ich9pciDataWrite: config=%08x val=%08x len=%d\n", pPciRoot->uConfigReg, val, len));
     339    LogFlowFunc(("config=%08x val=%08x len=%d\n", pPciRoot->uConfigReg, val, len));
    289340
    290341    /* Configuration space mapping enabled? */
     
    317368PDMBOTHCBDECL(int) ich9pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
    318369{
    319     LogFlow(("ich9pciIOPortDataWrite: Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));
     370    LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));
    320371    NOREF(pvUser);
    321372    int rc = VINF_SUCCESS;
     
    388439    }
    389440
    390     Log3(("ich9pciDataReadAddr: %02x:%02x.%d reg %x(%d) gave %x %Rrc\n",
    391           pPciAddr->iBus, pPciAddr->iDeviceFunc >> 3, pPciAddr->iDeviceFunc & 0x7, pPciAddr->iRegister,
    392           cb, *pu32, rc));
     441    Log3Func(("%02x:%02x.%d reg %x(%d) gave %x %Rrc\n",
     442              pPciAddr->iBus, pPciAddr->iDeviceFunc >> 3, pPciAddr->iDeviceFunc & 0x7, pPciAddr->iRegister, cb, *pu32, rc));
    393443    return rc;
    394444}
     
    405455static int ich9pciDataRead(PDEVPCIROOT pPciRoot, uint32_t addr, int cb, uint32_t *pu32)
    406456{
    407     LogFlow(("ich9pciDataRead: config=%x cb=%d\n",  pPciRoot->uConfigReg, cb));
     457    LogFlowFunc(("config=%x cb=%d\n",  pPciRoot->uConfigReg, cb));
    408458
    409459    *pu32 = 0xffffffff;
     
    447497        PCI_UNLOCK(pDevIns);
    448498
    449         LogFlow(("ich9pciIOPortDataRead: Port=%#x cb=%#x -> %#x (%Rrc)\n", uPort, cb, *pu32, rc));
     499        LogFlowFunc(("Port=%#x cb=%#x -> %#x (%Rrc)\n", uPort, cb, *pu32, rc));
    450500        return rc;
    451501    }
     
    510560        apic_irq = irq_num + 0x10;
    511561        apic_level = pPciRoot->auPciApicIrqLevels[irq_num] != 0;
    512         Log3(("ich9pciApicSetIrq: %s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x\n",
    513               R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));
     562        Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x\n",
     563                  R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));
    514564        pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc);
    515565
     
    523573            pPciDev->Int.s.uIrqPinState = PDM_IRQ_LEVEL_LOW;
    524574            apic_level = pPciRoot->auPciApicIrqLevels[irq_num] != 0;
    525             Log3(("ich9pciApicSetIrq: %s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x (flop)\n",
    526                   R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));
     575            Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x (flop)\n",
     576                      R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));
    527577            pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc);
    528578        }
    529579    } else {
    530         Log3(("ich9pciApicSetIrq: (forced) %s: irq_num1=%d level=%d acpi_irq=%d uTagSrc=%#x\n",
    531               R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iForcedIrq, uTagSrc));
     580        Log3Func(("(forced) %s: irq_num1=%d level=%d acpi_irq=%d uTagSrc=%#x\n",
     581                  R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iForcedIrq, uTagSrc));
    532582        pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), iForcedIrq, iLevel, uTagSrc);
    533583    }
     
    608658    NOREF(pvUser);
    609659
    610     Log2(("ich9pciMcfgMMIOWrite: %RGp(%d) \n", GCPhysAddr, cb));
     660    Log2Func(("%RGp(%d) \n", GCPhysAddr, cb));
    611661
    612662    PCI_LOCK(pDevIns, VINF_IOM_R3_MMIO_WRITE);
     
    660710    NOREF(pvUser);
    661711
    662     LogFlow(("ich9pciMcfgMMIORead: %RGp(%d) \n", GCPhysAddr, cb));
     712    LogFlowFunc(("%RGp(%d) \n", GCPhysAddr, cb));
    663713
    664714    PCI_LOCK(pDevIns, VINF_IOM_R3_MMIO_READ);
     
    722772        /* safe, only needs to go to the config space array */
    723773        uint32_t uSubordinate = PDMPciDevGetByte(pBridge, VBOX_PCI_SUBORDINATE_BUS);
    724         Log3(("ich9pciFindBridge on bus %p, bridge %d: %d in %d..%d\n", pBus, iBridge, uBus, uSecondary, uSubordinate));
     774        Log3Func(("bus %p, bridge %d: %d in %d..%d\n", pBus, iBridge, uBus, uSecondary, uSubordinate));
    725775        if (uBus >= uSecondary && uBus <= uSubordinate)
    726776            return pBridge;
     
    828878                    VERR_INVALID_PARAMETER);
    829879
    830     Log(("devpciR3CommonIORegionRegister: %s region %d size %RGp type %x\n",
    831          pPciDev->pszNameR3, iRegion, cbRegion, enmType));
     880    LogFunc(("%s region %d size %RGp type %x\n", pPciDev->pszNameR3, iRegion, cbRegion, enmType));
    832881
    833882    /* Make sure that we haven't marked this region as continuation of 64-bit region. */
     
    9791028    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    9801029
    981     LogFlowFunc((": pDevIns=%p uBus=%d uDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, u32Value, cb));
     1030    LogFlowFunc(("pDevIns=%p uBus=%d uDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, u32Value, cb));
    9821031
    9831032    /* If the current bus is not the target bus search for the bus which contains the device. */
     
    9991048        if (pPciDev)
    10001049        {
    1001             Log(("%s: %s: addr=%02x val=%08x len=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));
     1050            LogFunc(("%s: addr=%02x val=%08x len=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb));
    10021051            pPciDev->Int.s.pfnConfigWrite(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, u32Value, cb);
    10031052        }
     
    10101059    uint32_t u32Value;
    10111060
    1012     LogFlowFunc((": pDevIns=%p uBus=%d uDevice=%d u32Address=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, cb));
     1061    LogFlowFunc(("pDevIns=%p uBus=%d uDevice=%d u32Address=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, cb));
    10131062
    10141063    /* If the current bus is not the target bus search for the bus which contains the device. */
     
    10331082        {
    10341083            u32Value = pPciDev->Int.s.pfnConfigRead(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, cb);
    1035             Log(("%s: %s: u32Address=%02x u32Value=%08x cb=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));
     1084            LogFunc(("%s: u32Address=%02x u32Value=%08x cb=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb));
    10361085        }
    10371086        else
     
    15691618    {
    15701619        pPciRoot->uPciBiosIo = RT_ALIGN_32(pPciRoot->uPciBiosIo, _4K);
    1571         Log(("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosIo));
     1620        LogFunc(("Aligned I/O start address. New address %#x\n", pPciRoot->uPciBiosIo));
    15721621    }
    15731622    ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_IO_BASE, (pPciRoot->uPciBiosIo >> 8) & 0xf0, 1);
     
    15771626    {
    15781627        pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M);
    1579         Log(("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosMmio));
     1628        LogFunc(("Aligned MMIO start address. New address %#x\n", pPciRoot->uPciBiosMmio));
    15801629    }
    15811630    ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_MEMORY_BASE, (pPciRoot->uPciBiosMmio >> 16) & UINT32_C(0xffff0), 2);
     
    17171766            cbRegSize64 = cbRegSize32;
    17181767        }
    1719         Log2(("%s: Size of region %u for device %d on bus %d is %lld\n", __FUNCTION__, iRegion, uDevFn, uBus, cbRegSize64));
     1768        Log2Func(("%s: Size of region %u for device %d on bus %d is %lld\n", iRegion, uDevFn, uBus, cbRegSize64));
    17201769
    17211770        if (cbRegSize64)
     
    18221871            cbRegSize64 = cbRegSize32;
    18231872        }
    1824         Log2(("%s: Size of region %u for device %d on bus %d is %lld\n", __FUNCTION__, iRegion, uDevFn, uBus, cbRegSize64));
     1873        Log2Func(("%s: Size of region %u for device %d on bus %d is %lld\n", iRegion, uDevFn, uBus, cbRegSize64));
    18251874
    18261875        if (cbRegSize64)
     
    21852234
    21862235    /* safe, only needs to go to the config space array */
    2187     Log2(("ich9pciBiosInitBridgeTopology: for bus %p: primary=%d secondary=%d subordinate=%d\n",
     2236    Log2Func(("for bus %p: primary=%d secondary=%d subordinate=%d\n",
    21882237          pBus,
    21892238          PDMPciDevGetByte(pBridgeDev, VBOX_PCI_PRIMARY_BUS),
     
    21972246
    21982247/**
    2199  * @interface_method_impl{PDMPCIBUSREG,pfnFakePCIBIOSR3}
    2200  */
    2201 static DECLCALLBACK(int) ich9pciFakePCIBIOS(PPDMDEVINS pDevIns)
     2248 * Worker for Fake PCI BIOS config
     2249 *
     2250 * @returns VBox status code.
     2251 *
     2252 * @param   pDevIns     ICH9 device instance.
     2253 */
     2254static int ich9pciFakePCIBIOS(PPDMDEVINS pDevIns)
    22022255{
    22032256    PDEVPCIROOT     pPciRoot   = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     
    22052258    uint32_t const  cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM);
    22062259    uint64_t const  cbAbove4GB = MMR3PhysGetRamSizeAbove4GB(pVM);
     2260
     2261    LogRel(("PCI: setting up topology, resources and interrupts\n"));
    22072262
    22082263    /** @todo r=klaus this needs to do the same elcr magic as DevPCI.cpp, as the BIOS can't be trusted to do the right thing. Of course it's more difficult than with the old code, as there are bridges to be handled. The interrupt routing needs to be taken into account. Also I highly suspect that the chipset has 8 interrupt lines which we might be able to use for handling things on the root bus better (by treating them as devices on the mainboard). */
     
    22782333        if (   pciDevIsMsiCapable(pPciDev)
    22792334            && uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset < (uint32_t)pPciDev->Int.s.u8MsiCapSize )
    2280             Log2(("devpciR3CommonDefaultConfigRead: MSI CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));
     2335            Log2Func(("MSI CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));
    22812336        else if (   pciDevIsMsixCapable(pPciDev)
    22822337                 && uAddress - (uint32_t)pPciDev->Int.s.u8MsixCapOffset < (uint32_t)pPciDev->Int.s.u8MsixCapSize)
    2283             Log2(("devpciR3CommonDefaultConfigRead: MSI-X CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));
     2338            Log2Func(("MSI-X CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));
    22842339#endif
    22852340    }
     
    24562511{
    24572512    PCIIORegion *pRegion = &pPciDev->Int.s.aIORegions[iRegion];
    2458     Log3(("devpciR3WriteBarByte: region=%d off=%d val=%#x size=%#llx\n", iRegion, off, bVal, pRegion->size));
     2513    Log3Func(("region=%d off=%d val=%#x size=%#llx\n", iRegion, off, bVal, pRegion->size));
    24592514    Assert(off <= 3);
    24602515
     
    24842539        bVal = (bOld & bMask) | (bVal & ~bMask);
    24852540
    2486         Log3(("devpciR3WriteBarByte: %x changed to  %x\n", bOld, bVal));
     2541        Log3Func(("%x changed to  %x\n", bOld, bVal));
    24872542
    24882543        /* safe, only needs to go to the config space array */
     
    30413096    PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks;
    30423097    PciBusReg.pfnSetIrqR3             = ich9pciSetIrq;
    3043     PciBusReg.pfnFakePCIBIOSR3        = ich9pciFakePCIBIOS;
    30443098    PciBusReg.pszSetIrqRC             = fGCEnabled ? "ich9pciSetIrq" : NULL;
    30453099    PciBusReg.pszSetIrqR0             = fR0Enabled ? "ich9pciSetIrq" : NULL;
     
    31143168    }
    31153169
     3170    rc = PDMDevHlpIOPortRegister(pDevIns, 0x0410, 1, NULL, ich9pciR3IOPortMagicPCIWrite, ich9pciR3IOPortMagicPCIRead, NULL, NULL, "ICH9 (Fake PCI BIOS trigger)");
     3171    if (RT_FAILURE(rc))
     3172        return rc;
     3173
    31163174    if (pPciRoot->u64PciConfigMMioAddress != 0)
    31173175    {
     
    32673325static DECLCALLBACK(void) ich9pciReset(PPDMDEVINS pDevIns)
    32683326{
     3327    PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     3328
    32693329    /* Reset everything under the root bridge. */
    32703330    ich9pciResetBridge(pDevIns);
     
    33733433    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    33743434    /** @todo r=klaus figure out how to extend this to allow PCIe config space
    3375      * extension, which increases the config space frorm 256 bytes to 4K. */
     3435     * extension, which increases the config space from 256 bytes to 4K. */
    33763436    pBus->papBridgesR3 = (PPDMPCIDEV *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPDMPCIDEV) * RT_ELEMENTS(pBus->apDevices));
    33773437    AssertLogRelReturn(pBus->papBridgesR3, VERR_NO_MEMORY);
     
    33843444    PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks;
    33853445    PciBusReg.pfnSetIrqR3             = ich9pcibridgeSetIrq;
    3386     PciBusReg.pfnFakePCIBIOSR3        = NULL; /* Only needed for the first bus. */
    33873446    PciBusReg.pszSetIrqRC             = fGCEnabled ? "ich9pcibridgeSetIrq" : NULL;
    33883447    PciBusReg.pszSetIrqR0             = fR0Enabled ? "ich9pcibridgeSetIrq" : NULL;
  • TabularUnified trunk/src/VBox/Devices/PC/BIOS/pcibios.inc

    r60422 r67668  
    9696                push    bp
    9797                mov     bp, sp
     98ifdef VBOX
     99                mov     eax,19200509
     100                mov     dx,410h
     101                out     dx,  eax
     102else
     103; This incomplete PCI resource setup code is less functional than the PCI
     104; resource assignment created by the fake PCI BIOS and is therefore disabled.
     105; Blindly enabling everything on the root bus (including bus mastering!) can
     106; only be called buggy. It causes the trouble with AMD PCNet which it then
     107; tries to work around, but that still contains a race.
    98108                mov     eax, 0E0000000h ; base for memory init
    99109                push    eax
     
    111121                jz      next_pci_dev
    112122
    113 ifndef VBOX ; This currently breaks restoring a previously saved state. */
     123ifndef VBOX ; This currently breaks restoring a previously saved state.
    114124                mov     dl, 4   ; disable i/o and memory space access
    115125                call    pcibios_init_sel_reg
     
    201211                cmp     bx, 0100h
    202212                jne     pci_init_io_loop1
     213endif ; !VBOX
    203214                mov     sp, bp
    204215                pop     bp
     
    230241                mov     ax, 0F000h
    231242                mov     ds, ax
     243ifndef VBOX
     244; this code works OK, but it's unnecessary effort since the fake PCI BIOS
     245; already configured the IRQ lines and the ELCR correctly
    232246                mov     dx, 04D0h ;; reset ELCR1 + ELCR2
    233247                mov     al, 0
     
    282296                mov     dl, 3Ch
    283297                call pcibios_init_sel_reg
    284                 mov     dx, PCI_CFG2 + 1 ; TODO: was #0x0cfd - is that right?
     298                mov     dx, PCI_CFG2 + 1 ; access config space at 3Dh
    285299                in      al, dx
    286300                and     al, 7
     
    332346                pop     bx
    333347pci_init_end:
     348endif
    334349                pop             bp
    335350                pop             ds
  • TabularUnified trunk/src/VBox/VMM/VMMR3/PDM.cpp

    r67583 r67668  
    16451645        }
    16461646
    1647     /*
    1648      * Run Fake PCI BIOS after reset.
    1649      */
    1650     if (fAtReset && pVM->pdm.s.aPciBuses[0].pDevInsR3)
    1651     {
    1652         pdmLock(pVM);
    1653         int rc = pVM->pdm.s.aPciBuses[0].pfnFakePCIBIOSR3(pVM->pdm.s.aPciBuses[0].pDevInsR3);
    1654         pdmUnlock(pVM);
    1655         if (RT_FAILURE(rc))
    1656             AssertMsgFailed(("PCI BIOS fake failed rc=%Rrc\n", rc));
    1657     }
    1658 
    1659 
    16601647    LogFlow(("PDMR3MemSetup: returns void\n"));
    16611648}
  • TabularUnified trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r65338 r67668  
    26132613#if PDM_DEVHLPR3_VERSION >= PDM_VERSION_MAKE_PP(0xffe7, 20, 0)
    26142614    LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: pPciBusReg=%p:{.u32Version=%#x, .pfnRegisterR3=%p, .pfnIORegionRegisterR3=%p, "
    2615              ".pfnSetIrqR3=%p, .pfnFakePCIBIOSR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p piBus=%p\n",
     2615             ".pfnSetIrqR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p piBus=%p\n",
    26162616             pDevIns->pReg->szName, pDevIns->iInstance, pPciBusReg, pPciBusReg->u32Version, pPciBusReg->pfnRegisterR3,
    2617              pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pfnFakePCIBIOSR3,
    2618              pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0,
    2619              ppPciHlpR3, piBus));
     2617             pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC,
     2618             pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, ppPciHlpR3, piBus));
    26202619#else
    26212620    LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: pPciBusReg=%p:{.u32Version=%#x, .pfnRegisterR3=%p, .pfnIORegionRegisterR3=%p, "
    2622              ".pfnSetIrqR3=%p, .pfnFakePCIBIOSR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p\n",
     2621             ".pfnSetIrqR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p\n",
    26232622             pDevIns->pReg->szName, pDevIns->iInstance, pPciBusReg, pPciBusReg->u32Version, pPciBusReg->pfnRegisterR3,
    2624              pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pfnFakePCIBIOSR3,
    2625              pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, ppPciHlpR3));
     2623             pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC,
     2624             pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, ppPciHlpR3));
    26262625#endif
    26272626
     
    26372636    if (    !pPciBusReg->pfnRegisterR3
    26382637        ||  !pPciBusReg->pfnIORegionRegisterR3
    2639         ||  !pPciBusReg->pfnSetIrqR3
    2640         ||  (!pPciBusReg->pfnFakePCIBIOSR3 && !pVM->pdm.s.aPciBuses[0].pDevInsR3)) /* Only the first bus needs to do the BIOS work. */
     2638        ||  !pPciBusReg->pfnSetIrqR3)
    26412639    {
    26422640        Assert(pPciBusReg->pfnRegisterR3);
    26432641        Assert(pPciBusReg->pfnIORegionRegisterR3);
    26442642        Assert(pPciBusReg->pfnSetIrqR3);
    2645         Assert(pPciBusReg->pfnFakePCIBIOSR3);
    26462643        LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc (R3 callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
    26472644        return VERR_INVALID_PARAMETER;
     
    27382735    pPciBus->pfnSetConfigCallbacksR3 = pPciBusReg->pfnSetConfigCallbacksR3;
    27392736    pPciBus->pfnSetIrqR3             = pPciBusReg->pfnSetIrqR3;
    2740     pPciBus->pfnFakePCIBIOSR3        = pPciBusReg->pfnFakePCIBIOSR3;
    27412737
    27422738    Log(("PDM: Registered PCI bus device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
  • TabularUnified trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp

    r64626 r67668  
    424424
    425425    /*
    426      *
    427      * PCI BIOS Fake and Init Complete.
    428      *
    429      */
    430     if (pVM->pdm.s.aPciBuses[0].pDevInsR3)
    431     {
    432         pdmLock(pVM);
    433         rc = pVM->pdm.s.aPciBuses[0].pfnFakePCIBIOSR3(pVM->pdm.s.aPciBuses[0].pDevInsR3);
    434         pdmUnlock(pVM);
    435         if (RT_FAILURE(rc))
    436         {
    437             AssertMsgFailed(("PCI BIOS fake failed rc=%Rrc\n", rc));
    438             return rc;
    439         }
    440     }
    441 
     426     * Iterate thru the device instances and work the callback.
     427     */
    442428    for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNextR3)
    443429    {
  • TabularUnified trunk/src/VBox/VMM/include/PDMInternal.h

    r64655 r67668  
    641641    DECLR3CALLBACKMEMBER(void,      pfnSetConfigCallbacksR3,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, PFNPCICONFIGREAD pfnRead,
    642642                                                             PPFNPCICONFIGREAD ppfnReadOld, PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld));
    643     /** @copydoc PDMPCIBUSREG::pfnFakePCIBIOSR3 */
    644     DECLR3CALLBACKMEMBER(int,       pfnFakePCIBIOSR3,(PPDMDEVINS pDevIns));
    645643
    646644    /** Pointer to the PIC device instance - R0. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette