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: <CAE9FiQXXP8-5hNvKXuh5mu6Xu_9yFufmpZaXv0V95TwBBnxCpA@mail.gmail.com>
Date:	Wed, 21 Oct 2015 11:16:53 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	Bjorn Helgaas <helgaas@...nel.org>
Cc:	Bjorn Helgaas <bhelgaas@...gle.com>,
	David Miller <davem@...emloft.net>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Wei Yang <weiyang@...ux.vnet.ibm.com>, TJ <linux@....tj>,
	Yijing Wang <wangyijing@...wei.com>,
	Khalid Aziz <khalid.aziz@...cle.com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

On Tue, Oct 20, 2015 at 7:35 PM, Bjorn Helgaas <helgaas@...nel.org> wrote:
> On Tue, Oct 20, 2015 at 03:30:44PM -0700, Yinghai Lu wrote:
> I doubt I would agree with a change like this, but maybe, if you can
> explain what's unique about the sparc architecture that would require
> a change like this.

Then how about this one ?

otherwise we need to compare res with pbm->mem_space or pbm->mem64_space
to get direct parent for request_resource_conflict() calling in
pci_register_legacy_regions().

also check if if return is NULL to decide if it is valid region.
---
 drivers/pci/host-bridge.c |   10 +++++++++-
 include/linux/pci.h       |    5 +++--
 2 files changed, 12 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/pci/host-bridge.c
===================================================================
--- linux-2.6.orig/drivers/pci/host-bridge.c
+++ linux-2.6/drivers/pci/host-bridge.c
@@ -70,12 +70,17 @@ static bool region_contains(struct pci_b
     return region1->start <= region2->start && region1->end >= region2->end;
 }

-void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
+/*
+ * return host bridge window resource
+ */
+struct resource *pcibios_bus_to_resource(struct pci_bus *bus,
+                 struct resource *res,
                  struct pci_bus_region *region)
 {
     struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
     struct resource_entry *window;
     resource_size_t offset = 0;
+    struct resource *res_ret = NULL;

     resource_list_for_each_entry(window, &bridge->windows) {
         struct pci_bus_region bus_region;
@@ -88,11 +93,14 @@ void pcibios_bus_to_resource(struct pci_

         if (region_contains(&bus_region, region)) {
             offset = window->offset;
+            res_ret = window->res;
             break;
         }
     }

     res->start = region->start + offset;
     res->end = region->end + offset;
+
+    return res_ret;
 }
 EXPORT_SYMBOL(pcibios_bus_to_resource);
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -781,8 +781,9 @@ void pci_fixup_cardbus(struct pci_bus *)

 void pcibios_resource_to_bus(struct pci_bus *bus, struct
pci_bus_region *region,
                  struct resource *res);
-void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
-                 struct pci_bus_region *region);
+struct resource *pcibios_bus_to_resource(struct pci_bus *bus,
+                     struct resource *res,
+                     struct pci_bus_region *region);
 void pcibios_scan_specific_bus(int busn);
 struct pci_bus *pci_find_bus(int domain, int busnr);
 void pci_bus_add_devices(const struct pci_bus *bus);
--
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