All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [patch] i386: fix one case of stuck dwarf2 unwinder II
@ 2006-08-06  7:11 Chuck Ebbert
  2006-08-06 14:04 ` Andi Kleen
  0 siblings, 1 reply; 9+ messages in thread
From: Chuck Ebbert @ 2006-08-06  7:11 UTC (permalink / raw)
  To: Andi Kleen
  Cc: linux-kernel, Jan Beulich, Dave Jones, Jesper Juhl, Andrew Morton

In-Reply-To: <200608060805.06821.ak@suse.de>

On Sun, 6 Aug 2006 08:05:06 +0200, Andi Kleen wrote:

> Hmm, actually I applied it but then I had doubts it actually 
> works -- I think you don't need _stext but the code before
> the first call in head. Since head.S doesn't do a call
> that's probably start_kernel

But head.S does do a call (on i386 but not x86_64 AFAICT):

| #ifdef CONFIG_SMP
|        movb ready, %cl
|        movb $1, ready
|        cmpb $0,%cl
|        je 1f                   # the first CPU calls start_kernel
|                                # all other CPUs call initialize_secondary
|        call initialize_secondary
|        jmp L6
| 1:
| #endif /* CONFIG_SMP */
|        call start_kernel
| L6:
|        jmp L6                  # main should never return here, but
|                                # just in case, we know what happens.

And the backtraces I saw ended up at L6:

| DWARF2 unwinder stuck at 0xc0100210

System.map on i386 SMP says:

| c0100210 t L6

-- 
Chuck


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [patch] i386: fix one case of stuck dwarf2 unwinder II
@ 2006-08-06 16:09 Chuck Ebbert
  2006-08-07  8:00 ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Chuck Ebbert @ 2006-08-06 16:09 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Andrew Morton, Jesper Juhl, Dave Jones, Jan Beulich, linux-kernel

In-Reply-To: <200608061604.40452.ak@suse.de>

On Sun, 6 Aug 2006 16:04:40 +0200, Andi Kleen wrote:

> > And the backtraces I saw ended up at L6:
> > 
> > | DWARF2 unwinder stuck at 0xc0100210
> > 
> > System.map on i386 SMP says:
> > 
> > | c0100210 t L6
> 
> 
> Yes that's the problem. If you check for <= stext/_stext then the unwinder
> won't catch the L6 (which is above it) and report a "stuck" again

Maybe I'm being dense here, but:

c0100210 t L6
c0100212 t check_x87
c010023a t setup_idt
c0100257 t rp_sidt
c0100264 t ignore_int
c0100298 T stext
c0100298 T _stext

It looks like L6 is before _stext to me.

-- 
Chuck


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [patch] i386: fix one case of stuck dwarf2 unwinder
@ 2006-08-06  5:00 Chuck Ebbert
  2006-08-06  6:05 ` [patch] i386: fix one case of stuck dwarf2 unwinder II Andi Kleen
  0 siblings, 1 reply; 9+ messages in thread
From: Chuck Ebbert @ 2006-08-06  5:00 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Andrew Morton, Jesper Juhl, Dave Jones, Jan Beulich, linux-kernel

In-Reply-To: <200608060430.06935.ak@suse.de>

On Sun, 6 Aug 2006 04:30:06 +0200, Andi Kleen wrote:
> 
> > +extern void stext(void); /* real start of kernel text */
> 
> Can't you use _stext[] from asm/sections.h?

OK.


[patch] i386: fix one case of stuck dwarf2 unwinder

When the dwarf2 unwinder does its thing, sometimes it ends up in
kernel startup code in head.S.  Changing arch_unw_user_mode() to
treat that case as if it were user mode is the easy fix.

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>

--- 2.6.18-rc3-32.orig/include/asm-i386/unwind.h
+++ 2.6.18-rc3-32/include/asm-i386/unwind.h
@@ -13,6 +13,7 @@
 #include <asm/fixmap.h>
 #include <asm/ptrace.h>
 #include <asm/uaccess.h>
+#include <asm/sections.h>
 
 struct unwind_frame_info
 {
@@ -71,13 +72,14 @@ extern asmlinkage int arch_unwind_init_r
                                                                           void *arg),
                                                void *arg);
 
+/* check if unwind has reached either user mode or kernel startup code */
 static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
 {
 #if 0 /* This can only work when selector register and EFLAGS saves/restores
          are properly annotated (and tracked in UNW_REGISTER_INFO). */
 	return user_mode_vm(&info->regs);
 #else
-	return info->regs.eip < PAGE_OFFSET
+	return info->regs.eip < (unsigned long)_stext
 	       || (info->regs.eip >= __fix_to_virt(FIX_VDSO)
 	            && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE)
 	       || info->regs.esp < PAGE_OFFSET;
-- 
Chuck

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-08-15 10:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-06  7:11 [patch] i386: fix one case of stuck dwarf2 unwinder II Chuck Ebbert
2006-08-06 14:04 ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2006-08-06 16:09 Chuck Ebbert
2006-08-07  8:00 ` Jan Beulich
2006-08-07  8:04   ` Andi Kleen
2006-08-15 10:33     ` Jan Beulich
2006-08-15 10:47       ` Andi Kleen
2006-08-15 10:54         ` Jan Beulich
2006-08-06  5:00 [patch] i386: fix one case of stuck dwarf2 unwinder Chuck Ebbert
2006-08-06  6:05 ` [patch] i386: fix one case of stuck dwarf2 unwinder II Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.