From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759502AbbEERFe (ORCPT ); Tue, 5 May 2015 13:05:34 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:35949 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760717AbbEEQ2I (ORCPT ); Tue, 5 May 2015 12:28:08 -0400 From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Andy Lutomirski , Borislav Petkov , Dave Hansen , Fenghua Yu , "H. Peter Anvin" , Linus Torvalds , Oleg Nesterov , Thomas Gleixner Subject: [PATCH 015/208] x86/fpu: Rename fpu_finit() to fpstate_init() Date: Tue, 5 May 2015 18:23:55 +0200 Message-Id: <1430843228-13749-16-git-send-email-mingo@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430843228-13749-1-git-send-email-mingo@kernel.org> References: <1430843228-13749-1-git-send-email-mingo@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make it clear that we are initializing the in-memory FPU context area, no the FPU registers. Also move it to the fpu__*() namespace. Reviewed-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/include/asm/i387.h | 2 +- arch/x86/kernel/i387.c | 8 ++++---- arch/x86/kernel/xsave.c | 2 +- arch/x86/kvm/x86.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 0367d17371f5..6552a16e0e38 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h @@ -19,8 +19,8 @@ struct pt_regs; struct user_i387_struct; extern int fpstate_alloc_init(struct task_struct *curr); +extern void fpstate_init(struct fpu *fpu); -extern void fpu_finit(struct fpu *fpu); extern int dump_fpu(struct pt_regs *, struct user_i387_struct *); extern void math_state_restore(void); diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 5f2feb63b72a..e0c16e86deb0 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -225,7 +225,7 @@ void fpu_init(void) eager_fpu_init(); } -void fpu_finit(struct fpu *fpu) +void fpstate_init(struct fpu *fpu) { if (!cpu_has_fpu) { finit_soft_fpu(&fpu->state->soft); @@ -244,7 +244,7 @@ void fpu_finit(struct fpu *fpu) fp->fos = 0xffff0000u; } } -EXPORT_SYMBOL_GPL(fpu_finit); +EXPORT_SYMBOL_GPL(fpstate_init); int fpstate_alloc(struct fpu *fpu) { @@ -284,7 +284,7 @@ int fpstate_alloc_init(struct task_struct *curr) if (ret) return ret; - fpu_finit(&curr->thread.fpu); + fpstate_init(&curr->thread.fpu); /* Safe to do for the current task: */ curr->flags |= PF_USED_MATH; @@ -318,7 +318,7 @@ static int fpu__unlazy_stopped(struct task_struct *child) if (ret) return ret; - fpu_finit(&child->thread.fpu); + fpstate_init(&child->thread.fpu); /* Safe to do for stopped child tasks: */ child->flags |= PF_USED_MATH; diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index a977cdd03825..163b5cc582ef 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c @@ -395,7 +395,7 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size) if (__copy_from_user(&fpu->state->xsave, buf_fx, state_size) || __copy_from_user(&env, buf, sizeof(env))) { - fpu_finit(fpu); + fpstate_init(fpu); err = -1; } else { sanitize_restored_xstate(tsk, &env, xstate_bv, fx_only); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 80a411c83083..26b1f89fc608 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -7011,7 +7011,7 @@ int fx_init(struct kvm_vcpu *vcpu) if (err) return err; - fpu_finit(&vcpu->arch.guest_fpu); + fpstate_init(&vcpu->arch.guest_fpu); if (cpu_has_xsaves) vcpu->arch.guest_fpu.state->xsave.xsave_hdr.xcomp_bv = host_xcr0 | XSTATE_COMPACTION_ENABLED; -- 2.1.0