Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757965AbYHTORi (ORCPT ); Wed, 20 Aug 2008 10:17:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752532AbYHTORa (ORCPT ); Wed, 20 Aug 2008 10:17:30 -0400 Received: from wa-out-1112.google.com ([209.85.146.176]:18687 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751758AbYHTOR3 (ORCPT ); Wed, 20 Aug 2008 10:17:29 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding :sender; b=AKJOzFcjBDMKBd8C6H/8b4nWbFdLSZXUDaMfBMqNtdHiUq0uxDiUibyMilx6kpSaQz XM3qOqsWl1ik75XEhVqs4dUcHog0DoS/qqVRgL3wcdcT6TZjVQuZdRpYmdPRv5J9NraH URaZwPd5iMnAw8FcE0nrNB4SleI9F3HB4gmr4= Subject: Re: ftrace introduces instability into kernel 2.6.27(-rc2,-rc3) From: Josh Boyer Reply-To: jwboyer@linux.vnet.ibm.com To: Steven Rostedt Cc: Benjamin Herrenschmidt , Eran Liberty , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Steven Rostedt , Alan Modra , Scott Wood , "Paul E. McKenney" , segher@kernel.crashing.org In-Reply-To: References: <48591941.4070408@extricom.com> <48A92E15.2080709@extricom.com> <48A9901B.1080900@redhat.com> <20080818154746.GA26835@Krystal> <48A9AFA7.8080508@freescale.com> <1219110814.8062.2.camel@pasglop> <1219113549.8062.13.camel@pasglop> <1219114600.8062.15.camel@pasglop> <1219119431.8062.35.camel@pasglop> <1219216705.21386.46.camel@pasglop> Content-Type: text/plain Date: Wed, 20 Aug 2008 10:16:58 -0400 Message-Id: <1219241819.26429.24.camel@jdub.homelinux.org> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1718 Lines: 42 On Wed, 2008-08-20 at 09:14 -0400, Steven Rostedt wrote: > On Wed, 20 Aug 2008, Benjamin Herrenschmidt wrote: > > > Found the problem (or at least -a- problem), it's a gcc bug. > > > > Well, first I must say the code generated by -pg is just plain > > horrible :-) > > > > Appart from that, look at the exit of, for example, __d_lookup, as > > generated by gcc when ftrace is enabled: > > > > c00c0498: 38 60 00 00 li r3,0 > > c00c049c: 81 61 00 00 lwz r11,0(r1) > > c00c04a0: 80 0b 00 04 lwz r0,4(r11) > > c00c04a4: 7d 61 5b 78 mr r1,r11 > > c00c04a8: bb 0b ff e0 lmw r24,-32(r11) > > c00c04ac: 7c 08 03 a6 mtlr r0 > > c00c04b0: 4e 80 00 20 blr > > > > As you can see, it restores r1 -before- it pops r24..r31 off > > the stack ! I let you imagine what happens if an interrupt happens > > just in between those two instructions (mr and lmw). We don't do > > redzones on our ABI, so basically, the registers end up corrupted > > by the interrupt. > > Ouch! You've disassembled this without -pg too, and it does not have this > bug? What version of gcc do you have? Segher was looking at this a bit this morning. He thinks it's really -fno-omit-frame-pointer that is causing this. That really shouldn't even be set on PowerPC, but FTRACE uses select which overrides the depends on stuff in Kconfig. Segher can probably tell you more once his email is back up. josh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/