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: <4BC39FAF.4030808@oracle.com>
Date:	Mon, 12 Apr 2010 15:33:19 -0700
From:	Yinghai <yinghai.lu@...cle.com>
To:	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>
CC:	Andy Isaacson <adi@...apodia.org>, Yinghai <yinghai.lu@...cle.com>,
	guenter.roeck@...csson.com,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Bjorn Helgaas <bjorn.helgaas@...com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Thomas Renninger <trenn@...e.de>
Subject: [PATCH -v2 2/2] x86,pci, acpi: Inherent BUSY flag when setup_resource
 for root bus


So make pci root resource from _CRS honor the range We reserve in e820 below 1M
then  will not assign them to unsigned pci BAR

-v2: let pci_bus_alloc_resource() honor IORESOURCE_BUSY
     driver can not use those range, so skip it

Tested-by: Andy Isaacson <adi@...apodia.org>
Cc: Bjorn Helgaas <bjorn.helgaas@...com>
Signed-off-by: Yinghai Lu <yinghai@...nel.org>

---
 arch/x86/pci/acpi.c |    4 ++++
 drivers/pci/bus.c   |    4 ++++
 2 files changed, 8 insertions(+)

Index: linux-2.6/arch/x86/pci/acpi.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/acpi.c
+++ linux-2.6/arch/x86/pci/acpi.c
@@ -175,6 +175,10 @@ setup_resource(struct acpi_resource *acp
 			"conflicts with %s %pR\n",
 			res, conflict->name, conflict);
 	} else {
+		/* In case it falls in big reserved region */
+		if (res->parent->flags & IORESOURCE_BUSY)
+			res->flags |= IORESOURCE_BUSY;
+
 		pci_bus_add_resource(info->bus, res, 0);
 		info->res_num++;
 		if (addr.translation_offset)
Index: linux-2.6/drivers/pci/bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/bus.c
+++ linux-2.6/drivers/pci/bus.c
@@ -103,6 +103,10 @@ pci_bus_alloc_resource(struct pci_bus *b
 		if (!r)
 			continue;
 
+		/* Driver can not reserve it later, so don't use it */
+		if (r->flags & IORESOURCE_BUSY)
+			continue;
+
 		/* type_mask must match */
 		if ((res->flags ^ r->flags) & type_mask)
 			continue;
--
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