ia64/xen-unstable

changeset 8567:dbe5427f3863

merge
author Ian.Campbell@xensource.com
date Wed Jan 11 18:22:24 2006 +0000 (2006-01-11)
parents 1c70b9d81731 cc996a91af71
children 228c96d95c80
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S	Wed Jan 11 16:26:04 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S	Wed Jan 11 18:22:24 2006 +0000
     1.3 @@ -76,7 +76,7 @@ IF_MASK		= 0x00000200
     1.4  DF_MASK		= 0x00000400 
     1.5  NT_MASK		= 0x00004000
     1.6  VM_MASK		= 0x00020000
     1.7 -/* pseudo-eflags */
     1.8 +/* Pseudo-eflags. */
     1.9  NMI_MASK	= 0x80000000
    1.10  	
    1.11  /* Offsets into shared_info_t. */
     2.1 --- a/xen/arch/x86/x86_32/traps.c	Wed Jan 11 16:26:04 2006 +0000
     2.2 +++ b/xen/arch/x86/x86_32/traps.c	Wed Jan 11 18:22:24 2006 +0000
     2.3 @@ -161,42 +161,50 @@ asmlinkage unsigned long do_iret(void)
     2.4  {
     2.5      struct cpu_user_regs *regs = guest_cpu_user_regs();
     2.6  
     2.7 -    /* Restore EAX (clobbered by hypercall) */
     2.8 -    if (copy_from_user(&regs->eax, (void __user *)regs->esp, 4))
     2.9 +    /* Restore EAX (clobbered by hypercall). */
    2.10 +    if ( copy_from_user(&regs->eax, (void __user *)regs->esp, 4) )
    2.11          domain_crash_synchronous();
    2.12      regs->esp += 4;
    2.13  
    2.14 -    /* Restore EFLAGS, CS and EIP */
    2.15 -    if (copy_from_user(&regs->eip, (void __user *)regs->esp, 12))
    2.16 +    /* Restore EFLAGS, CS and EIP. */
    2.17 +    if ( copy_from_user(&regs->eip, (void __user *)regs->esp, 12) )
    2.18          domain_crash_synchronous();
    2.19  
    2.20 -    if (VM86_MODE(regs)) {
    2.21 -        /* return to VM86 mode: restore ESP,SS,ES,DS,FS and GS */
    2.22 +    if ( VM86_MODE(regs) )
    2.23 +    {
    2.24 +        /* Return to VM86 mode: restore ESP,SS,ES,DS,FS and GS. */
    2.25          if(copy_from_user(&regs->esp, (void __user *)(regs->esp+12), 24))
    2.26              domain_crash_synchronous();
    2.27 -    } else if (RING_0(regs)) {
    2.28 +    }
    2.29 +    else if ( RING_0(regs) )
    2.30 +    {
    2.31          domain_crash_synchronous();
    2.32 -    } else if (RING_1(regs)) {
    2.33 -        /* return to ring 1: pop EFLAGS,CS and EIP */
    2.34 +    }
    2.35 +    else if ( RING_1(regs) ) {
    2.36 +        /* Return to ring 1: pop EFLAGS,CS and EIP. */
    2.37          regs->esp += 12;
    2.38 -    } else {
    2.39 -        /* return to ring 2/3: restore ESP and SS */
    2.40 -        if(copy_from_user(&regs->esp, (void __user *)(regs->esp+12), 8))
    2.41 +    }
    2.42 +    else
    2.43 +    {
    2.44 +        /* Return to ring 2/3: restore ESP and SS. */
    2.45 +        if ( copy_from_user(&regs->esp, (void __user *)(regs->esp+12), 8) )
    2.46              domain_crash_synchronous();
    2.47      }
    2.48  
    2.49 -    /* Fixup EFLAGS */
    2.50 +    /* Fixup EFLAGS. */
    2.51      regs->eflags &= ~X86_EFLAGS_IOPL;
    2.52      regs->eflags |= X86_EFLAGS_IF;
    2.53  
    2.54 -    /* No longer in NMI context */
    2.55 +    /* No longer in NMI context. */
    2.56      clear_bit(_VCPUF_nmi_masked, &current->vcpu_flags);
    2.57  
    2.58 -    /* Restore upcall mask from saved value */
    2.59 +    /* Restore upcall mask from saved value. */
    2.60      current->vcpu_info->evtchn_upcall_mask = regs->saved_upcall_mask;
    2.61  
    2.62 -    /* the hypercall exit path will overwrite eax
    2.63 -     * with this return value */
    2.64 +    /*
    2.65 +     * The hypercall exit path will overwrite EAX with this return
    2.66 +     * value.
    2.67 +     */
    2.68      return regs->eax;
    2.69  }
    2.70  
     3.1 --- a/xen/arch/x86/x86_64/traps.c	Wed Jan 11 16:26:04 2006 +0000
     3.2 +++ b/xen/arch/x86/x86_64/traps.c	Wed Jan 11 18:22:24 2006 +0000
     3.3 @@ -118,16 +118,16 @@ extern void toggle_guest_mode(struct vcp
     3.4  
     3.5  long do_iret(void)
     3.6  {
     3.7 -    struct cpu_user_regs  *regs = guest_cpu_user_regs();
     3.8 +    struct cpu_user_regs *regs = guest_cpu_user_regs();
     3.9      struct iret_context iret_saved;
    3.10 -    struct vcpu    *v = current;
    3.11 +    struct vcpu *v = current;
    3.12  
    3.13      if ( unlikely(copy_from_user(&iret_saved, (void *)regs->rsp, sizeof(iret_saved))) ||
    3.14           unlikely(pagetable_get_paddr(v->arch.guest_table_user) == 0) )
    3.15          return -EFAULT;
    3.16  
    3.17 -    /* returning to user mode */
    3.18 -    if ((iret_saved.cs & 0x03) == 3)
    3.19 +    /* Returning to user mode. */
    3.20 +    if ( (iret_saved.cs & 0x03) == 3 )
    3.21          toggle_guest_mode(v);
    3.22  
    3.23      regs->rip    = iret_saved.rip;
    3.24 @@ -143,7 +143,7 @@ long do_iret(void)
    3.25          regs->rcx = iret_saved.rcx;
    3.26      }
    3.27  
    3.28 -    /* No longer in NMI context */
    3.29 +    /* No longer in NMI context. */
    3.30      clear_bit(_VCPUF_nmi_masked, &current->vcpu_flags);
    3.31  
    3.32      /* Saved %rax gets written back to regs->rax in entry.S. */
     4.1 --- a/xen/common/kernel.c	Wed Jan 11 16:26:04 2006 +0000
     4.2 +++ b/xen/common/kernel.c	Wed Jan 11 18:22:24 2006 +0000
     4.3 @@ -160,7 +160,6 @@ long do_nmi_op(unsigned int cmd, void *a
     4.4              rc = -EINVAL;
     4.5          else
     4.6              current->nmi_addr = (unsigned long)arg;
     4.7 -        printk("***** NMI handler at 0x%lx\n", current->nmi_addr);
     4.8          break;
     4.9      case XENNMI_unregister_callback:
    4.10          current->nmi_addr = 0;
     5.1 --- a/xen/include/public/arch-x86_64.h	Wed Jan 11 16:26:04 2006 +0000
     5.2 +++ b/xen/include/public/arch-x86_64.h	Wed Jan 11 18:22:24 2006 +0000
     5.3 @@ -114,8 +114,10 @@ struct iret_context {
     5.4      uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
     5.5      /* Bottom of iret stack frame. */
     5.6  };
     5.7 -/* For compatibility with HYPERVISOR_switch_to_user which is the old
     5.8 - * name for HYPERVISOR_iret */
     5.9 +/*
    5.10 + * For compatibility with HYPERVISOR_switch_to_user which is the old
    5.11 + * name for HYPERVISOR_iret.
    5.12 + */
    5.13  struct switch_to_user {
    5.14      /* Top of stack (%rsp at point of hypercall). */
    5.15      uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;