Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3665417imu; Sun, 11 Nov 2018 20:57:47 -0800 (PST) X-Google-Smtp-Source: AJdET5dCq4CrZNU53f9zMojevltgD1dqPyhBh8CmY//zbmy5iuULpxna3ooWcBOU1V2lYKFmwlGj X-Received: by 2002:a65:5a8e:: with SMTP id c14mr16113054pgt.137.1541998667441; Sun, 11 Nov 2018 20:57:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541998667; cv=none; d=google.com; s=arc-20160816; b=xTEsOiAHOlUY2gxxl3zzZw3aJ4GUceKedHh0KODkYVNm3ksVZBQowelGqJNL1Kciuo 4Q80iRQ+b5FL00Mn1Tt3ODSpyKZZQx/QIfuomkZK/xwdMc9cLY66bcDbPrfo3ghjBprM JjWy3CnJELzkQbwhpq0PK8mS4lhb18pDLtn49VreDF6BgN25QXdhYRochbIrsAJtPTb7 BFNd+tZrq/rFqFtkzgW02jusi5kUyn3OnbucFtI9SWVl+5pEBut5kZIR/5fohiz2BD9a aNFESCRxfMBeFG2ujAO3DWH5qecSLI9jWlA2pbJeAQqdUE3tdoRe5CJokmb89pgvYiUj P/+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=S7vi/2JWxzqa4ArXFQvXlj6C1qIHhTFagvyOvSaQ+Nc=; b=zKUpLLPhvlWKpRVbMf86m+xIfAbWJoQ2rXs1Ml5y7I8Dnapt6VG7dZsSmYtF/D02kE q6FlPf0vLt/rAUOvY5nsAtSI/Efqm2/6C9kKkmZUv9Ta4xEzxTudKj8d4t51mEajpmsN uTO3DDofSO/Gh29/VBUiWaQ0Kb47DEGn5qnhh3nO/3nJMY5bfLFUSPT8X004KIZCqVOu quG8btNOkVyFDQJfW0VzuJtJBKiMrWpRbG/GABnp/Ys5yEop1PBiDQlB+8YujQU0hbD7 MPdCG6GeCZw6QoUBfppX2rLojZayf5VK4CR2+k7d6+Qd7vDAEQ3C+CGEUFGbq+SA5GNj Zrvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30-v6si17874115pla.56.2018.11.11.20.57.32; Sun, 11 Nov 2018 20:57:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730961AbeKLOsD (ORCPT + 99 others); Mon, 12 Nov 2018 09:48:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58080 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730779AbeKLOsD (ORCPT ); Mon, 12 Nov 2018 09:48:03 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0DE7308FBAA; Mon, 12 Nov 2018 04:56:34 +0000 (UTC) Received: from treble (ovpn-121-1.rdu2.redhat.com [10.10.121.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F44D19940; Mon, 12 Nov 2018 04:56:31 +0000 (UTC) Date: Sun, 11 Nov 2018 22:56:29 -0600 From: Josh Poimboeuf To: Ard Biesheuvel Cc: Steven Rostedt , Linux Kernel Mailing List , the arch/x86 maintainers , Andy Lutomirski , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov Subject: Re: [RFC PATCH 1/3] static_call: Add static call infrastructure Message-ID: <20181112045629.3gwex4ekeglfas64@treble> References: <3cf04e113d71c9f8e4be95fb84a510f085aa4afa.1541711457.git.jpoimboe@redhat.com> <20181109133337.63487e3a@gandalf.local.home> <20181109193505.5p5iddrtgpk2cpb4@treble> <20181109145746.0037da3f@gandalf.local.home> <20181109203459.wbftlkxcvfnwo2bm@treble> <20181110001023.57f27312@vmware.local.home> <20181110080917.29af5d66@vmware.local.home> <20181112030722.da5cxslvlmdgttsw@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 12 Nov 2018 04:56:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 12, 2018 at 05:39:38AM +0100, Ard Biesheuvel wrote: > On 12 November 2018 at 04:07, Josh Poimboeuf wrote: > > On Sat, Nov 10, 2018 at 08:09:17AM -0500, Steven Rostedt wrote: > >> On Sat, 10 Nov 2018 12:58:08 +0100 > >> Ard Biesheuvel wrote: > >> > >> > >> > > The complaint is on: > >> > > > >> > > DEFINE_STATIC_CALL(__tp_func_##name, __tracepoint_iter_##name); > >> > > > >> > > And the previous definition is on: > >> > > > >> > > DECLARE_STATIC_CALL(__tp_func_##name, __tracepoint_iter_##name); \ > >> > > > >> > > >> > Does the DECLARE really need the __ADDRESSABLE? Its purpose is to > >> > ensure that symbols with static linkage are not optimized away, but > >> > since the reference is from a header file, the symbol should have > >> > external linkage anyway. > > > > Yes, DECLARE needs the __ADDRESSABLE. In the case where DECLARE > > is used, but DEFINE is not, GCC strips the symbol. > > > > I assume DECLARE() is intended for use in header files, and DEFINE() > for source files, no? Right. > Doesn't that mean that whatever symbol __ADDRESSABLE() refers to > should have external linkage, in which case it it addressable anyway? > Or are we talking about some LTO / --gc-sections use case here? If the key is declared, but not used, GCC doesn't put the key's ELF symbol in the binary's symbol table. That makes objtool's life harder, because if the file has a call site, then objtool has to add the key symbol to the symbol table, so that it can create a relocation (in the call site table) which references the symbol. -- Josh