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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Jan 2010 14:46:35 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	Bjorn Helgaas <bjorn.helgaas@...com>
CC:	Jeff Garrett <jeff@...rrett.org>, linux-kernel@...r.kernel.org,
	Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	linux-pci@...r.kernel.org, David Airlie <airlied@...ux.ie>
Subject: [PATCH] x86/pci: intel ioh need to subtract mmconf range



Bjorn pointed out we need to remove mmconf range

Signed-off-by: Yinghai Lu <yinghai@...nel.org>

---
 arch/x86/pci/intel_bus.c |   29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/x86/pci/intel_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/intel_bus.c
+++ linux-2.6/arch/x86/pci/intel_bus.c
@@ -46,6 +46,20 @@ static inline void print_ioh_resources(s
 
 #define RANGE_NUM 16
 
+static void __devinit subtract_mmconf(struct range *range, int nr)
+{
+#ifdef CONFIG_PCI_MMCONFIG
+	struct pci_mmcfg_region *cfg;
+
+	if (list_empty(&pci_mmcfg_list))
+		return;
+
+        list_for_each_entry(cfg, &pci_mmcfg_list, list)
+		subtract_range(range, nr, cfg->res.start,
+			 cfg->res.end + 1);
+#endif
+}
+
 static void __devinit pci_root_bus_res(struct pci_dev *dev)
 {
 	u16 word;
@@ -96,6 +110,7 @@ static void __devinit pci_root_bus_res(s
 
 		subtract_range(range, RANGE_NUM, vt_base, vt_end + 1);
 	}
+	subtract_mmconf(range, RANGE_NUM);
 	for (i = 0; i < RANGE_NUM; i++) {
 		if (!range[i].end)
 			continue;
@@ -112,8 +127,18 @@ static void __devinit pci_root_bus_res(s
 	mmioh_base |= ((u64)(dword & 0x7ffff)) << 32;
 	pci_read_config_dword(dev, IOH_LMMIOH_LIMITU, &dword);
 	mmioh_end |= ((u64)(dword & 0x7ffff)) << 32;
-	update_res(info, cap_resource(mmioh_base), cap_resource(mmioh_end),
-			 IORESOURCE_MEM, 0);
+	memset(range, 0, sizeof(range));
+	add_range(range, RANGE_NUM, 0, mmioh_base, mmioh_end + 1);
+	/* mmconf could be above 4g */
+	subtract_mmconf(range, RANGE_NUM);
+	for (i = 0; i < RANGE_NUM; i++) {
+		if (!range[i].end)
+			continue;
+
+		update_res(info, cap_resource(range[i].start),
+			   cap_resource(range[i].end - 1),
+			   IORESOURCE_MEM, 0);
+	}
 
 	print_ioh_resources(info);
 }
--
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