VirtualBox

Changeset 32765 in vbox for trunk/src/VBox/Devices/Bus


Ignore:
Timestamp:
Sep 24, 2010 4:26:32 PM (14 years ago)
Author:
vboxsync
Message:

PCI: Linux guests really access extended PCI space

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r32715 r32765  
    184184// See 7.2.2. PCI Express Enhanced Configuration Mechanism for details of address
    185185// mapping, we take n=8 approach
    186 DECLINLINE(void) ich9pciPhysToPciAddr(RTGCPHYS GCPhysAddr, PciAddress* pPciAddr)
    187 {
     186DECLINLINE(void) ich9pciPhysToPciAddr(PPCIGLOBALS pGlobals, RTGCPHYS GCPhysAddr, PciAddress* pPciAddr)
     187{
     188    GCPhysAddr = GCPhysAddr - pGlobals->u64PciConfigMMioAddress;
    188189    pPciAddr->iBus          = (GCPhysAddr >> 20) & ((1<<8)       - 1);
    189190    pPciAddr->iDeviceFunc   = (GCPhysAddr >> 15) & ((1<<(5+3))   - 1); // 5 bits - device, 3 bits - function
     
    288289static int ich9pciDataWriteAddr(PPCIGLOBALS pGlobals, PciAddress* pAddr, uint32_t val, int len)
    289290{
     291
     292    if (pAddr->iRegister > 0xff)
     293    {
     294        LogRel(("PCI: attempt to write extended register: %x (%d) <- val\n", pAddr->iRegister, len, val));
     295        return 0;
     296    }
     297
    290298    if (pAddr->iBus != 0)
    291299    {
     
    367375static int ich9pciDataReadAddr(PPCIGLOBALS pGlobals, PciAddress* pPciAddr, int len, uint32_t *pu32)
    368376{
     377    if (pPciAddr->iRegister > 0xff)
     378    {
     379        LogRel(("PCI: attempt to read extended register: %x\n", pPciAddr->iRegister));
     380        *pu32 = 0;
     381        return 0;
     382    }
     383
     384
    369385    if (pPciAddr->iBus != 0)
    370386    {
     
    536552    uint32_t u32 = 0;
    537553
    538     ich9pciPhysToPciAddr(GCPhysAddr, &aDest);
     554    ich9pciPhysToPciAddr(pGlobals, GCPhysAddr, &aDest);
    539555
    540556    PCI_LOCK(pDevIns, VINF_IOM_HC_IOPORT_WRITE);
     
    556572    int rc = ich9pciDataWriteAddr(pGlobals, &aDest, u32, cb);
    557573    PCI_UNLOCK(pDevIns);
    558     Assert(false);
    559574
    560575    return rc;
     
    567582    uint32_t    rv = 0;
    568583
    569     ich9pciPhysToPciAddr(GCPhysAddr, &aDest);
     584    ich9pciPhysToPciAddr(pGlobals, GCPhysAddr, &aDest);
    570585
    571586    PCI_LOCK(pDevIns, VINF_IOM_HC_IOPORT_WRITE);
     
    591606    PCI_UNLOCK(pDevIns);
    592607
    593     Assert(false);
    594608    return rc;
    595609}
Note: See TracChangeset for help on using the changeset viewer.

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