Commit f096ed85 authored by Avi Kivity's avatar Avi Kivity

KVM: Add fpu_reload counter

Measure the number of times we switch the fpu state.
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent e1beb1d3
...@@ -248,6 +248,7 @@ struct kvm_stat { ...@@ -248,6 +248,7 @@ struct kvm_stat {
u32 irq_exits; u32 irq_exits;
u32 host_state_reload; u32 host_state_reload;
u32 efer_reload; u32 efer_reload;
u32 fpu_reload;
}; };
struct kvm_io_device { struct kvm_io_device {
......
...@@ -62,6 +62,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { ...@@ -62,6 +62,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
{ "irq_exits", STAT_OFFSET(irq_exits) }, { "irq_exits", STAT_OFFSET(irq_exits) },
{ "host_state_reload", STAT_OFFSET(host_state_reload) }, { "host_state_reload", STAT_OFFSET(host_state_reload) },
{ "efer_reload", STAT_OFFSET(efer_reload) }, { "efer_reload", STAT_OFFSET(efer_reload) },
{ "fpu_reload", STAT_OFFSET(fpu_reload) },
{ NULL } { NULL }
}; };
...@@ -2417,6 +2418,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu) ...@@ -2417,6 +2418,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
vcpu->guest_fpu_loaded = 0; vcpu->guest_fpu_loaded = 0;
fx_save(&vcpu->guest_fx_image); fx_save(&vcpu->guest_fx_image);
fx_restore(&vcpu->host_fx_image); fx_restore(&vcpu->host_fx_image);
++vcpu->stat.fpu_reload;
} }
EXPORT_SYMBOL_GPL(kvm_put_guest_fpu); EXPORT_SYMBOL_GPL(kvm_put_guest_fpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment