Bug #14238


Remove vestigial mcfg related pieces

Added by Robert Mustacchi 6 months ago. Updated 4 months ago.

driver - device drivers
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


In the PCIe initialization code and npe, there are two pieces of vestigial logic that exist relating to the mcfg base that we should remove. Before we get to that, some background. PCIe defines a platform-specific mechanism for accessing memory mapped configuration space. The way this is communicated to the operating system is platform specific. On systems with ACPI, this is generally done through the mcfg table. This table is found early in boot in fakebop.c and is passed onto the general PCI code.

Much later in boot (relatively speaking), there are two places that come back and try to make further notes of this, which are basically storing information that is never used.

1. The pcie_bus_t has a bus_cfgacc_base member. This was only ever consumed on SPARC. So x86 systems set it and then proceeded to ignore it. Because the cfgacc mechanism is naturally platform specific (e.g. on x86 it has the option of falling back to I/O ports) there isn't much value for us keeping this member here.

2. npe goes through and adds an 'ecfg' property that tries to communicate information about things. This has a bit of sordid history and a lot of what it attempted to do, poorly, was cleaned up in #6859. While the comment says that something later in boot will use this, that isn't true at all. Nothing else will. So we can remove an unneeded ACPI dependency from npe (making it easier to move to other archs in the future) and get rid of some code that confuses the reader.

Related issues

Related to illumos gate - Bug #6859: missing MCFG table should lead to I/O PCIe config accessClosedJoshua M. Clulow2016-04-07

Actions #1

Updated by Robert Mustacchi 6 months ago

  • Subject changed from Remove vistigial mcfg related pieces to Remove vestigial mcfg related pieces
Actions #2

Updated by Joshua M. Clulow 6 months ago

  • Related to Bug #6859: missing MCFG table should lead to I/O PCIe config access added
Actions #3

Updated by Electric Monk 5 months ago

  • Gerrit CR set to 1914
Actions #4

Updated by Robert Mustacchi 5 months ago

To test this I went and booted existing systems and did the following:

  1. Used pcieadm to dump the configuration space of every device on bits without this change and rebooting onto this without changing hardware. I then looked at everything that had changed in configuration space. In particular, if we had failed to find certain things in extended configuration space that would have been reflected in here (theoretically). The only difference was an allocated memory address for an MSI-X table being swapped between a few devices (but the same original addresses were used). Because pcieadm reads from extended configuration space and that was dumped, this was a good sign that things were still working and nothing was really using this property.
  1. I then looked at prtconf -vP output before and after. Here, again, I went to make sure that we still found some of the capabilities like the PCIe serial number which are in extended configuration space. Here the only differences were in a few of the minor nodes being attached or detached (in part due to debug bits). But devices had the same properties in general, which is what we wanted to see.
Actions #5

Updated by Electric Monk 4 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 097e441f24cafd9118111f7b1b6ca3f00e5bb03f

commit  097e441f24cafd9118111f7b1b6ca3f00e5bb03f
Author: Robert Mustacchi <>
Date:   2022-01-14T21:22:38.000Z

    14238 Remove vestigial mcfg related pieces
    Reviewed by: Hans Rosenfeld <>
    Reviewed by: Toomas Soome <>
    Approved by: Rich Lowe <>


Also available in: Atom PDF