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]
Date:	Thu, 27 Dec 2012 13:47:22 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Yinghai Lu <yinghai@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Tony Luck <tony.luck@...el.com>,
	"H. Peter Anvin" <hpa@...or.com>, Jiang Liu <liuj97@...il.com>,
	Myron Stowe <myron.stowe@...hat.com>
Subject: Re: [Alternative][PATCH] ACPI / PCI: Set root bridge ACPI handle in advance

On Wednesday, December 26, 2012 04:10:32 PM Yinghai Lu wrote:
> On Wed, Dec 26, 2012 at 2:36 PM, Rafael J. Wysocki <rjw@...k.pl> wrote:
> > On Wednesday, December 26, 2012 12:41:05 PM Yinghai Lu wrote:
> >> On Wed, Dec 26, 2012 at 12:16 PM, Yinghai Lu <yinghai@...nel.org> wrote:
> >> > On Wed, Dec 26, 2012 at 12:10 PM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> >> >> Do you have a reference for this?  I think this might have been true
> >> >> in the past, but I don't think it's true for any version of gcc we
> >> >> support for building Linux.
> >> >
> >> > http://lkml.indiana.edu/hypermail/linux/kernel/0804.3/3600.html
> >>
> >> the problem is already addressed by:
> >>
> >> | commit f9d14250071eda9972e4c9cea745a11185952114
> >> | Author: Linus Torvalds <torvalds@...ux-foundation.org>
> >> | Date:   Fri Jan 2 09:29:43 2009 -0800
> >> |
> >> |    Disallow gcc versions 4.1.{0,1}
> >> |
> >> |    These compiler versions are known to miscompile __weak functions and
> >> |    thus generate kernels that don't necessarily work correctly.  If a weak
> >> |    function is int he same compilation unit as a caller, gcc may end up
> >> |    inlining it, and thus binding the weak function too early.
> >> |
> >> |    See
> >> |
> >> |        http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781
> >> |
> >> |    for details.
> >>
> >> so it is ok to put the __weak in the same file now.
> >
> > Cool, thanks for checking and for the ACK!
> 
> wait, we have some problem on systems that root bus is not exported via DSDT ...
> 
> one of my nehalem system that have uncore cpu devices are not exported via ACPI.
> 
> also there will be problem that system is booting with acpi=off.
> 
> 
> +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
> +{
> +       struct pci_sysdata *sd = bridge->bus->sysdata;
> +       struct pci_root_info *info = container_of(sd, struct pci_root_info, sd);
> +
> +       ACPI_HANDLE_SET(&bridge->dev, info->bridge->handle);
> +       return 0;
> +}
> 
> will get wrong info...via sd... as their sd is standalone

Yes, it will be called in all code paths leading to acpi_create_root_bus(),
not only the ones started by pci_acpi_scan_root().  Well, too bad.

By the way, that illustrates nicely why I generally have concerns about __weak
stuff and similar tricks.

Bjorn, I had tried to use the approach you suggested, but it didn't work.
I thought about fixing that, but everything I could come up with turned out to
be too complicated, so I'm inclined to use the previous version after all:

https://patchwork.kernel.org/patch/1889221/

that has been acked by Yinghai, Greg and Peter already.

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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