WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH]Fix infinite loop in fault handler if debugger i

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH]Fix infinite loop in fault handler if debugger is not connected
From: SUZUKI Kazuhiro <kaz@xxxxxxxxxxxxxx>
Date: Wed, 23 Jan 2008 17:39:05 +0900 (JST)
Delivery-date: Wed, 23 Jan 2008 00:40:08 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi all,

If xen is compiled with crash_debug=y and the debugger is not
connected, the fault handler enters infinite loop.

The attached patch increments regs->cr_iip.

Thanks.
KAZ

Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
diff -r b79802517a75 xen/arch/ia64/vmx/vmx_fault.c
--- a/xen/arch/ia64/vmx/vmx_fault.c     Tue Jan 22 09:04:41 2008 -0700
+++ b/xen/arch/ia64/vmx/vmx_fault.c     Wed Jan 23 11:37:29 2008 +0900
@@ -181,6 +181,7 @@ vmx_ia64_handle_break (unsigned long ifa
         if (iim == 0)
             show_registers(regs);
         debugger_trap_fatal(0 /* don't care */, regs);
+        ia64_increment_ip(regs);
     } else
 #endif
     {
diff -r b79802517a75 xen/arch/ia64/xen/faults.c
--- a/xen/arch/ia64/xen/faults.c        Tue Jan 22 09:04:41 2008 -0700
+++ b/xen/arch/ia64/xen/faults.c        Wed Jan 23 10:53:23 2008 +0900
@@ -515,6 +515,7 @@ ia64_handle_break(unsigned long ifa, str
                if (iim == 0)
                        show_registers(regs);
                debugger_trap_fatal(0 /* don't care */ , regs);
+               ia64_increment_ip(regs);
        }
 #endif
        else if (iim == d->arch.breakimm &&
diff -r b79802517a75 xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c       Tue Jan 22 09:04:41 2008 -0700
+++ b/xen/arch/ia64/xen/xenmisc.c       Wed Jan 23 08:41:06 2008 +0900
@@ -140,3 +140,15 @@ void panic_domain(struct pt_regs *regs, 
                show_registers(regs);
        domain_crash_synchronous ();
 }
+
+#ifdef CRASH_DEBUG
+void ia64_increment_ip(struct pt_regs *regs)
+{
+       struct ia64_psr *ipsr = (struct ia64_psr *)&regs->cr_ipsr;
+       if (ipsr->ri == 2) {
+               ipsr->ri = 0;
+               regs->cr_iip += 16;
+       } else
+               ipsr->ri++;
+}
+#endif
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>