[PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-10 Thread Borislav Petkov
From: Oleg Nesterov fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled memory. And note that both memset()'s look confusing. Yes, offsetof() is 0 for ->fxsave or ->fsave, but it would be more clean to turn them

[PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-10 Thread Borislav Petkov
From: Oleg Nesterov o...@redhat.com fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled memory. And note that both memset()'s look confusing. Yes, offsetof() is 0 for -fxsave or -fsave, but it would be more clean

Re: [PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-04 Thread Borislav Petkov
On Mon, Mar 02, 2015 at 07:32:57PM +0100, Oleg Nesterov wrote: > fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, > alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled > memory. > > And note that both memset()'s look confusing. Yes, offsetof() is 0 > for ->fxsave

Re: [PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-04 Thread Borislav Petkov
On Mon, Mar 02, 2015 at 07:32:57PM +0100, Oleg Nesterov wrote: fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled memory. And note that both memset()'s look confusing. Yes, offsetof() is 0 for -fxsave or

Re: [PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-03 Thread Rik van Riel
On 03/02/2015 01:32 PM, Oleg Nesterov wrote: > fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, > alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled > memory. > > And note that both memset()'s look confusing. Yes, offsetof() is 0 > for ->fxsave or ->fsave, but

Re: [PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-03 Thread Rik van Riel
On 03/02/2015 01:32 PM, Oleg Nesterov wrote: fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled memory. And note that both memset()'s look confusing. Yes, offsetof() is 0 for -fxsave or -fsave, but it would

[PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-02 Thread Oleg Nesterov
fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled memory. And note that both memset()'s look confusing. Yes, offsetof() is 0 for ->fxsave or ->fsave, but it would be more clean to turn them into a single memset()

[PATCH 2/2] x86/fpu: factor out memset(xstate, 0) in fpu_finit() paths

2015-03-02 Thread Oleg Nesterov
fx_finit() has 2 users but only fpu_finit() needs to nullify xstate, alloc_bootmem_align() in setup_init_fpu_buf() returns zero-filled memory. And note that both memset()'s look confusing. Yes, offsetof() is 0 for -fxsave or -fsave, but it would be more clean to turn them into a single memset()