[PATCH] KVM: arm/arm64: Output Guest cntvoff value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Amit Tomar <amittomer25@xxxxxxxxx>

This provides an easy access to guest's CVTVOFF value, somewhat
similar to how x86 outputs TSC offset value.

Signed-off-by: Amit Singh Tomar <amittomer25@xxxxxxxxx>
---
 virt/kvm/arm/arch_timer.c |    1 +
 virt/kvm/arm/trace.h      |   15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 69bca18..b0800fe 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -466,4 +466,5 @@ void kvm_timer_enable(struct kvm *kvm)
 void kvm_timer_init(struct kvm *kvm)
 {
 	kvm->arch.timer.cntvoff = kvm_phys_timer_read();
+	trace_kvm_timer_init(kvm->arch.timer.cntvoff);
 }
diff --git a/virt/kvm/arm/trace.h b/virt/kvm/arm/trace.h
index 37d8b98..c7e1c2f 100644
--- a/virt/kvm/arm/trace.h
+++ b/virt/kvm/arm/trace.h
@@ -52,6 +52,21 @@ TRACE_EVENT(kvm_timer_update_irq,
 		  __entry->vcpu_id, __entry->irq, __entry->level)
 );
 
+TRACE_EVENT(kvm_timer_init,
+	TP_PROTO(unsigned long long cntvoff),
+	TP_ARGS(cntvoff),
+
+	TP_STRUCT__entry(
+		__field(	unsigned long long, cntvoff)
+	),
+
+	TP_fast_assign(
+		__entry->cntvoff	= cntvoff;
+	),
+
+	TP_printk("CNTVOFF: %llx", __entry->cntvoff)
+);
+
 #endif /* _TRACE_KVM_H */
 
 #undef TRACE_INCLUDE_PATH
-- 
1.7.9.5

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux