]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/kvm/x86.c
x86/fpu, kvm: Remove host CR0.TS manipulation
[karo-tx-linux.git] / arch / x86 / kvm / x86.c
index e375235d81c9b3a141a341223b617b8eac06c0a0..cfe6a75b5358bfe4c5826941258b2212cb9919f5 100644 (file)
@@ -5060,11 +5060,6 @@ static void emulator_get_fpu(struct x86_emulate_ctxt *ctxt)
 {
        preempt_disable();
        kvm_load_guest_fpu(emul_to_vcpu(ctxt));
-       /*
-        * CR0.TS may reference the host fpu state, not the guest fpu state,
-        * so it may be clear at this point.
-        */
-       clts();
 }
 
 static void emulator_put_fpu(struct x86_emulate_ctxt *ctxt)
@@ -7386,25 +7381,13 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
 
 void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
 {
-       if (!vcpu->guest_fpu_loaded) {
-               vcpu->fpu_counter = 0;
+       if (!vcpu->guest_fpu_loaded)
                return;
-       }
 
        vcpu->guest_fpu_loaded = 0;
        copy_fpregs_to_fpstate(&vcpu->arch.guest_fpu);
        __kernel_fpu_end();
        ++vcpu->stat.fpu_reload;
-       /*
-        * If using eager FPU mode, or if the guest is a frequent user
-        * of the FPU, just leave the FPU active for next time.
-        * 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 (!use_eager_fpu()) {
-               if (++vcpu->fpu_counter < 5)
-                       kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
-       }
        trace_kvm_fpu(0);
 }