Vista does not allow config space reads beyond 0xFF

Discussion in 'Windows Vista Drivers' started by Gabe, Oct 11, 2007.

  1. Gabe

    Gabe Guest

    I have verified in winDBG in pci!PciExternalReadDeviceConfig that it
    checks the offset and verifies that the aligned offset is below
    0x100. If it is at or above 0x100 then the returning status is
    0xC0000010 or STATUS_INVALID_DEVICE_REQUEST which is exactly what I am

    This is contrary to msdn documentation
    that says extended config space access is allowed:

    "Drivers can read from the extended PCI device configuration space
    (that is, more than 256 bytes of configuration data) using the
    IRP_MN_READ_CONFIG request or the GetBusData method of

    Please tell me that I am wrong! I really would rather not calculate
    the offset from 0xe0000000 (using bus, dev, func) and manually read
    physical memory at that location to get to the extended config space.
    I WANT to use OS calls!

    Gabe, Oct 11, 2007
    1. Advertisements

  2. Gabe

    Gabe Guest

    Ok, Actually I have found two places where this occurs: pci!
    PciExternalReadDeviceConfig and pci!PciReadDeviceConfig

    When I manually set the registers to pass the check in these two
    locations, the read works! I'm guessing this is a bug in Vista. Since
    I have verified the same behavior on Vista SP1 Beta, I doubt it will
    be fixed any time soon. I guess the only alternative I see here is to
    manually read from physical memory (like I explained above).

    If I don't hear from MS about this, I guess I'll post how to calculate
    those offsets and manually read the mapped config space so that others
    don't waste as much time as I did trying to figure out what is going
    Gabe, Oct 11, 2007
    1. Advertisements

  3. G> If I don't hear from MS about this, [...]

    Have you _actually told_ Microsoft about it?
    J de Boyne Pollard, Oct 16, 2007
  4. Gabe

    Don Burn Guest

    And have you verified you can access the config space on this system? Note
    the page you quoted also says:

    "If a device does not have an extended configuration space or the platform
    does not define a path for an extended configuration space on a device, the
    read requests will return 0xFFFF and the write requests will have no effect.

    So does your platform support it?

    Don Burn (MVP, Windows DDK)
    Windows 2k/XP/2k3 Filesystem and Driver Consulting
    Remove StopSpam to reply
    Don Burn, Oct 16, 2007
  5. Gabe

    Gabe Guest

    I am pretty sure that the BIOS is allowing Vista to take control of
    PCIe since in WinDBG I can do a !pci 0x101 3 0 0 (my device is on bus
    3, dev 0, func 0):

    ...[Config Space 0x00-0xFF omitted]...

    Enhanced Capabilities:
    100: CapID 0002 Virtual Channel Capability
    Version 1
    NextPtr 800

    800: CapID 0001 Advanced Error Reporting Capability
    Version 1
    NextPtr 000

    However on another machine running Vista where I'm pretty sure the
    BIOS does NOT implement the _OSC method, when I
    run !pci 0x101 on the same device there isn't an "Enhanced
    Capabilities" listing at all.

    I have talked to the firmware developers for the first machine (the
    one where
    doing !pci 0x101 showed "Enhanced Capabilities") and I have been
    told that they do indeed implement the _OSC method and that Vista
    have control of PCIe.

    I can't think of anything else to verify that my platform supports
    it. If you
    have any ideas what I could do, I would much appreciate it.

    Gabe, Oct 16, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.