Fixup some bogus formatting and remove a stray debug printk
authorIan.Campbell@xensource.com <Ian.Campbell@xensource.com>
Wed, 11 Jan 2006 17:50:05 +0000 (17:50 +0000)
committerIan.Campbell@xensource.com <Ian.Campbell@xensource.com>
Wed, 11 Jan 2006 17:50:05 +0000 (17:50 +0000)
Signed-off-by: Ian Campbell <Ian.Campbell@xensource.com>
linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S
xen/arch/x86/x86_32/traps.c
xen/arch/x86/x86_64/traps.c
xen/common/kernel.c
xen/include/public/arch-x86_64.h

index 9c50c32426730086c860c0cfb1d5c6423044cb40..ef23e7ca3c7f0487c04e737fc4e472c5dc29e95b 100644 (file)
@@ -76,7 +76,7 @@ IF_MASK               = 0x00000200
 DF_MASK                = 0x00000400 
 NT_MASK                = 0x00004000
 VM_MASK                = 0x00020000
-/* pseudo-eflags */
+/* Pseudo-eflags. */
 NMI_MASK       = 0x80000000
        
 /* Offsets into shared_info_t. */
index e70081e1bf6b48b7a08041caecfa3abd8162d5eb..2c896bce2a75919503a821e189ed774ea727378c 100644 (file)
@@ -161,42 +161,50 @@ asmlinkage unsigned long do_iret(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
 
-    /* Restore EAX (clobbered by hypercall) */
-    if (copy_from_user(&regs->eax, (void __user *)regs->esp, 4))
+    /* Restore EAX (clobbered by hypercall). */
+    if ( copy_from_user(&regs->eax, (void __user *)regs->esp, 4) )
         domain_crash_synchronous();
     regs->esp += 4;
 
-    /* Restore EFLAGS, CS and EIP */
-    if (copy_from_user(&regs->eip, (void __user *)regs->esp, 12))
+    /* Restore EFLAGS, CS and EIP. */
+    if ( copy_from_user(&regs->eip, (void __user *)regs->esp, 12) )
         domain_crash_synchronous();
 
-    if (VM86_MODE(regs)) {
-        /* return to VM86 mode: restore ESP,SS,ES,DS,FS and GS */
+    if ( VM86_MODE(regs) )
+    {
+        /* Return to VM86 mode: restore ESP,SS,ES,DS,FS and GS. */
         if(copy_from_user(&regs->esp, (void __user *)(regs->esp+12), 24))
             domain_crash_synchronous();
-    } else if (RING_0(regs)) {
+    }
+    else if ( RING_0(regs) )
+    {
         domain_crash_synchronous();
-    } else if (RING_1(regs)) {
-        /* return to ring 1: pop EFLAGS,CS and EIP */
+    }
+    else if ( RING_1(regs) ) {
+        /* Return to ring 1: pop EFLAGS,CS and EIP. */
         regs->esp += 12;
-    } else {
-        /* return to ring 2/3: restore ESP and SS */
-        if(copy_from_user(&regs->esp, (void __user *)(regs->esp+12), 8))
+    }
+    else
+    {
+        /* Return to ring 2/3: restore ESP and SS. */
+        if ( copy_from_user(&regs->esp, (void __user *)(regs->esp+12), 8) )
             domain_crash_synchronous();
     }
 
-    /* Fixup EFLAGS */
+    /* Fixup EFLAGS. */
     regs->eflags &= ~X86_EFLAGS_IOPL;
     regs->eflags |= X86_EFLAGS_IF;
 
-    /* No longer in NMI context */
+    /* No longer in NMI context. */
     clear_bit(_VCPUF_nmi_masked, &current->vcpu_flags);
 
-    /* Restore upcall mask from saved value */
+    /* Restore upcall mask from saved value. */
     current->vcpu_info->evtchn_upcall_mask = regs->saved_upcall_mask;
 
-    /* the hypercall exit path will overwrite eax
-     * with this return value */
+    /*
+     * The hypercall exit path will overwrite EAX with this return
+     * value.
+     */
     return regs->eax;
 }
 
index e14daa3e7280ec3434ebc9d0c9e3de838ab5d585..af2f55e29a1d042db61ac150bcf6c8f3cbd1c746 100644 (file)
@@ -118,16 +118,16 @@ extern void toggle_guest_mode(struct vcpu *);
 
 long do_iret(void)
 {
-    struct cpu_user_regs  *regs = guest_cpu_user_regs();
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct iret_context iret_saved;
-    struct vcpu    *v = current;
+    struct vcpu *v = current;
 
     if ( unlikely(copy_from_user(&iret_saved, (void *)regs->rsp, sizeof(iret_saved))) ||
          unlikely(pagetable_get_paddr(v->arch.guest_table_user) == 0) )
         return -EFAULT;
 
-    /* returning to user mode */
-    if ((iret_saved.cs & 0x03) == 3)
+    /* Returning to user mode. */
+    if ( (iret_saved.cs & 0x03) == 3 )
         toggle_guest_mode(v);
 
     regs->rip    = iret_saved.rip;
@@ -143,7 +143,7 @@ long do_iret(void)
         regs->rcx = iret_saved.rcx;
     }
 
-    /* No longer in NMI context */
+    /* No longer in NMI context. */
     clear_bit(_VCPUF_nmi_masked, &current->vcpu_flags);
 
     /* Saved %rax gets written back to regs->rax in entry.S. */
index f2bb308652d07c853711b15df57378c7e822da60..3908f04019b861841af775f4772702a38b904049 100644 (file)
@@ -160,7 +160,6 @@ long do_nmi_op(unsigned int cmd, void *arg)
             rc = -EINVAL;
         else
             current->nmi_addr = (unsigned long)arg;
-        printk("***** NMI handler at 0x%lx\n", current->nmi_addr);
         break;
     case XENNMI_unregister_callback:
         current->nmi_addr = 0;
index e9e69db0691fbc7e432929b765c03d2c316510a6..c8c2bd2809569e339dca15454f1a51d1ce072d81 100644 (file)
@@ -114,8 +114,10 @@ struct iret_context {
     uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
     /* Bottom of iret stack frame. */
 };
-/* For compatibility with HYPERVISOR_switch_to_user which is the old
- * name for HYPERVISOR_iret */
+/*
+ * For compatibility with HYPERVISOR_switch_to_user which is the old
+ * name for HYPERVISOR_iret.
+ */
 struct switch_to_user {
     /* Top of stack (%rsp at point of hypercall). */
     uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;