]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.0.18/x86-pci-ignore-cpu-non-addressable-_crs-reserved-memory-resources.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.0.18 / x86-pci-ignore-cpu-non-addressable-_crs-reserved-memory-resources.patch
CommitLineData
3f14851e
GKH
1From ae5cd86455381282ece162966183d3f208c6fad7 Mon Sep 17 00:00:00 2001
2From: Gary Hade <garyhade@us.ibm.com>
3Date: Mon, 14 Nov 2011 15:42:16 -0800
4Subject: x86/PCI: Ignore CPU non-addressable _CRS reserved memory resources
5
6From: Gary Hade <garyhade@us.ibm.com>
7
8commit ae5cd86455381282ece162966183d3f208c6fad7 upstream.
9
10This assures that a _CRS reserved host bridge window or window region is
11not used if it is not addressable by the CPU. The new code either trims
12the window to exclude the non-addressable portion or totally ignores the
13window if the entire window is non-addressable.
14
15The current code has been shown to be problematic with 32-bit non-PAE
16kernels on systems where _CRS reserves resources above 4GB.
17
18Signed-off-by: Gary Hade <garyhade@us.ibm.com>
19Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
20Cc: Thomas Renninger <trenn@novell.com>
21Cc: linux-kernel@vger.kernel.org
22Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
23Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
24
25---
26 arch/x86/pci/acpi.c | 18 ++++++++++++++++--
27 1 file changed, 16 insertions(+), 2 deletions(-)
28
29--- a/arch/x86/pci/acpi.c
30+++ b/arch/x86/pci/acpi.c
31@@ -149,7 +149,7 @@ setup_resource(struct acpi_resource *acp
32 struct acpi_resource_address64 addr;
33 acpi_status status;
34 unsigned long flags;
35- u64 start, end;
36+ u64 start, orig_end, end;
37
38 status = resource_to_addr(acpi_res, &addr);
39 if (!ACPI_SUCCESS(status))
40@@ -165,7 +165,21 @@ setup_resource(struct acpi_resource *acp
41 return AE_OK;
42
43 start = addr.minimum + addr.translation_offset;
44- end = addr.maximum + addr.translation_offset;
45+ orig_end = end = addr.maximum + addr.translation_offset;
46+
47+ /* Exclude non-addressable range or non-addressable portion of range */
48+ end = min(end, (u64)iomem_resource.end);
49+ if (end <= start) {
50+ dev_info(&info->bridge->dev,
51+ "host bridge window [%#llx-%#llx] "
52+ "(ignored, not CPU addressable)\n", start, orig_end);
53+ return AE_OK;
54+ } else if (orig_end != end) {
55+ dev_info(&info->bridge->dev,
56+ "host bridge window [%#llx-%#llx] "
57+ "([%#llx-%#llx] ignored, not CPU addressable)\n",
58+ start, orig_end, end + 1, orig_end);
59+ }
60
61 res = &info->res[info->res_num];
62 res->name = info->name;