aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorGary Hade <garyhade@us.ibm.com>2011-11-14 18:42:16 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-25 20:24:39 -0500
commit0a4179971477550df61b9218e664eb9128abf2e3 (patch)
tree33309b9b7433ddd33dfc82b0de16df8644e8e181 /arch/x86
parent65d61b46700e059210b4c9f63355d57dc0e1a18e (diff)
x86/PCI: Ignore CPU non-addressable _CRS reserved memory resources
commit ae5cd86455381282ece162966183d3f208c6fad7 upstream. 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 Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/x86')
-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 50b3f14c59a..53f9e684c81 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -149,7 +149,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
149 struct acpi_resource_address64 addr; 149 struct acpi_resource_address64 addr;
150 acpi_status status; 150 acpi_status status;
151 unsigned long flags; 151 unsigned long flags;
152 u64 start, end; 152 u64 start, orig_end, end;
153 153
154 status = resource_to_addr(acpi_res, &addr); 154 status = resource_to_addr(acpi_res, &addr);
155 if (!ACPI_SUCCESS(status)) 155 if (!ACPI_SUCCESS(status))
@@ -165,7 +165,21 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
165 return AE_OK; 165 return AE_OK;
166 166
167 start = addr.minimum + addr.translation_offset; 167 start = addr.minimum + addr.translation_offset;
168 end = addr.maximum + addr.translation_offset; 168 orig_end = end = addr.maximum + addr.translation_offset;
169
170 /* Exclude non-addressable range or non-addressable portion of range */
171 end = min(end, (u64)iomem_resource.end);
172 if (end <= start) {
173 dev_info(&info->bridge->dev,
174 "host bridge window [%#llx-%#llx] "
175 "(ignored, not CPU addressable)\n", start, orig_end);
176 return AE_OK;
177 } else if (orig_end != end) {
178 dev_info(&info->bridge->dev,
179 "host bridge window [%#llx-%#llx] "
180 "([%#llx-%#llx] ignored, not CPU addressable)\n",
181 start, orig_end, end + 1, orig_end);
182 }
169 183
170 res = &info->res[info->res_num]; 184 res = &info->res[info->res_num];
171 res->name = info->name; 185 res->name = info->name;