summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorAvi Kivity2010-05-03 15:05:44 +0200
committerAvi Kivity2010-08-01 09:35:28 +0200
commit1c11e713576edf33b95669be9c2dc0ff1e0c90d3 (patch)
tree9d7cde9a08747e4e633302b418de4b8eedaf1c2b /arch/x86/kvm/x86.c
parentKVM: kvm_pdptr_read() may sleep (diff)
downloadkernel-qcow2-linux-1c11e713576edf33b95669be9c2dc0ff1e0c90d3.tar.gz
kernel-qcow2-linux-1c11e713576edf33b95669be9c2dc0ff1e0c90d3.tar.xz
kernel-qcow2-linux-1c11e713576edf33b95669be9c2dc0ff1e0c90d3.zip
KVM: VMX: Avoid writing HOST_CR0 every entry
cr0.ts may change between entries, so we copy cr0 to HOST_CR0 before each entry. That is slow, so instead, set HOST_CR0 to have TS set unconditionally (which is a safe value), and issue a clts() just before exiting vcpu context if the task indeed owns the fpu. Saves ~50 cycles/exit. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1b270fd60634..801afc6461ed 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1731,8 +1731,8 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
{
- kvm_put_guest_fpu(vcpu);
kvm_x86_ops->vcpu_put(vcpu);
+ kvm_put_guest_fpu(vcpu);
}
static int is_efer_nx(void)