Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2264412ybh; Fri, 17 Jul 2020 13:26:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBV3IISdEBQgtLgQFoijng+yObylXG4kdfiwe7FmOsyza8mfFnLg2WTxwWCtOZWOoWWXYf X-Received: by 2002:aa7:d8cf:: with SMTP id k15mr10592043eds.250.1595017618176; Fri, 17 Jul 2020 13:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595017618; cv=none; d=google.com; s=arc-20160816; b=W6kWGtwo3cPStXYbpXEkpS+OSGIK6919sGEt2W/gW/PjADOAUvNdCdie7BdMNYeyU4 lfhD3YFhHGDSf6btypYbv6ObZ8kSLEQIrIoLYRbtsPdqsIqc9KtH2dHG5ddbIwy8lFtx CfarvXRGt+HCZQMxSsb40F659lyt0M8aoebql+IlwM2pwo+FFNNoQKwwcndNhC4MRg66 5Z5AcBN5J496Qo7poWAw1qX/0Dppbd18uop8vAT2jbHqVAxkE3/S2uOFwoixvWwULS84 gC2iwopfG4KOzCIw8zZx6kcKCyHTNfJsrzTQp6CbKFDmE1Pe3+enC6eCuMn1xE0aFzMD KKWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=ZeWYikZRZ4/ILnJpoE0SEfTW30ZOC4tgAVPk3LEeH2E=; b=y8hfXGwHWbTSLs+OlNsWd279lYLEBeVQ+tcDmsishpPjp0Oun90bDqq4qfrLlonMTn PeyeLQzRT10OTQvzuNxRbvFmIns9583tyo0bnrn779LmioduZz+z1O744c+BKmCXU8Zu bajAPS+QgKmsicjdpW/icx4mUIgVK9m7p9GawTxwUHEuS85p0ZVxR3QLxiQ7Sh6nVaki uL4QNLNTQdts+nugM3KllWBTxW6HDWUo75ECSU47ek5m2bxo5az+YuJSZZui+YTlqHHZ Qlpcm4+uSP8a0i5sShtZwRqcxQpcYubb62+RQ1BK7UgYWrVASyA83QomGGpOOS+EN3SA AgIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="s3QH/t9o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df18si5818851edb.501.2020.07.17.13.26.35; Fri, 17 Jul 2020 13:26:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="s3QH/t9o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbgGQU0X (ORCPT + 99 others); Fri, 17 Jul 2020 16:26:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:32944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgGQU0W (ORCPT ); Fri, 17 Jul 2020 16:26:22 -0400 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 Cc: Masahiro Yamada , Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 11/22] pci: lto: fix PREL32 relocations Message-ID: <20200717202620.GA768846@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624203200.78870-12-samitolvanen@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 >