From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E887C433DF for ; Fri, 17 Jul 2020 20:27:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1719220684 for ; Fri, 17 Jul 2020 20:27:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YzG6fbNW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="s3QH/t9o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1719220684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID:Subject:To:From: Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=DMahkuV62HnNyyH/b7oT3I2FvROwzdx/buwfhj0asps=; b=YzG6fbNWT9WND26f8ucDPRXUa s1zAycItJ3X6w3IMWu8p/1GmRsNrvoIi4zu05gTv1PDrChXCsBPClMYY19E7Q72MH0sDeCwdJqt+r PCHBO0VIGtFsYQVvbL0y43t48vZCYsJmzOECfDm9pAX5OJ+02Mrv+bu0HghdxXLPWuVRMR1pKzfg/ REqYVObOqynjSa/o1ltsPqKFiGwoPqPH6brBrDNQYo2H5MNJfSzC8faYnYOwY67H0kYST8g3pi81a C9VsH82xljAwNULu7QzKzNLfj8CPCYT0vC2oVkc3GbcizzXBz4GdYYvYTqnlIV5avPwV794pWCrp+ SOgfdIJQw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwWw6-0000jn-0k; Fri, 17 Jul 2020 20:26:27 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwWw3-0000iF-AD for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2020 20:26:24 +0000 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9C36A20684; Fri, 17 Jul 2020 20:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595017582; bh=/hYopkLccKkwFpSirohLu9rK4PERmsXifMkvfY8na74=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=s3QH/t9ocNHEPH2/jvWRB8qEQKIK64CQ+GlRWp8yjZLbWaD3J5hfVQ80kDY7xshpH xeiUCkt/Irn0dwJ5rev9qj5TqMu055YbwJsqTl3kaW+lblQMHHzeP7vMEYgEstIATL o2+gGzz8bNJr4YllTtvOL6MhViMZk5u3gpLyaYYU= Date: Fri, 17 Jul 2020 15:26:20 -0500 From: Bjorn Helgaas To: Sami Tolvanen Subject: Re: [PATCH 11/22] pci: lto: fix PREL32 relocations Message-ID: <20200717202620.GA768846@bjorn-Precision-5520> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624203200.78870-12-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200717_162623_531217_5378196A X-CRM114-Status: GOOD ( 17.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, Kees Cook , "Paul E. McKenney" , kernel-hardening@lists.openwall.com, Greg Kroah-Hartman , Masahiro Yamada , linux-kbuild@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, linux-pci@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org OK by me, but please update the subject to match convention: PCI: Fix PREL32 relocations for LTO and include a hint in the commit log about what LTO is. At least expand the initialism once. Googling for "LTO" isn't very useful. With Clang's Link Time Optimization (LTO), the compiler ... ? On Wed, Jun 24, 2020 at 01:31:49PM -0700, Sami Tolvanen wrote: > With LTO, the compiler can rename static functions to avoid global > naming collisions. As PCI fixup functions are typically static, > renaming can break references to them in inline assembly. This > change adds a global stub to DECLARE_PCI_FIXUP_SECTION to fix the > issue when PREL32 relocations are used. > > Signed-off-by: Sami Tolvanen Acked-by: Bjorn Helgaas > --- > include/linux/pci.h | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/include/linux/pci.h b/include/linux/pci.h > index c79d83304e52..1e65e16f165a 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -1909,19 +1909,24 @@ enum pci_fixup_pass { > }; > > #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS > -#define __DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ > - class_shift, hook) \ > - __ADDRESSABLE(hook) \ > +#define ___DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ > + class_shift, hook, stub) \ > + void stub(struct pci_dev *dev) { hook(dev); } \ > asm(".section " #sec ", \"a\" \n" \ > ".balign 16 \n" \ > ".short " #vendor ", " #device " \n" \ > ".long " #class ", " #class_shift " \n" \ > - ".long " #hook " - . \n" \ > + ".long " #stub " - . \n" \ > ".previous \n"); > + > +#define __DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ > + class_shift, hook, stub) \ > + ___DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ > + class_shift, hook, stub) > #define DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ > class_shift, hook) \ > __DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ > - class_shift, hook) > + class_shift, hook, __UNIQUE_ID(hook)) > #else > /* Anonymous variables would be nice... */ > #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ > -- > 2.27.0.212.ge8ba1cc988-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel