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: <CAErSpo5tZU=zBKNDt2UtUE_AMG3zzrdq2CX2A4ZL7tdLELXgqA@mail.gmail.com>
Date:	Tue, 9 Dec 2014 14:53:20 -0700
From:	Bjorn Helgaas <bhelgaas@...gle.com>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Gavin Shan <gwshan@...ux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Marek Kordík <kordikmarek@...il.com>,
	Alexey Voronkov <zermond@...il.com>,
	Wei Yang <weiyang@...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] PCI: Clear all bridge res MEM_64 if host bridge has non mem64

On Tue, Dec 9, 2014 at 2:34 PM, Yinghai Lu <yinghai@...nel.org> wrote:
> So we could use bridge 64bit mem pref for children mem pref instead of
> forcing them into bridge mem.
>
> Could help Marek's system as his system is using _CRS, and all mem res is under
> 4G.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=85491
> Reported-by: Marek Kordik <kordikmarek@...il.com>
> Fixes: 5b28541552ef ("PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources")
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
>
> ---
>  drivers/pci/host-bridge.c |    7 +++++++
>  drivers/pci/pci.h         |    1 +
>  drivers/pci/probe.c       |    9 +++++++++
>  drivers/pci/setup-bus.c   |    3 +++
>  include/linux/pci.h       |    1 +
>  5 files changed, 21 insertions(+)
>
> 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
> @@ -31,6 +31,13 @@ void pci_set_host_bridge_release(struct
>         bridge->release_data = release_data;
>  }
>
> +bool pcibios_host_bridge_has_mem64_res(struct pci_bus *bus)
> +{
> +       struct pci_host_bridge *bridge = find_pci_host_bridge(bus);
> +
> +       return bridge->has_mem64_res;
> +}
> +
>  void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
>                              struct resource *res)
>  {
> Index: linux-2.6/drivers/pci/pci.h
> ===================================================================
> --- linux-2.6.orig/drivers/pci/pci.h
> +++ linux-2.6/drivers/pci/pci.h
> @@ -196,6 +196,7 @@ enum pci_bar_type {
>         pci_bar_mem64,          /* A 64-bit memory BAR */
>  };
>
> +bool pcibios_host_bridge_has_mem64_res(struct pci_bus *bus);
>  bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl,
>                                 int crs_timeout);
>  int pci_setup_device(struct pci_dev *dev);
> Index: linux-2.6/drivers/pci/probe.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/probe.c
> +++ linux-2.6/drivers/pci/probe.c
> @@ -1980,6 +1980,15 @@ struct pci_bus *pci_create_root_bus(stru
>                 dev_info(&b->dev, "root bus resource %pR%s\n", res, bus_addr);
>         }
>
> +       list_for_each_entry(window, &bridge->windows, list) {
> +               res = window->res;
> +               if (resource_type(res) == IORESOURCE_MEM ||
> +                   res->end > 0xffffffff) {
> +                       bridge->has_mem64_res = true;

This is an interesting idea, but I think you're checking CPU addresses
here, and you need to check PCI bus addresses.

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