summaryrefslogtreecommitdiff
path: root/drivers/kvm/x86.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-11-18 13:54:33 +0200
committerAvi Kivity <avi@qumranet.com>2008-01-30 17:53:04 +0200
commitf096ed8588b53bf802b84862c6c4d00d25d1ed72 (patch)
tree5050a7f7c00b47897c2f4e28c338673bc2dc8fa7 /drivers/kvm/x86.c
parente1beb1d37c3187aa12c6463bd15ba594e9986761 (diff)
downloadlwn-f096ed8588b53bf802b84862c6c4d00d25d1ed72.tar.gz
lwn-f096ed8588b53bf802b84862c6c4d00d25d1ed72.zip
KVM: Add fpu_reload counter
Measure the number of times we switch the fpu state. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86.c')
-rw-r--r--drivers/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index 923dfd4e0afd..c1211e125b43 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -62,6 +62,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
{ "irq_exits", STAT_OFFSET(irq_exits) },
{ "host_state_reload", STAT_OFFSET(host_state_reload) },
{ "efer_reload", STAT_OFFSET(efer_reload) },
+ { "fpu_reload", STAT_OFFSET(fpu_reload) },
{ NULL }
};
@@ -2417,6 +2418,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
vcpu->guest_fpu_loaded = 0;
fx_save(&vcpu->guest_fx_image);
fx_restore(&vcpu->host_fx_image);
+ ++vcpu->stat.fpu_reload;
}
EXPORT_SYMBOL_GPL(kvm_put_guest_fpu);