From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941522AbcJXTS7 (ORCPT ); Mon, 24 Oct 2016 15:18:59 -0400 Received: from mail.skyhub.de ([78.46.96.112]:47773 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938727AbcJXTSz (ORCPT ); Mon, 24 Oct 2016 15:18:55 -0400 Date: Mon, 24 Oct 2016 21:17:43 +0200 From: Borislav Petkov To: Steven Rostedt Cc: LKML , Nicholas Piggin , Al Viro , Thomas Gleixner , Ingo Molnar , Gabriel C Subject: Re: [PATCH] x86: Fix export for mcount and __fentry__ Message-ID: <20161024191743.rsd74w2vev5efcar@pd.tnic> References: <20161024150148.4f9d90e4@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161024150148.4f9d90e4@gandalf.local.home> User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 24, 2016 at 03:01:48PM -0400, Steven Rostedt wrote: > 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 either mcount or __fentry__ depending on the support from gcc. > > Originally, I thought this was a macro issue, like what __stringify() > is used for. But the problem is a bit deeper. The Makefile.build has > some magic that does post processing of files to create the CRC > bindings. It does some searches for EXPORT_SYMBOL() and because it > finds a macro name and not the actual functions, this causes > function_hook not to be converted into mcount or __fentry__ and they > are missed. > > Instead of adding more magic to Makefile.build, just add > EXPORT_SYMBOL() for mcount and __fentry__ where the ifdef is used. > Since this is assembly and not C, it doesn't require being set after > the function is defined. > > Signed-off-by: Steven Rostedt Tested-by: Borislav Petkov -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.