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: <CAOfQC9_S9q9fE6VyDaLseUFZD_GxZcEOYw8YsvRWkr9-2S=RRQ@mail.gmail.com>
Date:	Thu, 25 Aug 2011 14:56:15 +0800
From:	Deng-Cheng Zhu <dengcheng.zhu@...il.com>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	jbarnes@...tuousgeek.org, ralf@...ux-mips.org,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-mips@...ux-mips.org, eyal@...s.com, zenon@...s.com
Subject: Re: [RFC PATCH 2/3] PCI: Pass available resources into pci_create_bus()

2011/8/24 Bjorn Helgaas <bhelgaas@...gle.com>:
> I like this approach a lot.  Thanks for working it up.  It's a nice
> small change with very little impact to other architectures, and you
> have a nice clear changelog.  You might mention something about the
> fact that by default, the bus starts out with all of ioport_resource
> and iomem_resource -- that will mean something to people who know how
> host bridges work.

Thanks! And I'll add this info to the patch description.

> Using pci_bus_add_resource() here *seems* like it should be the right
> thing, but I don't think it will work correctly.
>
> The problem is that struct pci_bus has both a table of resources
> (bus->resource[]) *and* a list (bus->resources).
> pci_bus_add_resource() always puts the new resource on the list, but
> various arch code still references the table directly, e.g., sparc has
> "pbus->resource[0] = &pbm->io_space" in pcibios_fixup_bus().
>
> As written, I think this patch will break sparc because the host
> bridge will end up with both pbm->io_space (in the table) and
> ioport_resource (in the list).

Good catch! I overlooked this point.

> I think something like this would work, though:
>
>    if (bus_res)
>        list_add_tail(&b->resources, &bus_res->list);
>    else {
>        b->resource[0] = &ioport_resource;
>        b->resource[1] = &iomem_resource;
>    }

Yes, it should work.


Thanks again for your time,

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