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] [day] [month] [year] [list]
Date:	Wed, 26 Jun 2013 01:07:53 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Gavin Shan <shangw@...ux.vnet.ibm.com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 3/7] PCI: Use pci_walk_bus to detect unassigned resources

On Tue, Jun 25, 2013 at 2:46 PM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> On Tue, Jun 25, 2013 at 3:38 PM, Benjamin Herrenschmidt
> <benh@...nel.crashing.org> wrote:
>> On Tue, 2013-06-25 at 15:15 -0600, Bjorn Helgaas wrote:
>>> -     for_each_pci_dev(dev) {
>>> > -             int i;
>>> > +             /* Not assigned, or rejected by kernel ? */
>>> > +             if (r->flags && !r->start) {
>>> > +                     (*unassigned)++;
>>> > +                     return 1; /* return early from pci_walk_bus */
>>> > +             }
>>> > +     }
>>
>> BTW. I'm aware you didn't change that logic but ... it's somewhat broken
>> in the case where the aperture has an offset. You should compare
>> r->start with the offset, not with 0.
>
> Yes, please fix that in a separate patch that contains only the bugfix.

Please check inline word warped patch.

Subject: [PATCH] PCI: check pci bus address for unassigned res

We should compare res->start with root bus window offset.
Otherwise will have problem with arch that support hostbridge
resource offset.

BenH pointed out that during reviewing patchset that separate
assign unassigned to per root buses.

According to Bjorn, have it in separated patch.

Use pcibios_resource_to_bus to get region at first, and check
region.start instead.

Suggested-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Signed-off-by: Yinghai Lu <yinghai@...nel.org>

---
 drivers/pci/setup-bus.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/pci/setup-bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/setup-bus.c
+++ linux-2.6/drivers/pci/setup-bus.c
@@ -1420,9 +1420,14 @@ static int check_unassigned_resources(st

     for (i = PCI_IOV_RESOURCES; i <= PCI_IOV_RESOURCE_END; i++) {
         struct resource *r = &dev->resource[i];
+        struct pci_bus_region region;

         /* Not assigned, or rejected by kernel ? */
-        if (r->flags && !r->start) {
+        if (!r->flags)
+            continue;
+
+        pcibios_resource_to_bus(dev, &region, res);
+        if (!region.start) {
             (*unassigned)++;
             return 1; /* return early from pci_walk_bus */
         }

Download attachment "root_bus_ioport_skip_2_a.patch" of type "application/octet-stream" (1300 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ