mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Kirill Korotaev <dev@sw.ru>
Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH] Fix of stack dump in {SOFT|HARD}IRQs
Date: Fri, 1 Oct 2004 15:08:34 -0700	[thread overview]
Message-ID: <20041001150834.76e037b6.akpm@osdl.org> (raw)
In-Reply-To: <415D36AA.3000907@sw.ru>

Kirill Korotaev <dev@sw.ru> wrote:
>
> This patch fixes incorrect check for stack ptr in 
> show_trace()->valid_stack_ptr(). When called from hardirq/softirq 
> show_trace() prints "Stack pointer is garbage, not printing trace" 
> message instead of call traces.

Thanks for fixing that up.

In future, please ensure that patches are in `patch -p1' form, as described
in http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt.

And please don't declare external functions in .c files - it defeats
compiler typechecking.  I'll use the below fixup for that.

--- 25/arch/i386/kernel/irq.c~fix-of-stack-dump-in-soft-hardirqs-cleanup	Fri Oct  1 15:05:24 2004
+++ 25-akpm/arch/i386/kernel/irq.c	Fri Oct  1 15:05:45 2004
@@ -10,12 +10,14 @@
  * io_apic.c.)
  */
 
-#include <asm/uaccess.h>
 #include <linux/module.h>
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 
+#include <asm/uaccess.h>
+#include <asm/hardirq.h>
+
 #ifdef CONFIG_4KSTACKS
 /*
  * per-CPU IRQ handling contexts (thread information and stack)
diff -puN arch/i386/kernel/traps.c~fix-of-stack-dump-in-soft-hardirqs-cleanup arch/i386/kernel/traps.c
--- 25/arch/i386/kernel/traps.c~fix-of-stack-dump-in-soft-hardirqs-cleanup	Fri Oct  1 15:05:24 2004
+++ 25-akpm/arch/i386/kernel/traps.c	Fri Oct  1 15:06:01 2004
@@ -50,6 +50,7 @@
 #include <asm/smp.h>
 #include <asm/arch_hooks.h>
 #include <asm/kdebug.h>
+#include <asm/hardirq.h>
 
 #include <linux/irq.h>
 #include <linux/module.h>
@@ -107,8 +108,6 @@ int register_die_notifier(struct notifie
 
 static int valid_stack_ptr(struct task_struct *task, void *p)
 {
-	extern int is_irq_stack_ptr(struct task_struct *, void *);
-
 	if (is_irq_stack_ptr(task, p))
 		return 1;
 	if (p >= (void *)task->thread_info &&
diff -puN include/asm-i386/hardirq.h~fix-of-stack-dump-in-soft-hardirqs-cleanup include/asm-i386/hardirq.h
--- 25/include/asm-i386/hardirq.h~fix-of-stack-dump-in-soft-hardirqs-cleanup	Fri Oct  1 15:05:24 2004
+++ 25-akpm/include/asm-i386/hardirq.h	Fri Oct  1 15:06:29 2004
@@ -36,4 +36,7 @@ static inline void ack_bad_irq(unsigned 
 #endif
 }
 
+struct task_struct;
+int is_irq_stack_ptr(struct task_struct *task, void *p);
+
 #endif /* __ASM_HARDIRQ_H */
_


      reply	other threads:[~2004-10-01 22:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 10:51 Kirill Korotaev
2004-10-01 22:08 ` Andrew Morton [this message]

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=20041001150834.76e037b6.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dev@sw.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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

Powered by JetHome