]>
Commit | Line | Data |
---|---|---|
3f14851e GKH |
1 | From ae5cd86455381282ece162966183d3f208c6fad7 Mon Sep 17 00:00:00 2001 |
2 | From: Gary Hade <garyhade@us.ibm.com> | |
3 | Date: Mon, 14 Nov 2011 15:42:16 -0800 | |
4 | Subject: x86/PCI: Ignore CPU non-addressable _CRS reserved memory resources | |
5 | ||
6 | From: Gary Hade <garyhade@us.ibm.com> | |
7 | ||
8 | commit ae5cd86455381282ece162966183d3f208c6fad7 upstream. | |
9 | ||
10 | This assures that a _CRS reserved host bridge window or window region is | |
11 | not used if it is not addressable by the CPU. The new code either trims | |
12 | the window to exclude the non-addressable portion or totally ignores the | |
13 | window if the entire window is non-addressable. | |
14 | ||
15 | The current code has been shown to be problematic with 32-bit non-PAE | |
16 | kernels on systems where _CRS reserves resources above 4GB. | |
17 | ||
18 | Signed-off-by: Gary Hade <garyhade@us.ibm.com> | |
19 | Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> | |
20 | Cc: Thomas Renninger <trenn@novell.com> | |
21 | Cc: linux-kernel@vger.kernel.org | |
22 | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> | |
23 | Signed-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; |