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-changelog

[Xen-changelog] [xen-unstable] [IA64] Fix infinite loop in fault handler

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Fix infinite loop in fault handler if debugger is not connected
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Feb 2008 07:10:12 -0800
Delivery-date: Thu, 21 Feb 2008 07:10:16 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1201716809 25200
# Node ID 33d0cf9474f93ff1eb7654754554b41351148f57
# Parent  13eb21985d3d990592f1becc1a2dbfb62630aceb
[IA64] Fix infinite loop in fault handler if debugger is not connected

If xen is compiled with crash_debug=y and the debugger is not
connected, the fault handler enters infinite loop.  regs may
be on stack, so split the incrementing out of vcpu_increment_iip().

Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
---
 xen/arch/ia64/vmx/vmx_fault.c               |    1 +
 xen/arch/ia64/xen/faults.c                  |    1 +
 xen/arch/ia64/xen/vcpu.c                    |    7 +------
 xen/include/asm-ia64/linux-xen/asm/ptrace.h |    9 +++++++++
 4 files changed, 12 insertions(+), 6 deletions(-)

diff -r 13eb21985d3d -r 33d0cf9474f9 xen/arch/ia64/vmx/vmx_fault.c
--- a/xen/arch/ia64/vmx/vmx_fault.c     Wed Jan 30 10:50:24 2008 -0700
+++ b/xen/arch/ia64/vmx/vmx_fault.c     Wed Jan 30 11:13:29 2008 -0700
@@ -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);
+        regs_increment_iip(regs);
     } else
 #endif
     {
diff -r 13eb21985d3d -r 33d0cf9474f9 xen/arch/ia64/xen/faults.c
--- a/xen/arch/ia64/xen/faults.c        Wed Jan 30 10:50:24 2008 -0700
+++ b/xen/arch/ia64/xen/faults.c        Wed Jan 30 11:13:29 2008 -0700
@@ -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);
+               regs_increment_iip(regs);
        }
 #endif
        else if (iim == d->arch.breakimm &&
diff -r 13eb21985d3d -r 33d0cf9474f9 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Wed Jan 30 10:50:24 2008 -0700
+++ b/xen/arch/ia64/xen/vcpu.c  Wed Jan 30 11:13:29 2008 -0700
@@ -804,12 +804,7 @@ IA64FAULT vcpu_increment_iip(VCPU * vcpu
 IA64FAULT vcpu_increment_iip(VCPU * vcpu)
 {
        REGS *regs = vcpu_regs(vcpu);
-       struct ia64_psr *ipsr = (struct ia64_psr *)&regs->cr_ipsr;
-       if (ipsr->ri == 2) {
-               ipsr->ri = 0;
-               regs->cr_iip += 16;
-       } else
-               ipsr->ri++;
+       regs_increment_iip(regs);
        return IA64_NO_FAULT;
 }
 
diff -r 13eb21985d3d -r 33d0cf9474f9 xen/include/asm-ia64/linux-xen/asm/ptrace.h
--- a/xen/include/asm-ia64/linux-xen/asm/ptrace.h       Wed Jan 30 10:50:24 
2008 -0700
+++ b/xen/include/asm-ia64/linux-xen/asm/ptrace.h       Wed Jan 30 11:13:29 
2008 -0700
@@ -281,6 +281,15 @@ struct switch_stack {
 # define guest_mode(regs)              (ia64_psr(regs)->cpl != 0)
 # define guest_kernel_mode(regs)       (ia64_psr(regs)->cpl == 
CONFIG_CPL0_EMUL)
 # define vmx_guest_kernel_mode(regs)   (ia64_psr(regs)->cpl == 0)
+# define regs_increment_iip(regs)                                      \
+do {                                                                   \
+       struct ia64_psr *ipsr = ia64_psr(regs);                         \
+       if (ipsr->ri == 2) {                                            \
+               ipsr->ri = 0;                                           \
+               regs->cr_iip += 16;                                     \
+       } else                                                          \
+               ipsr->ri++;                                             \
+} while (0)
 #else
 # define user_mode(regs)               (((struct ia64_psr *) 
&(regs)->cr_ipsr)->cpl != 0)
 #endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] Fix infinite loop in fault handler if debugger is not connected, Xen patchbot-unstable <=