From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760691AbcBYOG5 (ORCPT ); Thu, 25 Feb 2016 09:06:57 -0500 Received: from verein.lst.de ([213.95.11.211]:48526 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760634AbcBYOGz (ORCPT ); Thu, 25 Feb 2016 09:06:55 -0500 Date: Thu, 25 Feb 2016 15:06:38 +0100 From: Torsten Duwe To: Michael Ellerman Cc: Balbir Singh , linuxppc-dev@ozlabs.org, 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 Subject: Re: [PATCH 06/12] powerpc/module: Rework is_early_mcount_callsite() Message-ID: <20160225140638.GH21932@lst.de> 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> <1456396112.15739.7.camel@ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456396112.15739.7.camel@ellerman.id.au> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 25, 2016 at 09:28:32PM +1100, Michael Ellerman wrote: > 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 I wouldn't mind if you had folded this into the previous patch, see comments there. > > > > > 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. Agreed. Reviewed-by: Torsten Duwe Torsten