1 From: Suresh Siddha <suresh.b.siddha@intel.com>
2 Subject: x64, x2apic/intr-remap: use CONFIG_DMAR for DMA-remapping specific code
3 References: fate #303948 and fate #303984
4 Patch-Mainline: queued for .28
5 Commit-ID: aaa9d1dd63bf89b62f4ea9f46de376ab1a3fbc6c
7 Signed-off-by: Thomas Renninger <trenn@suse.de>
9 DMA remapping specific code covered with CONFIG_DMAR in
10 the generic code which will also be used later for enabling Interrupt-remapping.
12 Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
13 Cc: akpm@linux-foundation.org
14 Cc: arjan@linux.intel.com
15 Cc: andi@firstfloor.org
16 Cc: ebiederm@xmission.com
17 Cc: jbarnes@virtuousgeek.org
19 Signed-off-by: Ingo Molnar <mingo@elte.hu>
22 drivers/pci/dmar.c | 39 +++++++++++++++++++++++++++------------
23 1 file changed, 27 insertions(+), 12 deletions(-)
25 Index: linux-2.6.26/drivers/pci/dmar.c
26 ===================================================================
27 --- linux-2.6.26.orig/drivers/pci/dmar.c
28 +++ linux-2.6.26/drivers/pci/dmar.c
30 * these units are not supported by the architecture.
32 LIST_HEAD(dmar_drhd_units);
33 -LIST_HEAD(dmar_rmrr_units);
35 static struct acpi_table_header * __initdata dmar_tbl;
37 @@ -55,11 +54,6 @@ static void __init dmar_register_drhd_un
38 list_add(&drhd->list, &dmar_drhd_units);
41 -static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr)
43 - list_add(&rmrr->list, &dmar_rmrr_units);
46 static int __init dmar_parse_one_dev_scope(struct acpi_dmar_device_scope *scope,
47 struct pci_dev **dev, u16 segment)
49 @@ -224,6 +218,15 @@ dmar_parse_dev(struct dmar_drhd_unit *dm
54 +LIST_HEAD(dmar_rmrr_units);
56 +static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr)
58 + list_add(&rmrr->list, &dmar_rmrr_units);
63 dmar_parse_one_rmrr(struct acpi_dmar_header *header)
65 @@ -260,6 +263,7 @@ rmrr_parse_dev(struct dmar_rmrr_unit *rm
72 dmar_table_print_dmar_entry(struct acpi_dmar_header *header)
73 @@ -284,6 +288,7 @@ dmar_table_print_dmar_entry(struct acpi_
79 * parse_dmar_table - parses the DMA reporting table
81 @@ -316,7 +321,9 @@ parse_dmar_table(void)
82 ret = dmar_parse_one_drhd(entry_header);
84 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
86 ret = dmar_parse_one_rmrr(entry_header);
90 printk(KERN_WARNING PREFIX
91 @@ -366,7 +373,6 @@ dmar_find_matched_drhd_unit(struct pci_d
92 int __init dmar_dev_scope_init(void)
94 struct dmar_drhd_unit *drhd;
95 - struct dmar_rmrr_unit *rmrr;
98 for_each_drhd_unit(drhd) {
99 @@ -375,11 +381,16 @@ int __init dmar_dev_scope_init(void)
103 - for_each_rmrr_units(rmrr) {
104 - ret = rmrr_parse_dev(rmrr);
109 + struct dmar_rmrr_unit *rmrr;
110 + for_each_rmrr_units(rmrr) {
111 + ret = rmrr_parse_dev(rmrr);
120 @@ -407,8 +418,12 @@ int __init dmar_table_init(void)
124 - if (list_empty(&dmar_rmrr_units))
126 + if (list_empty(&dmar_rmrr_units)) {
127 printk(KERN_INFO PREFIX "No RMRR found\n");