On Fri, Jun 14, 2019 at 11:48:18PM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2019-06-14 at 08:12 -0500, Bjorn Helgaas wrote: > > On Fri, Jun 14, 2019 at 08:43:19PM +1000, Benjamin Herrenschmidt > > wrote: > > > > > This least to another conversation we hinted at earlier.. we should > > > probably have a way to do the same at least for BARs on ACPI > > > systems so > > > we don't have to temporarily disable access to a device to size > > > them. > > > > The PCI Enhanced Allocation capability provides a way to do this. I > > don't know how widely used it is, but it's theoretically possible. > > Ok, I have to read about this. I haven't seen a device with that on > yet, it looks messy at a quick glance. > > Can ACPI convey the information ? On powerpc and sparc64 we have ways > to read the BAR values from the device-tree created by OF when it > assigned them. I agree, EA is messy. I don't think it's feasible to do this in ACPI. It's a pretty fundamental principle of PCI that you can discover what resources a device needs and uses by looking at its config space. In general PCIe requires ECAM, which gives the OS direct access to config space, although it does allow exceptions for architecture-specific firmware interfaces for accessing config space, e.g., ia64 SAL (PCIe r4.0, sec 7.2.2). Bjorn