ia64/xen-unstable

changeset 5094:53d5ba4a4aed

bitkeeper revision 1.1515 (42921e4fRcf8j8oxgO4SHlBhn0dSuw)

Better handling of NULL callback pointers -- synchronously crash the
offending domain. This gets us some nice debug output for domain0.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon May 23 18:17:51 2005 +0000 (2005-05-23)
parents c91f74efda05
children e81b60a0e170 3f6a8dd4050a
files xen/arch/x86/traps.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_64/entry.S
line diff
     1.1 --- a/xen/arch/x86/traps.c	Mon May 23 15:29:59 2005 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Mon May 23 18:17:51 2005 +0000
     1.3 @@ -245,12 +245,6 @@ static inline int do_trap(int trapnr, ch
     1.4      if ( !GUEST_MODE(regs) )
     1.5          goto xen_fault;
     1.6  
     1.7 -#ifndef NDEBUG
     1.8 -    if ( (ed->arch.guest_context.trap_ctxt[trapnr].address == 0) &&
     1.9 -         (ed->domain->domain_id == 0) )
    1.10 -        goto xen_fault;
    1.11 -#endif
    1.12 -
    1.13      ti = &current->arch.guest_context.trap_ctxt[trapnr];
    1.14      tb->flags = TBF_EXCEPTION;
    1.15      tb->cs    = ti->cs;
    1.16 @@ -450,12 +444,6 @@ asmlinkage int do_page_fault(struct cpu_
    1.17      if ( !GUEST_MODE(regs) )
    1.18          goto xen_fault;
    1.19  
    1.20 -#ifndef NDEBUG
    1.21 -    if ( (ed->arch.guest_context.trap_ctxt[TRAP_page_fault].address == 0) &&
    1.22 -         (d->domain_id == 0) )
    1.23 -        goto xen_fault;
    1.24 -#endif
    1.25 -
    1.26      propagate_page_fault(addr, regs->error_code);
    1.27      return 0; 
    1.28  
    1.29 @@ -932,12 +920,6 @@ asmlinkage int do_general_protection(str
    1.30          return 0;
    1.31  #endif
    1.32  
    1.33 -#ifndef NDEBUG
    1.34 -    if ( (ed->arch.guest_context.trap_ctxt[TRAP_gp_fault].address == 0) &&
    1.35 -         (ed->domain->domain_id == 0) )
    1.36 -        goto gp_in_kernel;
    1.37 -#endif
    1.38 -
    1.39      /* Pass on GPF as is. */
    1.40      ti = &current->arch.guest_context.trap_ctxt[TRAP_gp_fault];
    1.41      tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
     2.1 --- a/xen/arch/x86/x86_32/entry.S	Mon May 23 15:29:59 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_32/entry.S	Mon May 23 18:17:51 2005 +0000
     2.3 @@ -331,6 +331,8 @@ 1:      /* Construct a stack frame: EFLA
     2.4          movb TRAPBOUNCE_flags(%edx),%cl
     2.5          subl $12,%esi
     2.6          movl UREGS_eip+4(%esp),%eax
     2.7 +        test %eax,%eax
     2.8 +        jz   domain_crash_synchronous
     2.9  FLT14:  movl %eax,%gs:(%esi) 
    2.10          movl EDOMAIN_vcpu_info(%ebx),%eax
    2.11          pushl VCPUINFO_upcall_mask(%eax)
     3.1 --- a/xen/arch/x86/x86_64/entry.S	Mon May 23 15:29:59 2005 +0000
     3.2 +++ b/xen/arch/x86/x86_64/entry.S	Mon May 23 18:17:51 2005 +0000
     3.3 @@ -320,6 +320,8 @@ FLT4:   movq  %rax,16(%rsi)             
     3.4          movw  UREGS_cs+8(%rsp),%ax      # Bits  0-15: CS
     3.5  FLT5:   movq  %rax,8(%rsi)              # CS/saved_upcall_mask
     3.6          movq  UREGS_rip+8(%rsp),%rax
     3.7 +        testq %rax,%rax
     3.8 +        jz    domain_crash_synchronous
     3.9  FLT6:   movq  %rax,(%rsi)               # RIP
    3.10          testb $TBF_EXCEPTION_ERRCODE,%cl
    3.11          jz    1f