ia64/xen-unstable

changeset 9615:71f74f569b26

Saner error handling in iret hypercall (x86/64).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 06 15:55:37 2006 +0100 (2006-04-06)
parents e568bfe66a52
children 8970d080f719
files xen/arch/x86/x86_64/traps.c
line diff
     1.1 --- a/xen/arch/x86/x86_64/traps.c	Thu Apr 06 15:25:26 2006 +0100
     1.2 +++ b/xen/arch/x86/x86_64/traps.c	Thu Apr 06 15:55:37 2006 +0100
     1.3 @@ -186,13 +186,19 @@ unsigned long do_iret(void)
     1.4  
     1.5      if ( unlikely(copy_from_user(&iret_saved, (void *)regs->rsp,
     1.6                                   sizeof(iret_saved))) )
     1.7 +    {
     1.8 +        DPRINTK("Fault while reading IRET context from guest stack\n");
     1.9          domain_crash_synchronous();
    1.10 +    }
    1.11  
    1.12      /* Returning to user mode? */
    1.13      if ( (iret_saved.cs & 3) == 3 )
    1.14      {
    1.15          if ( unlikely(pagetable_get_paddr(v->arch.guest_table_user) == 0) )
    1.16 -            return -EFAULT;
    1.17 +        {
    1.18 +            DPRINTK("Guest switching to user mode with no user page tables\n");
    1.19 +            domain_crash_synchronous();
    1.20 +        }
    1.21          toggle_guest_mode(v);
    1.22      }
    1.23