Merge branch 'x86/cleanups' into x86/signal
Ingo Molnar [Sat, 6 Sep 2008 12:53:20 +0000 (14:53 +0200)]
Conflicts:
arch/x86/kernel/signal_64.c

Signed-off-by: Ingo Molnar <mingo@elte.hu>

13 files changed:
1  2 
arch/x86/boot/compressed/misc.c
arch/x86/ia32/ia32_signal.c
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/process_64.c
arch/x86/kernel/sigframe.h
arch/x86/kernel/signal_64.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/sys_x86_64.c
arch/x86/kernel/traps_64.c
include/asm-x86/apic.h
include/asm-x86/asm.h
include/asm-x86/elf.h
include/asm-x86/resume-trace.h

Simple merge
Simple merge
Simple merge
Simple merge
@@@ -32,6 -23,10 +32,11 @@@ struct rt_sigframe 
        char __user *pretcode;
        struct ucontext uc;
        struct siginfo info;
 +      /* fp state follows here */
  };
+ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
+               sigset_t *set, struct pt_regs *regs);
+ int ia32_setup_frame(int sig, struct k_sigaction *ka,
+               sigset_t *set, struct pt_regs *regs);
  #endif
@@@ -98,9 -154,20 +94,9 @@@ restore_sigcontext(struct pt_regs *regs
        }
  
        {
-               struct _fpstate __user * buf;
+               struct _fpstate __user *buf;
                err |= __get_user(buf, &sc->fpstate);
 -
 -              if (buf) {
 -                      if (!access_ok(VERIFY_READ, buf, sizeof(*buf)))
 -                              goto badframe;
 -                      err |= restore_i387(buf);
 -              } else {
 -                      struct task_struct *me = current;
 -                      if (used_math()) {
 -                              clear_fpu(me);
 -                              clear_used_math();
 -                      }
 -              }
 +              err |= restore_i387_xstate(buf);
        }
  
        err |= __get_user(*pax, &sc->ax);
@@@ -199,10 -270,10 +196,10 @@@ get_stack(struct k_sigaction *ka, struc
  }
  
  static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
-                          sigset_t *set, struct pt_regs * regs)
+                          sigset_t *set, struct pt_regs *regs)
  {
        struct rt_sigframe __user *frame;
 -      struct _fpstate __user *fp = NULL;
 +      void __user *fp = NULL;
        int err = 0;
        struct task_struct *me = current;
  
                frame = (void __user *)round_down(
                        (unsigned long)fp - sizeof(struct rt_sigframe), 16) - 8;
  
 -              if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
 -                      goto give_sigsegv;
 -
 -              if (save_i387(fp) < 0)
 +              if (save_i387_xstate(fp) < 0)
-                       err |= -1; 
+                       err |= -1;
        } else
                frame = get_stack(ka, regs, sizeof(struct rt_sigframe)) - 8;
  
                if (err)
                        goto give_sigsegv;
        }
-               
        /* Create the ucontext.  */
 -      err |= __put_user(0, &frame->uc.uc_flags);
 +      if (cpu_has_xsave)
 +              err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags);
 +      else
 +              err |= __put_user(0, &frame->uc.uc_flags);
        err |= __put_user(0, &frame->uc.uc_link);
        err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
        err |= __put_user(sas_ss_flags(regs->sp),
@@@ -281,8 -352,37 +278,8 @@@ give_sigsegv
  }
  
  /*
 - * Return -1L or the syscall number that @regs is executing.
 - */
 -static long current_syscall(struct pt_regs *regs)
 -{
 -      /*
 -       * We always sign-extend a -1 value being set here,
 -       * so this is always either -1L or a syscall number.
 -       */
 -      return regs->orig_ax;
 -}
 -
 -/*
 - * Return a value that is -EFOO if the system call in @regs->orig_ax
 - * returned an error.  This only works for @regs from @current.
 - */
 -static long current_syscall_ret(struct pt_regs *regs)
 -{
 -#ifdef CONFIG_IA32_EMULATION
 -      if (test_thread_flag(TIF_IA32))
 -              /*
 -               * Sign-extend the value so (int)-EFOO becomes (long)-EFOO
 -               * and will match correctly in comparisons.
 -               */
 -              return (int) regs->ax;
 -#endif
 -      return regs->ax;
 -}
 -
 -/*
   * OK, we're invoking a handler
-  */   
+  */
  
  static int
  handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
                 * handler too.
                 */
                regs->flags &= ~X86_EFLAGS_TF;
 -              if (test_thread_flag(TIF_SINGLESTEP))
 -                      ptrace_notify(SIGTRAP);
  
                spin_lock_irq(&current->sighand->siglock);
-               sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
+               sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
                if (!(ka->sa.sa_flags & SA_NODEFER))
-                       sigaddset(&current->blocked,sig);
+                       sigaddset(&current->blocked, sig);
                recalc_sigpending();
                spin_unlock_irq(&current->sighand->siglock);
 +
 +              tracehook_signal_handler(sig, info, ka, regs,
 +                                       test_thread_flag(TIF_SINGLESTEP));
        }
  
        return ret;
Simple merge
  #include <linux/utsname.h>
  #include <linux/personality.h>
  #include <linux/random.h>
+ #include <linux/uaccess.h>
  
- #include <asm/uaccess.h>
  #include <asm/ia32.h>
 +#include <asm/syscalls.h>
  
- asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags,
-       unsigned long fd, unsigned long off)
+ asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
+               unsigned long prot, unsigned long flags,
+               unsigned long fd, unsigned long off)
  {
        long error;
-       struct file * file;
+       struct file *file;
  
        error = -EINVAL;
        if (off & ~PAGE_MASK)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge