From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935296AbcJUQSF (ORCPT ); Fri, 21 Oct 2016 12:18:05 -0400 Received: from smtprelay0190.hostedemail.com ([216.40.44.190]:39412 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934884AbcJUQSE (ORCPT ); Fri, 21 Oct 2016 12:18:04 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2559:2562:2693:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:6261:10004:10400:10848:11026:11473:11658:11914:12043:12114:12296:12438:12555:12679:12760:13439:14093:14097:14181:14659:14721:21080:21220:21433:21451:30029:30036:30054,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: foot89_632a1f726781e X-Filterd-Recvd-Size: 2877 Date: Fri, 21 Oct 2016 12:17:59 -0400 From: Steven Rostedt To: LKML , Al Viro Cc: Borislav Petkov , Thomas Gleixner , Ingo Molnar , Gabriel C , npiggin@gmail.com Subject: [RFC][PATCH] Add EXPORT_MACRO_SYMBOL() for asm Message-ID: <20161021121759.74a635db@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 784d5699eddc5 ("x86: move exports to actual definitions") removed the EXPORT_SYMBOL(__fentry__) and EXPORT_SYMBOL(mcount) from x8664_ksyms_64.c, and added EXPORT_SYMBOL(function_hook) in mcount_64.S instead. The problem is that function_hook isn't a function at all, but a macro that is defined as eithe mcount or __fentry__ depending on the support from gcc. But instead of adding more #ifdefs like x8684_ksyms_64.c had, I suggest having another export that can handle this similar to the way __string() works with converting macros to strings. By having: EXPORT_MACRO_SYMBOL(function_hook) Where we have: #define EXPORT_MACRO_SYMBOL(x) EXPORT_SYMBOL(x) It will convert the macro into what it is defined as before calling EXPORT_SYMBOL(), and this will just work properly again. Cc: stable@vger.kernel.org Fixes: Commit 784d5699eddc5 ("x86: move exports to actual definitions") Signed-off-by: Steven Rostedt --- arch/x86/kernel/mcount_64.S | 2 +- include/asm-generic/export.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S index efe73aacf966..ccd9d912af27 100644 --- a/arch/x86/kernel/mcount_64.S +++ b/arch/x86/kernel/mcount_64.S @@ -295,7 +295,7 @@ trace: jmp fgraph_trace END(function_hook) #endif /* CONFIG_DYNAMIC_FTRACE */ -EXPORT_SYMBOL(function_hook) +EXPORT_MACRO_SYMBOL(function_hook) #endif /* CONFIG_FUNCTION_TRACER */ #ifdef CONFIG_FUNCTION_GRAPH_TRACER diff --git a/include/asm-generic/export.h b/include/asm-generic/export.h index 43199a049da5..cb86e746865e 100644 --- a/include/asm-generic/export.h +++ b/include/asm-generic/export.h @@ -90,5 +90,10 @@ __EXPORT_SYMBOL(name, KSYM(name),) #define EXPORT_DATA_SYMBOL_GPL(name) \ __EXPORT_SYMBOL(name, KSYM(name),_gpl) +/* + * If "name" is a macro of a function and not a function itself, + * it needs a second pass. + */ +#define EXPORT_MACRO_SYMBOL(x) EXPORT_SYMBOL(x) #endif -- 1.9.3