]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Nov 2015 05:05:40 +0000 (21:05 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Nov 2015 05:05:40 +0000 (21:05 -0800)
Pull x86 sigcontext header cleanups from Ingo Molnar:
 "This series reorganizes and cleans up various aspects of the main
  sigcontext UAPI headers, such as unifying the data structures and
  updating/adding lots of comments to explain all the ABI details and
  quirks.  The headers can now also be built in user-space standalone"

* 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/headers: Clean up too long lines
  x86/headers: Remove <asm/sigcontext.h> references on the kernel side
  x86/headers: Remove direct sigcontext32.h uses
  x86/headers: Convert sigcontext_ia32 uses to sigcontext_32
  x86/headers: Unify 'struct sigcontext_ia32' and 'struct sigcontext_32'
  x86/headers: Make sigcontext pointers bit independent
  x86/headers: Move the 'struct sigcontext' definitions into the UAPI header
  x86/headers: Clean up the kernel's struct sigcontext types to be ABI-clean
  x86/headers: Convert uses of _fpstate_ia32 to _fpstate_32
  x86/headers: Unify 'struct _fpstate_ia32' and i386 struct _fpstate
  x86/headers: Unify register type definitions between 32-bit compat and i386
  x86/headers: Use ABI types consistently in sigcontext*.h
  x86/headers: Separate out legacy user-space structure definitions
  x86/headers: Clean up and better document uapi/asm/sigcontext.h
  x86/headers: Clean up uapi/asm/sigcontext32.h
  x86/headers: Fix (old) header file dependency bug in uapi/asm/sigcontext32.h

1  2 
arch/x86/ia32/ia32_signal.c
arch/x86/include/asm/processor.h
arch/x86/kernel/asm-offsets.c
arch/x86/kernel/fpu/signal.c
arch/x86/kernel/signal.c

index e6a5c275cd3f62c858a33641e5b68f87909ef84d,5959042fae8d8ce9d48b6417bd03924a033d0458..0552884da18db24c7910fa8166a1385f56b6d4a9
@@@ -26,7 -26,7 +26,7 @@@
  #include <asm/ptrace.h>
  #include <asm/ia32_unistd.h>
  #include <asm/user32.h>
- #include <asm/sigcontext32.h>
+ #include <uapi/asm/sigcontext.h>
  #include <asm/proto.h>
  #include <asm/vdso.h>
  #include <asm/sigframe.h>
@@@ -68,7 -68,7 +68,7 @@@
  }
  
  static int ia32_restore_sigcontext(struct pt_regs *regs,
-                                  struct sigcontext_ia32 __user *sc)
+                                  struct sigcontext_32 __user *sc)
  {
        unsigned int tmpflags, err = 0;
        void __user *buf;
@@@ -170,7 -170,7 +170,7 @@@ badframe
   * Set up a signal frame.
   */
  
- static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
+ static int ia32_setup_sigcontext(struct sigcontext_32 __user *sc,
                                 void __user *fpstate,
                                 struct pt_regs *regs, unsigned int mask)
  {
@@@ -234,7 -234,7 +234,7 @@@ static void __user *get_sigframe(struc
                unsigned long fx_aligned, math_size;
  
                sp = fpu__alloc_mathframe(sp, 1, &fx_aligned, &math_size);
-               *fpstate = (struct _fpstate_ia32 __user *) sp;
+               *fpstate = (struct _fpstate_32 __user *) sp;
                if (copy_fpstate_to_sigframe(*fpstate, (void __user *)fx_aligned,
                                    math_size) < 0)
                        return (void __user *) -1L;
@@@ -289,7 -289,7 +289,7 @@@ int ia32_setup_frame(int sig, struct ks
                /* Return stub is in 32bit vsyscall page */
                if (current->mm->context.vdso)
                        restorer = current->mm->context.vdso +
 -                              selected_vdso32->sym___kernel_sigreturn;
 +                              vdso_image_32.sym___kernel_sigreturn;
                else
                        restorer = &frame->retcode;
        }
@@@ -368,7 -368,7 +368,7 @@@ int ia32_setup_rt_frame(int sig, struc
                        restorer = ksig->ka.sa.sa_restorer;
                else
                        restorer = current->mm->context.vdso +
 -                              selected_vdso32->sym___kernel_rt_sigreturn;
 +                              vdso_image_32.sym___kernel_rt_sigreturn;
                put_user_ex(ptr_to_compat(restorer), &frame->pretcode);
  
                /*
index b55f309605549d6226ed6c64023eafc88c67112b,bb911e7183302aa495a9819638d904183f6f5a61..67522256c7ffaf610aa70ef885bd8df584d1bbbd
@@@ -11,7 -11,7 +11,7 @@@ struct vm86
  #include <asm/math_emu.h>
  #include <asm/segment.h>
  #include <asm/types.h>
- #include <asm/sigcontext.h>
+ #include <uapi/asm/sigcontext.h>
  #include <asm/current.h>
  #include <asm/cpufeature.h>
  #include <asm/page.h>
@@@ -556,12 -556,12 +556,12 @@@ static inline unsigned int cpuid_edx(un
  }
  
  /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
 -static inline void rep_nop(void)
 +static __always_inline void rep_nop(void)
  {
        asm volatile("rep; nop" ::: "memory");
  }
  
 -static inline void cpu_relax(void)
 +static __always_inline void cpu_relax(void)
  {
        rep_nop();
  }
index 95a18e25d5bfc5ce14f9e930eef09389c336c8d6,bc9f4afa889ae805dfba043ae31d8debd72c1f3d..439df975bc7aed0861581381476eeb933bc086de
@@@ -43,16 -43,19 +43,16 @@@ void common(void) 
  
  #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
        BLANK();
-       OFFSET(IA32_SIGCONTEXT_ax, sigcontext_ia32, ax);
-       OFFSET(IA32_SIGCONTEXT_bx, sigcontext_ia32, bx);
-       OFFSET(IA32_SIGCONTEXT_cx, sigcontext_ia32, cx);
-       OFFSET(IA32_SIGCONTEXT_dx, sigcontext_ia32, dx);
-       OFFSET(IA32_SIGCONTEXT_si, sigcontext_ia32, si);
-       OFFSET(IA32_SIGCONTEXT_di, sigcontext_ia32, di);
-       OFFSET(IA32_SIGCONTEXT_bp, sigcontext_ia32, bp);
-       OFFSET(IA32_SIGCONTEXT_sp, sigcontext_ia32, sp);
-       OFFSET(IA32_SIGCONTEXT_ip, sigcontext_ia32, ip);
+       OFFSET(IA32_SIGCONTEXT_ax, sigcontext_32, ax);
+       OFFSET(IA32_SIGCONTEXT_bx, sigcontext_32, bx);
+       OFFSET(IA32_SIGCONTEXT_cx, sigcontext_32, cx);
+       OFFSET(IA32_SIGCONTEXT_dx, sigcontext_32, dx);
+       OFFSET(IA32_SIGCONTEXT_si, sigcontext_32, si);
+       OFFSET(IA32_SIGCONTEXT_di, sigcontext_32, di);
+       OFFSET(IA32_SIGCONTEXT_bp, sigcontext_32, bp);
+       OFFSET(IA32_SIGCONTEXT_sp, sigcontext_32, sp);
+       OFFSET(IA32_SIGCONTEXT_ip, sigcontext_32, ip);
  
 -      BLANK();
 -      OFFSET(TI_sysenter_return, thread_info, sysenter_return);
 -
        BLANK();
        OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext);
  #endif
index eb032677f9398d85214654f73a9a7a7653007d32,24aac16603a224d5786a4b7d69df6df687d742d5..ef29b742cea79a99c8e653ea91ae83e82b08ba65
@@@ -56,7 -56,7 +56,7 @@@ static inline int save_fsave_header(str
        if (use_fxsr()) {
                struct xregs_state *xsave = &tsk->thread.fpu.state.xsave;
                struct user_i387_ia32_struct env;
-               struct _fpstate_ia32 __user *fp = buf;
+               struct _fpstate_32 __user *fp = buf;
  
                convert_from_fxsr(&env, tsk);
  
@@@ -107,7 -107,7 +107,7 @@@ static inline int save_xstate_epilog(vo
         * header as well as change any contents in the memory layout.
         * xrestore as part of sigreturn will capture all the changes.
         */
 -      xfeatures |= XSTATE_FPSSE;
 +      xfeatures |= XFEATURE_MASK_FPSSE;
  
        err |= __put_user(xfeatures, (__u32 *)&x->header.xfeatures);
  
@@@ -165,7 -165,7 +165,7 @@@ int copy_fpstate_to_sigframe(void __use
        if (!static_cpu_has(X86_FEATURE_FPU))
                return fpregs_soft_get(current, NULL, 0,
                        sizeof(struct user_i387_ia32_struct), NULL,
-                       (struct _fpstate_ia32 __user *) buf) ? -1 : 1;
+                       (struct _fpstate_32 __user *) buf) ? -1 : 1;
  
        if (fpregs_active()) {
                /* Save the live register state to the user directly. */
@@@ -207,7 -207,7 +207,7 @@@ sanitize_restored_xstate(struct task_st
                 * layout and not enabled by the OS.
                 */
                if (fx_only)
 -                      header->xfeatures = XSTATE_FPSSE;
 +                      header->xfeatures = XFEATURE_MASK_FPSSE;
                else
                        header->xfeatures &= (xfeatures_mask & xfeatures);
        }
@@@ -230,7 -230,7 +230,7 @@@ static inline int copy_user_to_fpregs_z
  {
        if (use_xsave()) {
                if ((unsigned long)buf % 64 || fx_only) {
 -                      u64 init_bv = xfeatures_mask & ~XSTATE_FPSSE;
 +                      u64 init_bv = xfeatures_mask & ~XFEATURE_MASK_FPSSE;
                        copy_kernel_to_xregs(&init_fpstate.xsave, init_bv);
                        return copy_user_to_fxregs(buf);
                } else {
diff --combined arch/x86/kernel/signal.c
index 32165d6499795fd5cff24c80561f984df8af52fd,3724ff38033eb7c4bb5273fb69e7607e429a28d7..b7ffb7c00075787532ceec10b6aed0028ea01b5c
@@@ -63,6 -63,7 +63,7 @@@
  
  int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
  {
+       unsigned long buf_val;
        void __user *buf;
        unsigned int tmpflags;
        unsigned int err = 0;
                regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
                regs->orig_ax = -1;             /* disable syscall checks */
  
-               get_user_ex(buf, &sc->fpstate);
+               get_user_ex(buf_val, &sc->fpstate);
+               buf = (void __user *)buf_val;
        } get_user_catch(err);
  
        err |= fpu__restore_sig(buf, config_enabled(CONFIG_X86_32));
@@@ -196,7 -198,7 +198,7 @@@ static unsigned long align_sigframe(uns
        return sp;
  }
  
 -static inline void __user *
 +static void __user *
  get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
             void __user **fpstate)
  {
@@@ -299,7 -301,7 +301,7 @@@ __setup_frame(int sig, struct ksignal *
  
        if (current->mm->context.vdso)
                restorer = current->mm->context.vdso +
 -                      selected_vdso32->sym___kernel_sigreturn;
 +                      vdso_image_32.sym___kernel_sigreturn;
        else
                restorer = &frame->retcode;
        if (ksig->ka.sa.sa_flags & SA_RESTORER)
@@@ -363,7 -365,7 +365,7 @@@ static int __setup_rt_frame(int sig, st
  
                /* Set up to return from userspace.  */
                restorer = current->mm->context.vdso +
 -                      selected_vdso32->sym___kernel_rt_sigreturn;
 +                      vdso_image_32.sym___kernel_rt_sigreturn;
                if (ksig->ka.sa.sa_flags & SA_RESTORER)
                        restorer = ksig->ka.sa.sa_restorer;
                put_user_ex(restorer, &frame->pretcode);