All of lore.kernel.org
 help / color / mirror / Atom feed
* Reducing dependence on BIOS for allocating memory at PCI root port?
@ 2014-10-13 18:32 Rajat Jain
  2014-10-13 20:07 ` Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: Rajat Jain @ 2014-10-13 18:32 UTC (permalink / raw)
  To: linux-pci, linux-x86_64; +Cc: Guenter Roeck

Hello,

I have huge hot-plug systems that can have hundreds of hot plug PCI slots that may not be populated at the boot time. Since BIOS doesn't see all devices could be plugged in, so we ask it to hard code and allocate a fixed chunk of memory space (say 4 GB) for PCI at the root port.

Now as we keep on developing new add-on cards with more PCI memory requirements - we have a problem because we need to increase that root port allocation. While asking the BIOS vendor to increase the memory for new releases is an option, I am in general thinking if there is a way to do this without depending on the BIOS allocation at all. We don't want to upgrade BIOS for just this. I'm hopeful this is a common problem - so I wanted to ask if there are there existing mechanisms that allow / instruct the kernel to ignore the BIOS allocations, and reprogram the PCI host controllers, (by maybe a kernel configuration or command line parameters etc for example).

My question is whether some thing exists (or if it makes sense)?

Thanks,

Rajat

PS: The immediate thought of device tree comes to mind - but what about architectures that don't support it yet. (FWIW - I'm using x86 - and I do not know if its host controller driver supports / will support any device tree options to specify PCI windows)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Reducing dependence on BIOS for allocating memory at PCI root port?
  2014-10-13 18:32 Reducing dependence on BIOS for allocating memory at PCI root port? Rajat Jain
@ 2014-10-13 20:07 ` Bjorn Helgaas
  2014-10-13 20:20     ` Rajat Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2014-10-13 20:07 UTC (permalink / raw)
  To: Rajat Jain; +Cc: linux-pci, linux-x86_64, Guenter Roeck, linux-acpi

[+cc linux-acpi]

On Mon, Oct 13, 2014 at 12:32 PM, Rajat Jain <rajatjain@juniper.net> wrote:
> Hello,
>
> I have huge hot-plug systems that can have hundreds of hot plug PCI slots that may not be populated at the boot time. Since BIOS doesn't see all devices could be plugged in, so we ask it to hard code and allocate a fixed chunk of memory space (say 4 GB) for PCI at the root port.
>
> Now as we keep on developing new add-on cards with more PCI memory requirements - we have a problem because we need to increase that root port allocation. While asking the BIOS vendor to increase the memory for new releases is an option, I am in general thinking if there is a way to do this without depending on the BIOS allocation at all. We don't want to upgrade BIOS for just this. I'm hopeful this is a common problem - so I wanted to ask if there are there existing mechanisms that allow / instruct the kernel to ignore the BIOS allocations, and reprogram the PCI host controllers, (by maybe a kernel configuration or command line parameters etc for example).

As you know, the transition from CPU address space to PCI address
space is in the host bridge.  For PCIe, this is logically part of the
Root Complex and is logically upstream from the Root Ports.  If  you
want to reallocate space between Root Ports, i.e., remove space from
one and add it to another port below the same Root Complex, that's
strictly a PCI thing and is at least conceptually possible today with
no new firmware or DT support.

But you're probably asking about increasing the space assigned to the
Root Complex itself.  The ACPI model supports that -- the PNP0A08 host
bridge device could advertise a _PRS that shows how much space could
potentially be assigned to the bridge, and we could use _SRS to assign
more space (possibly after using _SRS on a different bridge to make
space available).  There is no Linux code to do this today, so at this
point it's just a theoretical possibility.  And, of course, it
requires BIOS support.

The ACPI driver (drivers/acpi/pci_root.c) is generic, so it doesn't
know how to reprogram the host controller except by using _PRS and
_SRS (and even that isn't implemented yet).

> PS: The immediate thought of device tree comes to mind - but what about architectures that don't support it yet. (FWIW - I'm using x86 - and I do not know if its host controller driver supports / will support any device tree options to specify PCI windows)

If you have DT and a native host controller driver, the driver may
know how to reprogram the host controller.  Then you would just have
to work out how to manage the address space you want to assign to the
controller.

If you're using the generic DT driver
(drivers/pci/host/pci-host-generic.c), it's in the same situation as
the ACPI driver: it doesn't know how to reprogram the windows.  And as
far as I know there's no DT mechanism similar to _PRS/_SRS.

Bjorn

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Reducing dependence on BIOS for allocating memory at PCI root port?
  2014-10-13 20:07 ` Bjorn Helgaas
@ 2014-10-13 20:20     ` Rajat Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Rajat Jain @ 2014-10-13 20:20 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-x86_64, Guenter Roeck, linux-acpi

Hello,

> 
> As you know, the transition from CPU address space to PCI address space is
> in the host bridge.  For PCIe, this is logically part of the Root Complex and is
> logically upstream from the Root Ports.  If  you want to reallocate space
> between Root Ports, i.e., remove space from one and add it to another port
> below the same Root Complex, that's strictly a PCI thing and is at least
> conceptually possible today with no new firmware or DT support.
> 

Yes, I understand.

> But you're probably asking about increasing the space assigned to the Root
> Complex itself.

Bingo! That's the problem I am bothered about.

>  The ACPI model supports that -- the PNP0A08 host bridge
> device could advertise a _PRS that shows how much space could potentially
> be assigned to the bridge, and we could use _SRS to assign more space
> (possibly after using _SRS on a different bridge to make space available).
> There is no Linux code to do this today, so at this point it's just a theoretical
> possibility.  And, of course, it requires BIOS support.

Thanks a lot for the pointers, I'll look it up.

> 
> The ACPI driver (drivers/acpi/pci_root.c) is generic, so it doesn't know how to
> reprogram the host controller except by using _PRS and _SRS (and even that
> isn't implemented yet).
> 
> > PS: The immediate thought of device tree comes to mind - but what
> > about architectures that don't support it yet. (FWIW - I'm using x86 -
> > and I do not know if its host controller driver supports / will
> > support any device tree options to specify PCI windows)
> 
> If you have DT and a native host controller driver, the driver may know how
> to reprogram the host controller.  Then you would just have to work out how
> to manage the address space you want to assign to the controller.
> 
> If you're using the generic DT driver
> (drivers/pci/host/pci-host-generic.c), it's in the same situation as the ACPI
> driver: it doesn't know how to reprogram the windows.  And as far as I know
> there's no DT mechanism similar to _PRS/_SRS.
> 

OK, understand. I guess there is work that needs to be done there. Yes, We are in the process of adopting device trees for x86. I'll dig into if we can use that.

Thanks again,

Rajat

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Reducing dependence on BIOS for allocating memory at PCI root port?
@ 2014-10-13 20:20     ` Rajat Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Rajat Jain @ 2014-10-13 20:20 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-x86_64, Guenter Roeck, linux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N1cHBvcnQgYW55IGRldmljZSB0cmVlIG9wdGlvbnMgdG8gc3BlY2lmeSBQ
Q0kgd2luZG93cykNCj4gDQo+IElmIHlvdSBoYXZlIERUIGFuZCBhIG5hdGl2ZSBob3N0IGNvbnRy
b2xsZXIgZHJpdmVyLCB0aGUgZHJpdmVyIG1heSBrbm93IGhvdw0KPiB0byByZXByb2dyYW0gdGhl
IGhvc3QgY29udHJvbGxlci4gIFRoZW4geW91IHdvdWxkIGp1c3QgaGF2ZSB0byB3b3JrIG91dCBo
b3cNCj4gdG8gbWFuYWdlIHRoZSBhZGRyZXNzIHNwYWNlIHlvdSB3YW50IHRvIGFzc2lnbiB0byB0
aGUgY29udHJvbGxlci4NCj4gDQo+IElmIHlvdSdyZSB1c2luZyB0aGUgZ2VuZXJpYyBEVCBkcml2
ZXINCj4gKGRyaXZlcnMvcGNpL2hvc3QvcGNpLWhvc3QtZ2VuZXJpYy5jKSwgaXQncyBpbiB0aGUg
c2FtZSBzaXR1YXRpb24gYXMgdGhlIEFDUEkNCj4gZHJpdmVyOiBpdCBkb2Vzbid0IGtub3cgaG93
IHRvIHJlcHJvZ3JhbSB0aGUgd2luZG93cy4gIEFuZCBhcyBmYXIgYXMgSSBrbm93DQo+IHRoZXJl
J3Mgbm8gRFQgbWVjaGFuaXNtIHNpbWlsYXIgdG8gX1BSUy9fU1JTLg0KPiANCg0KT0ssIHVuZGVy
c3RhbmQuIEkgZ3Vlc3MgdGhlcmUgaXMgd29yayB0aGF0IG5lZWRzIHRvIGJlIGRvbmUgdGhlcmUu
IFllcywgV2UgYXJlIGluIHRoZSBwcm9jZXNzIG9mIGFkb3B0aW5nIGRldmljZSB0cmVlcyBmb3Ig
eDg2LiBJJ2xsIGRpZyBpbnRvIGlmIHdlIGNhbiB1c2UgdGhhdC4NCg0KVGhhbmtzIGFnYWluLA0K
DQpSYWphdA0K

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-13 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-13 18:32 Reducing dependence on BIOS for allocating memory at PCI root port? Rajat Jain
2014-10-13 20:07 ` Bjorn Helgaas
2014-10-13 20:20   ` Rajat Jain
2014-10-13 20:20     ` Rajat Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.