linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Eran Liberty" <liberty@extricom.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
	linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	linuxppc-dev@ozlabs.org, Steven Rostedt <srostedt@redhat.com>,
	Alan Modra <amodra@au1.ibm.com>,
	Scott Wood <scottwood@freescale.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: ftrace introduces instability into kernel 2.6.27(-rc2,-rc3)
Date: Wed, 20 Aug 2008 10:55:45 -0400	[thread overview]
Message-ID: <9e4733910808200755y1128ae56p6a1235684bfbb3ec@mail.gmail.com> (raw)
In-Reply-To: <48AC23F4.80900@extricom.com>

On 8/20/08, Eran Liberty <liberty@extricom.com> wrote:
> Steven Rostedt wrote:
>
> > On Wed, 20 Aug 2008, Eran Liberty wrote:
> >
> >
> >
> > > Steven Rostedt wrote:
> > >
> > >
> > > > On Wed, 20 Aug 2008, 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?
> > > > >
> > > > >
> > > > >
> > > > I have:
> > > >  gcc (Debian 4.3.1-2) 4.3.1
> > > >
> > > > c00c64c8:       81 61 00 00     lwz     r11,0(r1)
> > > > c00c64cc:       7f 83 e3 78     mr      r3,r28
> > > > c00c64d0:       80 0b 00 04     lwz     r0,4(r11)
> > > > c00c64d4:       ba eb ff dc     lmw     r23,-36(r11)
> > > > c00c64d8:       7d 61 5b 78     mr      r1,r11
> > > > c00c64dc:       7c 08 03 a6     mtlr    r0
> > > > c00c64e0:       4e 80 00 20     blr
> > > >
> > > >
> > > > My version looks fine.  I'm thinking that this is a separate issue
> than what
> > > > Eran is seeing.
> > > >
> > > > Eran, can you do an "objdump -dr vmlinux" and search for __d_lookup,
> and
> > > > print out the end of the function dump.
> > > >
> > > > Thanks,
> > > >
> > > > -- Steve
> > > >
> > > >
> > > >
> > > >
> > > >
> > > powerpc-linux-gnu-objdump -dr --start-address=0xc00bb584 vmlinux | head
> -n 100
> > >
> > > vmlinux:     file format elf32-powerpc
> > >
> > > Disassembly of section .text:
> > >
> > > c00bb584 <__d_lookup>:
> > >
> > >
> >
> > [...]
> >
> >
> >
> > > c00bb670:       41 9e 00 50     beq-    cr7,c00bb6c0 <__d_lookup+0x13c>
> > > c00bb674:       83 de 00 00     lwz     r30,0(r30)
> > > c00bb678:       2f 9e 00 00     cmpwi   cr7,r30,0
> > > c00bb67c:       40 9e ff 98     bne+    cr7,c00bb614 <__d_lookup+0x90>
> > > c00bb680:       38 60 00 00     li      r3,0
> > > c00bb684:       81 61 00 00     lwz     r11,0(r1)
> > > c00bb688:       80 0b 00 04     lwz     r0,4(r11)
> > > c00bb68c:       7d 61 5b 78     mr      r1,r11
> > >
> > >
> >
> > [ BUG HERE IF INTERRUPT HAPPENS ]
> >
> >
> >
> > > c00bb690:       bb 0b ff e0     lmw     r24,-32(r11)
> > > c00bb694:       7c 08 03 a6     mtlr    r0
> > > c00bb698:       4e 80 00 20     blr
> > >
> > >
> >
> > Yep, you have the same bug in your compiler.
> >
> > -- Steve
> >
> >
>  Hmm... so whats now?
>
>  Is there a way to prove this scenario is indeed the one that caused the
> opps?

Manually edit the broken binary to change the order of the restore and
see if the problem disappears. That will keep everything else
constant.


>
>  -- Liberty
>
>  _______________________________________________
>  Linuxppc-dev mailing list
>  Linuxppc-dev@ozlabs.org
>  https://ozlabs.org/mailman/listinfo/linuxppc-dev
>


-- 
Jon Smirl
jonsmirl@gmail.com

  reply	other threads:[~2008-08-20 14:55 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48591941.4070408@extricom.com>
     [not found] ` <48A92E15.2080709@extricom.com>
2008-08-18 15:07   ` ftrace introduces instability into kernel 2.6.27(-rc2,-rc3) Steven Rostedt
2008-08-18 15:47     ` Mathieu Desnoyers
2008-08-18 16:12       ` Steven Rostedt
2008-08-18 17:04         ` Mathieu Desnoyers
2008-08-18 17:21       ` Scott Wood
2008-08-18 18:27         ` Steven Rostedt
2008-08-18 18:29           ` Scott Wood
2008-08-19  1:53           ` Benjamin Herrenschmidt
2008-08-19  2:28             ` Steven Rostedt
2008-08-19  2:39               ` Benjamin Herrenschmidt
2008-08-19  2:41                 ` Steven Rostedt
2008-08-19  2:47                   ` Mathieu Desnoyers
2008-08-19  3:32                     ` Steven Rostedt
2008-08-19  3:36                       ` Mathieu Desnoyers
2008-08-19  4:00                         ` Steven Rostedt
2008-08-19 16:47                     ` Steven Rostedt
2008-08-19 17:34                       ` Mathieu Desnoyers
2008-08-19 21:08                         ` Steven Rostedt
2008-08-20  9:40                           ` Nick Piggin
2008-08-19 21:47                         ` Benjamin Herrenschmidt
2008-08-19 23:58                           ` Jeremy Fitzhardinge
2008-08-20  1:17                             ` Benjamin Herrenschmidt
2008-08-19  2:56                 ` Benjamin Herrenschmidt
2008-08-19  3:12                   ` Steven Rostedt
2008-08-19  4:17                     ` Benjamin Herrenschmidt
2008-08-20  7:18                       ` Benjamin Herrenschmidt
2008-08-20 13:14                         ` Steven Rostedt
2008-08-20 13:19                           ` Steven Rostedt
2008-08-20 13:36                             ` Eran Liberty
2008-08-20 13:43                               ` Steven Rostedt
2008-08-20 14:02                                 ` Eran Liberty
2008-08-20 14:55                                   ` Jon Smirl [this message]
2008-08-20 15:23                                     ` Steven Rostedt
2008-08-20 18:23                                     ` Eran Liberty
2008-08-20 18:33                                       ` Steven Rostedt
2008-08-20 15:27                                   ` Steven Rostedt
2008-08-20 21:37                                   ` Benjamin Herrenschmidt
2008-08-20 14:16                           ` Josh Boyer
2008-08-20 14:22                             ` Steven Rostedt
2008-08-20 14:50                               ` Josh Boyer
2008-08-20 21:36                           ` Benjamin Herrenschmidt
2008-08-20 21:44                             ` Steven Rostedt
2008-08-18 18:47         ` Steven Rostedt
2008-08-18 18:56           ` Scott Wood
2008-08-18 19:28             ` Steven Rostedt
2008-08-18 18:25     ` Eran Liberty
2008-08-18 18:41       ` Mathieu Desnoyers
2008-08-19  1:54         ` Benjamin Herrenschmidt
2008-08-19  9:56         ` Eran Liberty
2008-08-19 13:02           ` Mathieu Desnoyers
2008-08-19 21:46             ` Benjamin Herrenschmidt
2008-08-18 18:50       ` Steven Rostedt
2008-08-19 12:09         ` Eran Liberty
2008-08-19 13:05           ` Mathieu Desnoyers
2008-08-19 14:21             ` Eran Liberty
2008-08-19 14:42               ` Mathieu Desnoyers
2008-08-19 20:15           ` Steven Rostedt
2008-08-20 11:18             ` Eran Liberty
2008-08-20 13:12               ` Steven Rostedt
2008-08-19  1:51     ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e4733910808200755y1128ae56p6a1235684bfbb3ec@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=amodra@au1.ibm.com \
    --cc=liberty@extricom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=scottwood@freescale.com \
    --cc=srostedt@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).