aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/acpi.c
diff options
context:
space:
mode:
authorGary Hade <garyhade@us.ibm.com>2011-11-14 18:42:16 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-01-06 15:10:32 -0500
commitae5cd86455381282ece162966183d3f208c6fad7 (patch)
tree542674bc3c49b910ff740122483619b694853737 /arch/x86/pci/acpi.c
parent1830ea91c20b06608f7cdb2455ce05ba834b3214 (diff)
x86/PCI: Ignore CPU non-addressable _CRS reserved memory resources
This assures that a _CRS reserved host bridge window or window region is not used if it is not addressable by the CPU. The new code either trims the window to exclude the non-addressable portion or totally ignores the window if the entire window is non-addressable. The current code has been shown to be problematic with 32-bit non-PAE kernels on systems where _CRS reserves resources above 4GB. Signed-off-by: Gary Hade <garyhade@us.ibm.com> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Thomas Renninger <trenn@novell.com> Cc: linux-kernel@vger.kernel.org Cc: stable@kernel.org Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86/pci/acpi.c')
-rw-r--r--arch/x86/pci/acpi.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index e662ceebd798..425500bb24e6 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -178,7 +178,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
178 struct acpi_resource_address64 addr; 178 struct acpi_resource_address64 addr;
179 acpi_status status; 179 acpi_status status;
180 unsigned long flags; 180 unsigned long flags;
181 u64 start, end; 181 u64 start, orig_end, end;
182 182
183 status = resource_to_addr(acpi_res, &addr); 183 status = resource_to_addr(acpi_res, &addr);
184 if (!ACPI_SUCCESS(status)) 184 if (!ACPI_SUCCESS(status))
@@ -194,7 +194,21 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
194 return AE_OK; 194 return AE_OK;
195 195
196 start = addr.minimum + addr.translation_offset; 196 start = addr.minimum + addr.translation_offset;
197 end = addr.maximum + addr.translation_offset; 197 orig_end = end = addr.maximum + addr.translation_offset;
198
199 /* Exclude non-addressable range or non-addressable portion of range */
200 end = min(end, (u64)iomem_resource.end);
201 if (end <= start) {
202 dev_info(&info->bridge->dev,
203 "host bridge window [%#llx-%#llx] "
204 "(ignored, not CPU addressable)\n", start, orig_end);
205 return AE_OK;
206 } else if (orig_end != end) {
207 dev_info(&info->bridge->dev,
208 "host bridge window [%#llx-%#llx] "
209 "([%#llx-%#llx] ignored, not CPU addressable)\n",
210 start, orig_end, end + 1, orig_end);
211 }
198 212
199 res = &info->res[info->res_num]; 213 res = &info->res[info->res_num];
200 res->name = info->name; 214 res->name = info->name;