2008-06-19 22:57:07

by Alok Kataria

[permalink] [raw]
Subject: [PCI_ACPI] Modify PCI gap calculation

Today, we calculate a gap in the low 32bit address space for PCI devices
to assign MMIO resources for hotplug or unconfigured devices,
(pci_mem_start).
This gap calculation is done by walking the e820 memory space, this
calculation ignores the SRAT for any possible reservations that the
BIOS might have done for memory hotplug. In some cases the
PCI device resources (f.e. Expansion ROMS) end up sharing the address
space with memory hotplug capable regions.

As a result, when we try to hotadd memory to a system which has less
than 4GB memory to start with, we see resource clashes and the hotadd
requests fail.

The solution here is to find a PCI gap in the PCI reserved regions as
exported by the ACPI table. We read the _CRS object under PCI0 for
possible producer regions and search for a big enough unclaimed gap
within these producer regions.

There are 2 patches
1. cleanup of the e820_search_gap function
2. code which walks ACPI resources searching for gap within producer
regions.

I have kept the original e820_find_gap function since in systems with
ACPI disabled we still may need to calculate the gap.

Please have a look.

Thanks,
Alok