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:	Mon, 29 Sep 2014 15:33:37 -0600
From:	Bjorn Helgaas <bhelgaas@...gle.com>
To:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:	Yinghai Lu <yinghai@...nel.org>, Liviu Dudau <Liviu.Dudau@....com>,
	Arnd Bergmann <arnd@...db.de>,
	Rob Herring <robh+dt@...nel.org>,
	Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <Will.Deacon@....com>,
	Russell King <linux@....linux.org.uk>,
	linux-pci <linux-pci@...r.kernel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Tanmay Inamdar <tinamdar@....com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Sinan Kaya <okaya@...eaurora.org>,
	Jingoo Han <jg1.han@...sung.com>,
	Kukjin Kim <kgene.kim@...sung.com>,
	Suravee Suthikulanit <suravee.suthikulpanit@....com>,
	linux-arch <linux-arch@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Device Tree ML <devicetree@...r.kernel.org>,
	LAKML <linux-arm-kernel@...ts.infradead.org>,
	Jiang Liu <jiang.liu@...ux.intel.com>
Subject: Re: [PATCH v13 10/12] PCI: Assign unassigned bus resources in pci_scan_root_bus()

On Mon, Sep 29, 2014 at 3:02 PM, Benjamin Herrenschmidt
<benh@...nel.crashing.org> wrote:
> On Mon, 2014-09-29 at 12:06 -0700, Yinghai Lu wrote:
>> On Mon, Sep 29, 2014 at 11:25 AM, Yinghai Lu <yinghai@...nel.org> wrote:
>> > On Mon, Sep 29, 2014 at 7:29 AM, Liviu Dudau <Liviu.Dudau@....com> wrote:
>> >> If the firmware has not assigned all the bus resources and we are not just
>> >> probing the PCI buses, it makes sense to assign the unassigned resources
>> >> in pci_scan_root_bus().
>> >>
>> >> Signed-off-by: Liviu Dudau <Liviu.Dudau@....com>
>> >> Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
>> >> CC: Arnd Bergmann <arnd@...db.de>
>> >> CC: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
>> >> CC: Rob Herring <robh+dt@...nel.org>
>> >> ---
>> >>  drivers/pci/probe.c | 3 +++
>> >>  1 file changed, 3 insertions(+)
>> >>
>> >> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>> >> index 636d1c9..d2ebd49 100644
>> >> --- a/drivers/pci/probe.c
>> >> +++ b/drivers/pci/probe.c
>> >> @@ -1951,6 +1951,9 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
>> >>         if (!found)
>> >>                 pci_bus_update_busn_res_end(b, max);
>> >>
>> >> +       if (!pci_has_flag(PCI_PROBE_ONLY))
>> >> +               pci_assign_unassigned_bus_resources(b);
>> >> +
>> >>         pci_bus_add_devices(b);
>> >>         return b;
>> >>  }
>> >
>> > No, you can not do it that early.
>> >
>> > On x86, we need to call
>> > pcibios_resource_survey_bus at first.
>>
>> on x86:
>> pcibios_init
>> pcibios_resource_survey()
>> pcibios_assign_resources() via fs_initcall
>
> Right and on powerpc and others as well. We need to survey existing
> resources. We also have a number of platform things that might need
> to happen before we do the final re-assignment pass.

That's true today.  But I don't know whether it *has* to be this way
forever.  On x86, pcibios_resource_survey() throws in E820 information
(which we know long before we do any PCI enumeration) and some IO-APIC
resources (it looks like we also know these before PCI enumeration).
Powerpc has pcibios_reserve_legacy_regions(), but that looks like
mostly stuff that could be done when we find the host bridge, before
we enumerate PCI devices below it.

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