x86 fixes for 4.4
Linus,
please pull the latest x86-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus
This update contains:
- MPX updates for handling 32bit processes
- A fix for a long standing bug in 32bit signal frame handling related to FPU/XSAVE state
- Handle get_xsave_addr() correctly in KVM
- Fix SMAP check under paravirtualization
- Add a comment to the static function trace entry to avoid further confusion about the difference to dynamic tracing.
Thanks,
tglx
------------------>
Andrew Cooper (1):
x86/cpu: Fix SMAP check in PVOPS environments
Dave Hansen (3):
x86/mpx: Do proper get_user() when running 32-bit binaries on 64-bit kernels x86/mpx: Fix 32-bit address space calculation
x86/fpu: Fix 32-bit signal frame handling
Huaitong Han (1):
x86/fpu: Fix get_xsave_addr() behavior under virtualization
Namhyung Kim (1):
x86/ftrace: Add comment on static function tracing
arch/x86/kernel/cpu/common.c | 3 +-- arch/x86/kernel/fpu/signal.c | 11 +++++------ arch/x86/kernel/fpu/xstate.c | 1 - arch/x86/kernel/mcount_64.S | 6 ++++++ arch/x86/mm/mpx.c | 47 ++++++++++++++++++++++++++++++++++++++------ 5 files changed, 53 insertions(+), 15 deletions(-)
arch/x86/kernel/cpu/common.c +1 -2
@@ -273,10 +273,9 @@ __setup("nosmap", setup_disable_smap); static __always_inline void setup_smap(struct cpuinfo_x86 *c) { -unsigned long eflags; +unsigned long eflags =native_save_fl ();/* This should have been cleared long ago */ -raw_local_save_flags (eflags);BUG_ON (eflags &X86_EFLAGS_AC );if (cpu_has (c,X86_FEATURE_SMAP )) {
arch/x86/kernel/fpu/signal.c +5 -6
@@ -385,20 +385,19 @@ fpu__alloc_mathframe(unsigned long sp, int ia32_frame,*/ void fpu__init_prepare_fx_sw_frame (void ) { -int fsave_header_size =sizeof (struct fregs_state );int size = xstate_size +FP_XSTATE_MAGIC2_SIZE ; -if (config_enabled (CONFIG_X86_32 )) - size += fsave_header_size; - fx_sw_reserved.magic1 =FP_XSTATE_MAGIC1 ; fx_sw_reserved.extended_size = size; fx_sw_reserved.xfeatures = xfeatures_mask; fx_sw_reserved.xstate_size = xstate_size; -if (config_enabled (CONFIG_IA32_EMULATION )) { +if (config_enabled (CONFIG_IA32_EMULATION ) || +config_enabled (CONFIG_X86_32 )) { +int fsave_header_size =sizeof (struct fregs_state ); + fx_sw_reserved_ia32 = fx_sw_reserved; - fx_sw_reserved_ia32.extended_size += fsave_header_size; + fx_sw_reserved_ia32.extended_size = size + fsave_header_size; } }
arch/x86/kernel/fpu/xstate.c +0 -1
@@ -694,7 +694,6 @@ void *get_xsave_addr(struct xregs_state *xsave, int xstate_feature)if (!boot_cpu_has (X86_FEATURE_XSAVE ))return NULL ; - xsave = ¤t->thread.fpu.state.xsave;/* * We should not ever be requesting features that we * have not enabled. Remember that pcntxt_mask is
arch/x86/kernel/mcount_64.S +6 -0
@@ -278,6 +278,12 @@ trace: /* save_mcount_regs fills in first two parameters */ save_mcount_regs + /* + * When DYNAMIC_FTRACE is not defined, ARCH_SUPPORTS_FTRACE_OPS is not + * set (see include/asm/ftrace.h and include/linux/ftrace.h). Only the + * ip and parent ip are used and the list function is called when + * function tracing is enabled. + */ call *ftrace_trace_function restore_mcount_regs
arch/x86/mm/mpx.c +41 -6
65 lines not on this page · raw message