direct-io.hg

changeset 12242:e3abede54214

[XEN] Do not halt on exceptions-with-interrupts-disabled and double faults.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Sat Nov 04 20:13:22 2006 +0000 (2006-11-04)
parents cf8e65797826
children 2368e779f89f
files xen/arch/x86/traps.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Sat Nov 04 19:50:59 2006 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Sat Nov 04 20:13:22 2006 +0000
     1.3 @@ -338,7 +338,6 @@ void show_execution_state(struct cpu_use
     1.4   */
     1.5  asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
     1.6  {
     1.7 -    int cpu = smp_processor_id();
     1.8      static char *trapstr[] = { 
     1.9          "divide error", "debug", "nmi", "bkpt", "overflow", "bounds", 
    1.10          "invalid opcode", "device not available", "double fault", 
    1.11 @@ -360,20 +359,10 @@ asmlinkage void fatal_trap(int trapnr, s
    1.12          show_page_walk(cr2);
    1.13      }
    1.14  
    1.15 -    printk("************************************\n");
    1.16 -    printk("CPU%d FATAL TRAP %d (%s), ERROR_CODE %04x%s.\n",
    1.17 -           cpu, trapnr, trapstr[trapnr], regs->error_code,
    1.18 -           (regs->eflags & X86_EFLAGS_IF) ? "" : ", IN INTERRUPT CONTEXT");
    1.19 -    printk("System shutting down -- need manual reset.\n");
    1.20 -    printk("************************************\n");
    1.21 -
    1.22 -    (void)debugger_trap_fatal(trapnr, regs);
    1.23 -
    1.24 -    /* Lock up the console to prevent spurious output from other CPUs. */
    1.25 -    console_force_lock();
    1.26 -
    1.27 -    /* Wait for manual reset. */
    1.28 -    machine_halt();
    1.29 +    panic("FATAL TRAP: vector = %d (%s)\n"
    1.30 +          "[error_code=%04x] %s\n",
    1.31 +          trapnr, trapstr[trapnr], regs->error_code,
    1.32 +          (regs->eflags & X86_EFLAGS_IF) ? "" : ", IN INTERRUPT CONTEXT");
    1.33  }
    1.34  
    1.35  static inline int do_trap(int trapnr, char *str,
    1.36 @@ -416,9 +405,9 @@ static inline int do_trap(int trapnr, ch
    1.37      DEBUGGER_trap_fatal(trapnr, regs);
    1.38  
    1.39      show_execution_state(regs);
    1.40 -    panic("CPU%d FATAL TRAP: vector = %d (%s)\n"
    1.41 +    panic("FATAL TRAP: vector = %d (%s)\n"
    1.42            "[error_code=%04x]\n",
    1.43 -          smp_processor_id(), trapnr, str, regs->error_code);
    1.44 +          trapnr, str, regs->error_code);
    1.45      return 0;
    1.46  }
    1.47  
    1.48 @@ -630,8 +619,7 @@ asmlinkage int do_invalid_op(struct cpu_
    1.49          }
    1.50          DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
    1.51          show_execution_state(regs);
    1.52 -        panic("CPU%d FATAL TRAP: vector = %d (invalid opcode)\n",
    1.53 -              smp_processor_id(), TRAP_invalid_op);
    1.54 +        panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
    1.55      }
    1.56  
    1.57      if ( (rc = emulate_forced_invalid_op(regs)) != 0 )
    1.58 @@ -659,7 +647,7 @@ asmlinkage int do_int3(struct cpu_user_r
    1.59      {
    1.60          DEBUGGER_trap_fatal(TRAP_int3, regs);
    1.61          show_execution_state(regs);
    1.62 -        panic("CPU%d FATAL TRAP: vector = 3 (Int3)\n", smp_processor_id());
    1.63 +        panic("FATAL TRAP: vector = 3 (Int3)\n");
    1.64      } 
    1.65  
    1.66      ti = &current->arch.guest_context.trap_ctxt[TRAP_int3];
    1.67 @@ -930,10 +918,10 @@ asmlinkage int do_page_fault(struct cpu_
    1.68  
    1.69          show_execution_state(regs);
    1.70          show_page_walk(addr);
    1.71 -        panic("CPU%d FATAL PAGE FAULT\n"
    1.72 +        panic("FATAL PAGE FAULT\n"
    1.73                "[error_code=%04x]\n"
    1.74                "Faulting linear address: %p\n",
    1.75 -              smp_processor_id(), regs->error_code, _p(addr));
    1.76 +              regs->error_code, _p(addr));
    1.77      }
    1.78  
    1.79      propagate_page_fault(addr, regs->error_code);
    1.80 @@ -1517,8 +1505,7 @@ asmlinkage int do_general_protection(str
    1.81  
    1.82   hardware_gp:
    1.83      show_execution_state(regs);
    1.84 -    panic("CPU%d GENERAL PROTECTION FAULT\n[error_code=%04x]\n",
    1.85 -          smp_processor_id(), regs->error_code);
    1.86 +    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
    1.87      return 0;
    1.88  }
    1.89  
     2.1 --- a/xen/arch/x86/x86_32/traps.c	Sat Nov 04 19:50:59 2006 +0000
     2.2 +++ b/xen/arch/x86/x86_32/traps.c	Sat Nov 04 20:13:22 2006 +0000
     2.3 @@ -168,16 +168,8 @@ asmlinkage void do_double_fault(void)
     2.4      printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   ss: %04x\n",
     2.5             tss->ds, tss->es, tss->fs, tss->gs, tss->ss);
     2.6      show_stack_overflow(tss->esp);
     2.7 -    printk("************************************\n");
     2.8 -    printk("CPU%d DOUBLE FAULT -- system shutdown\n", cpu);
     2.9 -    printk("System needs manual reset.\n");
    2.10 -    printk("************************************\n");
    2.11  
    2.12 -    /* Lock up the console to prevent spurious output from other CPUs. */
    2.13 -    console_force_lock();
    2.14 -
    2.15 -    /* Wait for manual reset. */
    2.16 -    machine_halt();
    2.17 +    panic("DOUBLE FAULT -- system shutdown\n");
    2.18  }
    2.19  
    2.20  unsigned long do_iret(void)
     3.1 --- a/xen/arch/x86/x86_64/traps.c	Sat Nov 04 19:50:59 2006 +0000
     3.2 +++ b/xen/arch/x86/x86_64/traps.c	Sat Nov 04 20:13:22 2006 +0000
     3.3 @@ -172,16 +172,8 @@ asmlinkage void do_double_fault(struct c
     3.4             regs->r12, regs->r13, regs->r14);
     3.5      printk("r15: %016lx\n", regs->r15);
     3.6      show_stack_overflow(regs->rsp);
     3.7 -    printk("************************************\n");
     3.8 -    printk("CPU%d DOUBLE FAULT -- system shutdown\n", cpu);
     3.9 -    printk("System needs manual reset.\n");
    3.10 -    printk("************************************\n");
    3.11  
    3.12 -    /* Lock up the console to prevent spurious output from other CPUs. */
    3.13 -    console_force_lock();
    3.14 -
    3.15 -    /* Wait for manual reset. */
    3.16 -    machine_halt();
    3.17 +    panic("DOUBLE FAULT -- system shutdown\n");
    3.18  }
    3.19  
    3.20  void toggle_guest_mode(struct vcpu *v)