]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branches 'x86-cleanups-for-linus', 'x86-vmware-for-linus', 'x86-mtrr-for-linus...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 23:22:59 +0000 (16:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 23:22:59 +0000 (16:22 -0700)
* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Clean up arch/x86/kernel/cpu/mtrr/cleanup.c: use ";" not "," to terminate statements

* 'x86-vmware-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, vmware: Preset lpj values when on VMware.

* 'x86-mtrr-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, mtrr: Use stop machine context to rendezvous all the cpu's

* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86/apic/es7000_32: Remove unused variable

* 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Avoid unnecessary __clear_user() and xrstor in signal handling

* 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, vdso: Unmap vdso pages

1  2  3  4  5  6  7 
arch/x86/include/asm/i387.h
arch/x86/include/asm/xsave.h
arch/x86/kernel/xsave.c
arch/x86/vdso/vma.c

index 815c5b2b9f57de3011c4cbfa1aba663a2c0033f1,c991b3a7b904bbfea99c5b74e423808eb55b1c56,c991b3a7b904bbfea99c5b74e423808eb55b1c56,c991b3a7b904bbfea99c5b74e423808eb55b1c56,c991b3a7b904bbfea99c5b74e423808eb55b1c56,0f1cf5d53dd823e5d06472bd6446491001947979,c991b3a7b904bbfea99c5b74e423808eb55b1c56..f1accc625beb0983d7cc63044d415a7484c55065
@@@@@@@@ -127,6 -127,6 -127,6 -127,6 -127,6 -127,15 -127,6 +127,15 @@@@@@@@ static inline int fxsave_user(struct i3
       {
        int err;
       
+++++ + /*
+++++ +  * Clear the bytes not touched by the fxsave and reserved
+++++ +  * for the SW usage.
+++++ +  */
+++++ + err = __clear_user(&fx->sw_reserved,
+++++ +                    sizeof(struct _fpx_sw_bytes));
+++++ + if (unlikely(err))
+++++ +         return -EFAULT;
+++++ +
        asm volatile("1:  rex64/fxsave (%[fx])\n\t"
                     "2:\n"
                     ".section .fixup,\"ax\"\n"
@@@@@@@@ -482,8 -482,6 -482,6 -482,6 -482,6 -491,6 -482,6 +491,8 @@@@@@@@ static inline void fpu_copy(struct fpu 
        memcpy(dst->state, src->state, xstate_size);
       }
       
 ++++++extern void fpu_finit(struct fpu *fpu);
 ++++++
       #endif /* __ASSEMBLY__ */
       
       #define PSHUFB_XMM5_XMM0 .byte 0x66, 0x0f, 0x38, 0x00, 0xc5
index 32c36668fa7bc1b6b3cc5fd31b1ddbdf3d0a9fa5,2c4390cae22883014816647319fb6569d6867c2c,2c4390cae22883014816647319fb6569d6867c2c,2c4390cae22883014816647319fb6569d6867c2c,2c4390cae22883014816647319fb6569d6867c2c,30dfc81804d52d57ddba73e631af31ecae1846ec,2c4390cae22883014816647319fb6569d6867c2c..06acdbd7570a571cccfa3db673837446b3d100cd
       
       #define FXSAVE_SIZE      512
       
 ++++++#define XSAVE_HDR_SIZE       64
 ++++++#define XSAVE_HDR_OFFSET    FXSAVE_SIZE
 ++++++
 ++++++#define XSAVE_YMM_SIZE       256
 ++++++#define XSAVE_YMM_OFFSET    (XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET)
 ++++++
       /*
        * These are the features that the OS can handle currently.
        */
@@@@@@@@ -65,6 -59,6 -59,6 -59,6 -59,6 -59,16 -59,6 +65,16 @@@@@@@@ static inline int fpu_xrstor_checking(s
       static inline int xsave_user(struct xsave_struct __user *buf)
       {
        int err;
+++++ +
+++++ + /*
+++++ +  * Clear the xsave header first, so that reserved fields are
+++++ +  * initialized to zero.
+++++ +  */
+++++ + err = __clear_user(&buf->xsave_hdr,
+++++ +                    sizeof(struct xsave_hdr_struct));
+++++ + if (unlikely(err))
+++++ +         return -EFAULT;
+++++ +
        __asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
                             "2:\n"
                             ".section .fixup,\"ax\"\n"
diff --combined arch/x86/kernel/xsave.c
index 980149867a1910db07040aed05537ecd66e3752e,37e68fc5e24a4daa33bcb6c730162a0969c91430,37e68fc5e24a4daa33bcb6c730162a0969c91430,37e68fc5e24a4daa33bcb6c730162a0969c91430,37e68fc5e24a4daa33bcb6c730162a0969c91430,6e73db1b7b4ee67fe2a8a8d5b99d0e8b7c84a669,37e68fc5e24a4daa33bcb6c730162a0969c91430..a4ae302f03aa8b93fc18c1e71cf0afe3a2f8af02
@@@@@@@@ -36,14 -36,15 -36,15 -36,15 -36,15 -36,15 -36,15 +36,14 @@@@@@@@ int check_for_xstate(struct i387_fxsave
       
        err = __copy_from_user(fx_sw_user, &buf->sw_reserved[0],
                               sizeof(struct _fpx_sw_bytes));
 ------
        if (err)
 ------         return err;
 ++++++         return -EFAULT;
       
        /*
         * First Magic check failed.
         */
        if (fx_sw_user->magic1 != FP_XSTATE_MAGIC1)
 ------         return -1;
 ++++++         return -EINVAL;
       
        /*
         * Check for error scenarios.
        if (fx_sw_user->xstate_size < min_xstate_size ||
            fx_sw_user->xstate_size > xstate_size ||
            fx_sw_user->xstate_size > fx_sw_user->extended_size)
 ------         return -1;
 ++++++         return -EINVAL;
       
        err = __get_user(magic2, (__u32 *) (((void *)fpstate) +
                                            fx_sw_user->extended_size -
                                            FP_XSTATE_MAGIC2_SIZE));
 ++++++ if (err)
 ++++++         return err;
        /*
         * Check for the presence of second magic word at the end of memory
         * layout. This detects the case where the user just copied the legacy
         * fpstate layout with out copying the extended state information
         * in the memory layout.
         */
 ------ if (err || magic2 != FP_XSTATE_MAGIC2)
 ------         return -1;
 ++++++ if (magic2 != FP_XSTATE_MAGIC2)
 ++++++         return -EFAULT;
       
        return 0;
       }
@@@@@@@@ -92,14 -91,14 -91,14 -91,14 -91,14 -91,6 -91,14 +92,6 @@@@@@@@ int save_i387_xstate(void __user *buf
                return 0;
       
        if (task_thread_info(tsk)->status & TS_USEDFPU) {
----- -         /*
----- -          * Start with clearing the user buffer. This will present a
----- -          * clean context for the bytes not touched by the fxsave/xsave.
----- -          */
----- -         err = __clear_user(buf, sig_xstate_size);
----- -         if (err)
----- -                 return err;
----- -
                if (use_xsave())
                        err = xsave_user(buf);
                else
@@@@@@@@ -185,8 -184,8 -184,8 -184,8 -184,8 -176,8 -184,8 +177,8 @@@@@@@@ static int restore_user_xstate(void __u
         * init the state skipped by the user.
         */
        mask = pcntxt_mask & ~mask;
----- -
----- - xrstor_state(init_xstate_buf, mask);
+++++ + if (unlikely(mask))
+++++ +         xrstor_state(init_xstate_buf, mask);
       
        return 0;
       
diff --combined arch/x86/vdso/vma.c
index 43456ee176923c871e29ce23fd2b6218dbc58266,ac74869b8140754b45277126fb6f5dcc5a9e6834,ac74869b8140754b45277126fb6f5dcc5a9e6834,ac74869b8140754b45277126fb6f5dcc5a9e6834,ac74869b8140754b45277126fb6f5dcc5a9e6834,ac74869b8140754b45277126fb6f5dcc5a9e6834,80f23ed483efa9e0f0bab3ff9bfb5cf0bc9c4f8e..4b5d26f108bbb21f9ff1ac494388b70fa610c247
@@@@@@@@ -67,6 -67,6 -67,6 -67,6 -67,6 -67,6 -67,7 +67,7 @@@@@@@@ static int __init init_vdso_vars(void
        *(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x;
       #include "vextern.h"
       #undef VEXTERN
++++++  vunmap(vbase);
        return 0;
       
        oom:
        vdso_enabled = 0;
        return -ENOMEM;
       }
 ------__initcall(init_vdso_vars);
 ++++++subsys_initcall(init_vdso_vars);
       
       struct linux_binprm;