summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorIngo Molnar2015-04-23 12:49:20 +0200
committerIngo Molnar2015-05-19 15:47:25 +0200
commitc5bedc6847c3be6efe0e671a6155c9a25fd468bf (patch)
treef1eb66ea2807447c95e915f281d6815578b7e627 /arch/x86/kvm/x86.c
parentx86/fpu: Document fpu__unlazy_stopped() (diff)
downloadkernel-qcow2-linux-c5bedc6847c3be6efe0e671a6155c9a25fd468bf.tar.gz
kernel-qcow2-linux-c5bedc6847c3be6efe0e671a6155c9a25fd468bf.tar.xz
kernel-qcow2-linux-c5bedc6847c3be6efe0e671a6155c9a25fd468bf.zip
x86/fpu: Get rid of PF_USED_MATH usage, convert it to fpu->fpstate_active
Introduce a simple fpu->fpstate_active flag in the fpu context data structure and use that instead of PF_USED_MATH in task->flags. Testing for this flag byte should be slightly more efficient than testing a bit in a bitmask, but the main advantage is that most FPU functions can now be performed on a 'struct fpu' alone, they don't need access to 'struct task_struct' anymore. There's a slight linecount increase, mostly due to the 'fpu' local variables and due to extra comments. The local variables will go away once we move most of the FPU methods to pure 'struct fpu' parameters. Reviewed-by: Borislav Petkov <bp@alien8.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0635a1fd43ba..bab8afb61dc1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6597,10 +6597,11 @@ static int complete_emulated_mmio(struct kvm_vcpu *vcpu)
int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{
+ struct fpu *fpu = &current->thread.fpu;
int r;
sigset_t sigsaved;
- if (!(current->flags & PF_USED_MATH) && fpstate_alloc_init(current))
+ if (!fpu->fpstate_active && fpstate_alloc_init(current))
return -ENOMEM;
if (vcpu->sigset_active)