All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akio Takebe <takebe_akio@jp.fujitsu.com>
To: Akio Takebe <takebe_akio@jp.fujitsu.com>,
	xen-ia64-devel <xen-ia64-devel@lists.xensource.com>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: [Patch][1/2]implement dump_execution_state() on ia64
Date: Thu, 27 Mar 2008 22:09:12 +0900	[thread overview]
Message-ID: <7DC8900BC04D5Etakebe_akio@jp.fujitsu.com> (raw)
In-Reply-To: <7CC8900B4B0550takebe_akio@jp.fujitsu.com>

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 114 bytes --]

Hi,

This patch is x86  side.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

Best Regards,

Akio Takebe

[-- Attachment #2: implement_dump_execution_state.x86.patch --]
[-- Type: application/octet-stream, Size: 5424 bytes --]

diff -r edfb58ca4d96 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Tue Mar 25 12:37:17 2008 -0600
+++ b/xen/arch/x86/traps.c	Fri Mar 28 06:56:55 2008 +0900
@@ -329,6 +329,33 @@ void show_execution_state(struct cpu_use
 {
     show_registers(regs);
     show_stack(regs);
+}
+
+void __dump_execstate(void *unused)
+{
+    dump_execution_state();
+    printk("*** Dumping CPU%d guest state: ***\n", smp_processor_id());
+    if ( is_idle_vcpu(current) )
+        printk("No guest context (CPU is idle).\n");
+    else
+        show_execution_state(guest_cpu_user_regs());
+}
+
+void _dump_registers(struct cpu_user_regs *regs)
+{
+    unsigned int cpu;
+
+    /* Get local execution state out immediately, in case we get stuck. */
+    printk("\n*** Dumping CPU%d host state: ***\n", smp_processor_id());
+    __dump_execstate(NULL);
+
+    for_each_online_cpu ( cpu )
+    {
+        if ( cpu == smp_processor_id() )
+            continue;
+        printk("\n*** Dumping CPU%d host state: ***\n", cpu);
+        on_selected_cpus(cpumask_of_cpu(cpu), __dump_execstate, NULL, 1, 1);
+    }
 }
 
 char *trapstr(int trapnr)
diff -r edfb58ca4d96 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Tue Mar 25 12:37:17 2008 -0600
+++ b/xen/common/keyhandler.c	Fri Mar 28 06:56:55 2008 +0900
@@ -89,34 +89,10 @@ static void show_handlers(unsigned char 
                    key_table[i].desc);
 }
 
-static void __dump_execstate(void *unused)
-{
-    dump_execution_state();
-    printk("*** Dumping CPU%d guest state: ***\n", smp_processor_id());
-    if ( is_idle_vcpu(current) )
-        printk("No guest context (CPU is idle).\n");
-    else
-        show_execution_state(guest_cpu_user_regs());
-}
-
 static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
 {
-    unsigned int cpu;
-
     printk("'%c' pressed -> dumping registers\n", key);
-
-    /* Get local execution state out immediately, in case we get stuck. */
-    printk("\n*** Dumping CPU%d host state: ***\n", smp_processor_id());
-    __dump_execstate(NULL);
-
-    for_each_online_cpu ( cpu )
-    {
-        if ( cpu == smp_processor_id() )
-            continue;
-        printk("\n*** Dumping CPU%d host state: ***\n", cpu);
-        on_selected_cpus(cpumask_of_cpu(cpu), __dump_execstate, NULL, 1, 1);
-    }
-
+    _dump_registers(regs);
     printk("\n");
 }
 
diff -r edfb58ca4d96 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Tue Mar 25 12:37:17 2008 -0600
+++ b/xen/drivers/char/console.c	Fri Mar 28 06:56:55 2008 +0900
@@ -946,7 +946,7 @@ void __bug(char *file, int line)
 {
     console_start_sync();
     printk("Xen BUG at %s:%d\n", file, line);
-    dump_execution_state();
+    dump_execution_state(NULL);
     panic("Xen BUG at %s:%d\n", file, line);
     for ( ; ; ) ;
 }
@@ -954,7 +954,7 @@ void __warn(char *file, int line)
 void __warn(char *file, int line)
 {
     printk("Xen WARN at %s:%d\n", file, line);
-    dump_execution_state();
+    dump_execution_state(NULL);
 }
 
 
diff -r edfb58ca4d96 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Tue Mar 25 12:37:17 2008 -0600
+++ b/xen/include/asm-x86/processor.h	Fri Mar 28 06:56:55 2008 +0900
@@ -561,6 +561,8 @@ void show_stack_overflow(unsigned int cp
 void show_stack_overflow(unsigned int cpu, unsigned long esp);
 void show_registers(struct cpu_user_regs *regs);
 void show_execution_state(struct cpu_user_regs *regs);
+void __dump_execstate(void *unused);
+void _dump_registers(struct cpu_user_regs *regs);
 void show_page_walk(unsigned long addr);
 asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs);
 
diff -r edfb58ca4d96 xen/include/asm-x86/x86_32/bug.h
--- a/xen/include/asm-x86/x86_32/bug.h	Tue Mar 25 12:37:17 2008 -0600
+++ b/xen/include/asm-x86/x86_32/bug.h	Fri Mar 28 06:56:55 2008 +0900
@@ -7,7 +7,9 @@ struct bug_frame_str {
 } __attribute__((packed));
 #define BUG_MOV_STR "\xbc"
 
-#define dump_execution_state()                          \
+#define dump_execution_state(i) _dump_execution_state()
+
+#define _dump_execution_state()                         \
     asm volatile (                                      \
         "ud2 ; ret $%c0"                                \
         : : "i" (BUGFRAME_dump) )
diff -r edfb58ca4d96 xen/include/asm-x86/x86_64/bug.h
--- a/xen/include/asm-x86/x86_64/bug.h	Tue Mar 25 12:37:17 2008 -0600
+++ b/xen/include/asm-x86/x86_64/bug.h	Fri Mar 28 06:56:55 2008 +0900
@@ -7,7 +7,8 @@ struct bug_frame_str {
 } __attribute__((packed));
 #define BUG_MOV_STR "\x48\xbc"
 
-#define dump_execution_state()                          \
+#define dump_execution_state(i) _dump_execution_state()
+#define _dump_execution_state()                         \
     asm volatile (                                      \
         "ud2 ; ret $%c0"                                \
         : : "i" (BUGFRAME_dump) )
diff -r edfb58ca4d96 xen/include/xen/smp.h
--- a/xen/include/xen/smp.h	Tue Mar 25 12:37:17 2008 -0600
+++ b/xen/include/xen/smp.h	Fri Mar 28 06:56:55 2008 +0900
@@ -47,6 +47,13 @@ extern int on_selected_cpus(
     int retry,
     int wait);
 
+/* this is only for ia64. */
+extern int on_selected_cpus_regs(
+    cpumask_t selected,
+    void (*func) (void *info, struct cpu_user_regs *),
+    void *info,
+    int retry,
+    int wait);
 /*
  * Mark the boot cpu "online" so that it can call console drivers in
  * printk() and can access its per-cpu storage.

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

  reply	other threads:[~2008-03-27 13:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27 13:05 [Patch][0/2]implement dump_execution_state() on ia64 Akio Takebe
2008-03-27 13:09 ` Akio Takebe [this message]
2008-03-27 13:10 ` [Patch][2/2]implement " Akio Takebe
2008-03-27 14:47 ` [Patch][0/2]implement " Keir Fraser
2008-03-27 16:56   ` [Xen-devel] " Akio Takebe
2008-03-27 17:04     ` Keir Fraser
2008-03-27 17:22       ` [Xen-devel] " Akio Takebe
2008-03-27 19:22         ` Keir Fraser

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=7DC8900BC04D5Etakebe_akio@jp.fujitsu.com \
    --to=takebe_akio@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.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 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.