From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760105AbcBYK2h (ORCPT ); Thu, 25 Feb 2016 05:28:37 -0500 Received: from ozlabs.org ([103.22.144.67]:59117 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750840AbcBYK2f (ORCPT ); Thu, 25 Feb 2016 05:28:35 -0500 Message-ID: <1456396112.15739.7.camel@ellerman.id.au> Subject: Re: [PATCH 06/12] powerpc/module: Rework is_early_mcount_callsite() From: Michael Ellerman To: Balbir Singh , linuxppc-dev@ozlabs.org Cc: duwe@lst.de, linux-kernel@vger.kernel.org, rostedt@goodmis.org, kamalesh@linux.vnet.ibm.com, pmladek@suse.com, jeyu@redhat.com, jkosina@suse.cz, live-patching@vger.kernel.org, mbenes@suse.cz Date: Thu, 25 Feb 2016 21:28:32 +1100 In-Reply-To: <56CE3F25.8030100@gmail.com> References: <1456324115-21144-1-git-send-email-mpe@ellerman.id.au> <1456324115-21144-6-git-send-email-mpe@ellerman.id.au> <56CE3F25.8030100@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-02-25 at 10:39 +1100, Balbir Singh wrote: > On 25/02/16 01:28, Michael Ellerman wrote: > > is_early_mcount_callsite() needs to detect either the two instruction or > > the three instruction versions of the _mcount() sequence. > > > > But if we're running a kernel with the two instruction sequence, we need > > to be careful not to read instruction - 2, otherwise we might fall off > > the front of a page and cause an oops. > > > > While we're here convert to bool to make the return semantics clear. > > > > Signed-off-by: Michael Ellerman > > > Do we even need to do this anymore? Yes. Otherwise the code in apply_relocate_add() will see a far call with no nop slot after it to do the toc restore, and it considers that a bug (which it usually is, except mcount is special). As we discussed today I'm hoping we can clean this code up a bit more in the medium term, but this works for now. cheers