lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291677875-30493-17-git-send-email-konrad.wilk@oracle.com>
Date:	Mon,  6 Dec 2010 18:24:28 -0500
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	airlied@...ux.ie, tglx@...utronix.de, hpa@...or.com,
	airlied@...hat.com, linux-kernel@...r.kernel.org, konrad@...nel.org
Cc:	Jeremy Fitzhardinge <jeremy@...p.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: [PATCH 16/23] agp: save the size of GATT table.

From: Konrad Rzeszutek Wilk <konrad@...nel.org>

We need this extra value when we use the PCI API for 
de-allocating the GART pages.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
---
 drivers/char/agp/agp.h     |    1 +
 drivers/char/agp/generic.c |   10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
index 6c60d68..6569d01 100644
--- a/drivers/char/agp/agp.h
+++ b/drivers/char/agp/agp.h
@@ -133,6 +133,7 @@ struct agp_bridge_data {
 	struct pci_dev *dev;
 	u32 __iomem *gatt_table;
 	u32 *gatt_table_real;
+	ssize_t gatt_table_size;
 	unsigned long scratch_page;
 	struct page *scratch_page_page;
 	dma_addr_t scratch_page_dma;
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index 4cf3f94..b21eebb 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -974,14 +974,14 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
 	if (table == NULL)
 		return -ENOMEM;
 
-	table_end = table + ((PAGE_SIZE * (1 << page_order)) - 1);
+	bridge->gatt_table_size = PAGE_SIZE * (1 << page_order);
+	table_end = table + bridge->gatt_table_size - 1;
 
 	for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
 		SetPageReserved(page);
 
 	bridge->gatt_table_real = (u32 *) table;
 	agp_gatt_table = (void *)table;
-
 	bridge->driver->cache_flush();
 #ifdef CONFIG_X86
 	if (set_memory_uc((unsigned long)table, 1 << page_order))
@@ -990,7 +990,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
 	bridge->gatt_table = (void *)table;
 #else
 	bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
-					(PAGE_SIZE * (1 << page_order)));
+					bridge->gatt_table_size);
 	bridge->driver->cache_flush();
 #endif
 
@@ -1055,7 +1055,7 @@ int agp_generic_free_gatt_table(struct agp_bridge_data *bridge)
 	iounmap(bridge->gatt_table);
 #endif
 	table = (char *) bridge->gatt_table_real;
-	table_end = table + ((PAGE_SIZE * (1 << page_order)) - 1);
+	table_end = table + bridge->gatt_table_size - 1;
 
 	for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
 		ClearPageReserved(page);
@@ -1066,7 +1066,7 @@ int agp_generic_free_gatt_table(struct agp_bridge_data *bridge)
 	bridge->gatt_table = NULL;
 	bridge->gatt_table_real = NULL;
 	bridge->gatt_bus_addr = 0;
-
+	bridge->gatt_table_size = 0;
 	return 0;
 }
 EXPORT_SYMBOL(agp_generic_free_gatt_table);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ