KVM: x86: remove eager_fpu field of struct kvm_vcpu_arch
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2016 09:00:11 +0000 (10:00 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Mar 2016 13:04:36 +0000 (14:04 +0100)
It is now equal to use_eager_fpu(), which simply tests a cpufeature bit.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/x86.c

index d110dc44d6c2bf681ece60a6986af94cfbddaeb2..01c8b501cb6d5afbdd5eb1c5dfaba366ea158cf8 100644 (file)
@@ -503,7 +503,6 @@ struct kvm_vcpu_arch {
        struct kvm_mmu_memory_cache mmu_page_header_cache;
 
        struct fpu guest_fpu;
-       bool eager_fpu;
        u64 xcr0;
        u64 guest_supported_xcr0;
        u32 guest_xstate_size;
index fa241d4fda9836918eed84aae40b5e69574dab63..0029644bf09c39117ef7c1d2cca05561341a24e1 100644 (file)
@@ -104,8 +104,7 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu)
        if (best && (best->eax & (F(XSAVES) | F(XSAVEC))))
                best->ebx = xstate_required_size(vcpu->arch.xcr0, true);
 
-       vcpu->arch.eager_fpu = use_eager_fpu();
-       if (vcpu->arch.eager_fpu)
+       if (use_eager_fpu())
                kvm_x86_ops->fpu_activate(vcpu);
 
        /*
index 60d6c0036a98287eb0b2ac56106a4a027c70363d..bcbce0fa0bc278b0c17fddf92e89395ea9c11d4f 100644 (file)
@@ -7329,7 +7329,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
         * Every 255 times fpu_counter rolls over to 0; a guest that uses
         * the FPU in bursts will revert to loading it on demand.
         */
-       if (!vcpu->arch.eager_fpu) {
+       if (!use_eager_fpu()) {
                if (++vcpu->fpu_counter < 5)
                        kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
        }