Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759451AbcCDJbn (ORCPT ); Fri, 4 Mar 2016 04:31:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:35107 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759356AbcCDJbj (ORCPT ); Fri, 4 Mar 2016 04:31:39 -0500 Date: Fri, 4 Mar 2016 10:31:35 +0100 (CET) From: Miroslav Benes To: Michael Ellerman cc: Petr Mladek , linuxppc-dev@ozlabs.org, jeyu@redhat.com, jkosina@suse.cz, linux-kernel@vger.kernel.org, rostedt@goodmis.org, kamalesh@linux.vnet.ibm.com, duwe@lst.de, live-patching@vger.kernel.org, Torsten Duwe Subject: Re: [PATCH][v4] livepatch/ppc: Enable livepatching on powerpc In-Reply-To: <1457078325.20076.1.camel@ellerman.id.au> Message-ID: References: <1457023921-2051-1-git-send-email-pmladek@suse.com> <1457078325.20076.1.camel@ellerman.id.au> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1949 Lines: 60 Hi, On Fri, 4 Mar 2016, Michael Ellerman wrote: > Hi Petr, > > On Thu, 2016-03-03 at 17:52 +0100, Petr Mladek wrote: > > > From: Balbir Singh > > > > Changelog v4: > > 1. Renamed klp_matchaddr() to klp_get_ftrace_location() > > and used it just to convert the function address. > > 2. Synced klp_write_module_reloc() with s390(); made it > > inline, no error message, return -ENOSYS > > OK. > > > 3. Added an error message when including > > powerpc/include/asm/livepatch.h without HAVE_LIVEPATCH > > I don't know why we want to do that, I don't see how it is helpful. It doesn't > even do what it says: > > > +#ifdef CONFIG_LIVEPATCH > ... > > +#else /* CONFIG_LIVEPATCH */ > > +#error Include linux/livepatch.h, not asm/livepatch.h > > +#endif /* CONFIG_LIVEPATCH */ > > If I turn on CONFIG_LIVEPATCH then I can quite happily include asm/livepatch.h > and not get an error. So the check doesn't do what the message suggests. Well, yes. I looked into the archives to find if there was a reason to even introduce it. It was not. It came up during a review process of the livepatching patch set somehow and we left it there. I only changed the error message to the mentioned one because we deemed it was better. > If we *really* want to prevent people from including asm/livepatch.h then it > needs to check for _LINUX_LIVEPATCH_H_. But there's no reason I can see why we > *must* prevent people from including asm/livepatch.h. > > And on x86 & s390 it does: > > #else > #error Live patching support is disabled; check CONFIG_LIVEPATCH > #endif > > Which is also not helpful AFAICS, and just likely to break the build for no > good reason. This is the old message. See 383bf44d1a8b ("livepatch: change the error message in asm/livepatch.h header files"). Anyway, it really does not mean much. I'll send a patch for s390 and x86 to remove it completely in a minute. Thanks, Miroslav