Measure the number of times we switch the fpu state.
Signed-off-by: Avi Kivity <[email protected]>
---
drivers/kvm/kvm.h | 1 +
drivers/kvm/x86.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 04efe88..a85c590 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -248,6 +248,7 @@ struct kvm_stat {
u32 irq_exits;
u32 host_state_reload;
u32 efer_reload;
+ u32 fpu_reload;
};
struct kvm_io_device {
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index 923dfd4..c1211e1 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);
--
1.5.3.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]