Skip to contentSkip to conversation

x86/pci: fix dmar_tbl early_ioremap leak v2

PATCH In review Yinghai Lu 7 participants 8 messages Sep 25, 2008 – Sep 27, 2008 PCI

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86/pci: fix dmar_tbl early_ioremap leak v2

use early_acpi_os_unmap_memory

v2: move unmap_memory early...

---
 drivers/pci/dmar.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/pci/dmar.c +7 -2
Index: linux-2.6/drivers/pci/dmar.c
===================================================================
@@ -42,6 +42,7 @@
 LIST_HEAD(dmar_drhd_units);
 
 static struct acpi_table_header * __initdata dmar_tbl;
+static acpi_size __initdata dmar_tbl_size;
 
 static void __init dmar_register_drhd_unit(struct dmar_drhd_unit *drhd)
 {
@@ -297,8 +298,9 @@ static int __init dmar_table_detect(void
 	acpi_status status = AE_OK;
 
 	/* if we could find DMAR table, then there are DMAR devices */
-	status = acpi_get_table(ACPI_SIG_DMAR, 0,
-				(struct acpi_table_header **)&dmar_tbl);
+	status = acpi_get_table_with_size(ACPI_SIG_DMAR, 0,
+				(struct acpi_table_header **)&dmar_tbl,
+				&dmar_tbl_size);
 
 	if (ACPI_SUCCESS(status) && !dmar_tbl) {
 		printk (KERN_WARNING PREFIX "Unable to map DMAR\n");
@@ -493,6 +495,9 @@ void __init detect_intel_iommu(void)
 	}
 end:
 #endif
+	if (dmar_tbl)
+		early_acpi_os_unmap_memory(dmar_tbl, dmar_tbl_size);
+
 	dmar_tbl = NULL;
 }
 
#1 lore raw
Quoted 9 lines · Yinghai Lu

use early_acpi_os_unmap_memory

v2: move unmap_memory early...

---
 drivers/pci/dmar.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

since this depends on other x2apic/sparseirq changes in -tip i've applied it to tip/irq/sparseirq.

Jesse, any objections?

Ingo

#2 lore raw
Quoted 7 lines · Ingo Molnar
Quoted 6 lines · Yinghai Lu

use early_acpi_os_unmap_memory

v2: move unmap_memory early...

Quoted 8 lines
Quoted 3 lines
---
 drivers/pci/dmar.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

since this depends on other x2apic/sparseirq changes in -tip i've applied it to tip/irq/sparseirq.

Jesse, any objections?

Nope, but it would be good to get Dave or Mark's ack (Dave owns this code now).

Jesse

#3 lore raw
Quoted 12 lines · Jesse Barnes
Quoted 11 lines · Ingo Molnar
Quoted 9 lines · Yinghai Lu

use early_acpi_os_unmap_memory

v2: move unmap_memory early...

---
 drivers/pci/dmar.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Quoted 7 lines
Quoted 4 lines

since this depends on other x2apic/sparseirq changes in -tip i've applied it to tip/irq/sparseirq.

Jesse, any objections?

Nope, but it would be good to get Dave or Mark's ack (Dave owns this code now).

I own the code in theory, but am not yet sufficiently competent.

My VT-d hardware arrived just before I left the country for KS+LPC, so is gathering dust in my absence. I get home this weekend.

_Next_ week, if you see me thinking about _anything_ other than the IOMMU, please slap me.

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
#4 lore raw
In reply to Jesse Barnes
Quoted 12 lines · Jesse Barnes
Quoted 11 lines · Ingo Molnar
Quoted 9 lines · Yinghai Lu

use early_acpi_os_unmap_memory

v2: move unmap_memory early...

---
 drivers/pci/dmar.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Quoted 8 lines
Quoted 4 lines

since this depends on other x2apic/sparseirq changes in -tip i've applied it to tip/irq/sparseirq.

Jesse, any objections?

Nope, but it would be good to get Dave or Mark's ack (Dave owns this code now).

Sorry for the dumb question but where is acpi_get_table_with_size defined? Its not in linus's git. /me goes and gets linux-next...

--mgross

#5 lore raw
Quoted 16 lines · mark gross
Quoted 15 lines · Jesse Barnes
Quoted 14 lines · Ingo Molnar
Quoted 9 lines · Yinghai Lu

use early_acpi_os_unmap_memory

v2: move unmap_memory early...

---
 drivers/pci/dmar.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

since this depends on other x2apic/sparseirq changes in -tip i've applied it to tip/irq/sparseirq.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Jesse, any objections?

Nope, but it would be good to get Dave or Mark's ack (Dave owns this code now).

Sorry for the dumb question but where is acpi_get_table_with_size defined? Its not in linus's git. /me goes and gets linux-next...

in tip/master

YH

#6 lore raw
Quoted 19 lines · Yinghai Lu
Quoted 18 lines · mark gross
Quoted 17 lines · Jesse Barnes
Quoted 15 lines · Ingo Molnar
Quoted 9 lines · Yinghai Lu

use early_acpi_os_unmap_memory

v2: move unmap_memory early...

---
 drivers/pci/dmar.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

since this depends on other x2apic/sparseirq changes in -tip i've applied it to tip/irq/sparseirq.

Jesse, any objections?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Nope, but it would be good to get Dave or Mark's ack (Dave owns this code now).

Sorry for the dumb question but where is acpi_get_table_with_size defined? Its not in linus's git. /me goes and gets linux-next...

in tip/master

access coordinates:

http://people.redhat.com/mingo/tip.git/README

Ingo