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, 27 Mar 2008 10:17:41 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>,
	Gary Hade <garyhade@...ibm.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Meyer <thomas@...3r.de>,
	Stefan Richter <stefanr@...6.in-berlin.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	LKML <linux-kernel@...r.kernel.org>,
	Adrian Bunk <bunk@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Natalie Protasevich <protasnb@...il.com>, pm@...ian.org
Subject: Re: [patch] pci: revert "PCI: remove transparent bridge sizing"


On Wed, 2008-03-26 at 22:47 +0000, Alan Cox wrote:
> > I dunno. I'm not going to do anything in this area before 2.6.25 is out 
> > because this *does* make me a bit nervous, but if somebody wants to think 
> > about this and perhaps write patches for testing, that would be good.
> 
> One way to kill off some of the assumptions and gunge would be to add
> pci_resource_assigned(resource) [or indeed just resource_assigned()].
> Iomap has similar problems - we have no portable defined "not mapped" at
> the moment, although we use NULL technically mmio maps of 0 end up at 0
> in the implementation today.

There is IORESOURCE_UNSET... We could use that. I use it to some extent
on powerpc but x86 doesn't. Though I remember spotting a code path in
setup-res.c will not clear it when actually assigning the resource to a
bus. I can't remember if that hits in practice tho. I have a patch
anyway :-)

----
[PATCH] pci: Make pci_assign_resource always clear IORESOURCE_UNSET

For bus resources pci_assign_resrouce() needs to also clear
IORESOURCE_UNSET. (For device resources, it's handled by
pci_update_resource).

Signed-off-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>
---

Index: linux-merge/drivers/pci/setup-res.c
===================================================================
--- linux-merge.orig/drivers/pci/setup-res.c	2007-12-13 13:06:27.000000000 +1100
+++ linux-merge/drivers/pci/setup-res.c	2007-12-13 13:06:50.000000000 +1100
@@ -167,7 +167,8 @@ int pci_assign_resource(struct pci_dev *
 			(unsigned long long)res->start, pci_name(dev));
 	} else if (resno < PCI_BRIDGE_RESOURCES) {
 		pci_update_resource(dev, res, resno);
-	}
+	} else
+		res->flags &= ~IORESOURCE_UNSET;
 
 	return ret;
 }


--
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